This document describes the reorganized folder structure of the Admin Console application.
src/
├── components/ # React components
│ ├── Navbar.jsx # Top navigation bar with search
│ ├── Sidebar.jsx # Left sidebar menu
│ ├── Dashboard.jsx # Main dashboard container
│ ├── OverviewCards.jsx # Revenue/Profit/Expenses cards
│ └── Charts.jsx # Line and Pie charts
│
├── data/ # Data files
│ ├── chartData.js # Line and pie chart data
│ └── overviewData.js # Overview metrics data
│
├── utils/ # Utility functions
│ └── colors.js # Color utility functions
│
├── styles/ # Component-specific styles
│ ├── Navbar.css # Navbar styles
│ ├── Sidebar.css # Sidebar styles
│ └── Dashboard.css # Dashboard styles
│
├── assets/ # Images and static files
│ └── react.svg
│
├── App.jsx # Main app component (orchestrates everything)
├── App.css # Global styles
├── main.jsx # Entry point
└── index.css # Base styles
- Manages global state (toast notifications, search)
- Coordinates all child components
- Handles feature click events
- Top navigation bar
- Search functionality
- Logo and navigation links
- Logout button
- Left menu navigation
- Menu items: Overview, Analytics, Settings
- Main content area
- Greeting section
- Integrates OverviewCards and Charts
- Displays Revenue, Profit, Expenses cards
- Responsive grid layout
- Dynamic filtering based on search
- Line Chart (Revenue/Expenses/Profit over time)
- Pie Chart (Distribution breakdown)
- Uses Recharts library
export const lineData = [...]; // Monthly data
export const pieData = [...]; // Distribution dataexport const overviewProps = [...]; // Metrics cards dataApp.css- Root layout, logo animationsindex.css- Base typography, colors
Navbar.css- Navbar and logo animationSidebar.css- Sidebar menu stylingDashboard.css- Main content area and cards
getChartColors(colorName)- Returns hex color for theme color namegetColorsFromProps(props)- Generates color array from props
-
Maintainability ✅
- Each component has a single responsibility
- Easy to find and update specific features
-
Reusability ✅
- Components can be imported and reused
- Data files can be easily replaced or modified
-
Scalability ✅
- Easy to add new components
- Clear separation of concerns
-
Testing ✅
- Components can be tested individually
- Data can be mocked easily
-
Collaboration ✅
- Team members can work on different components
- Clear file organization reduces conflicts
- Create file in
src/components/ComponentName.jsx - Create corresponding CSS in
src/styles/ComponentName.css - Import in
App.jsxor parent component
- Create file in
src/data/dataName.js - Export data as named export
- Import where needed
- Create file in
src/utils/utilityName.js - Export functions
- Import in components
All functionality remains the same:
- ✅ Search works
- ✅ Navigation works
- ✅ Charts display correctly
- ✅ Toast notifications work
- ✅ All styling preserved
No breaking changes - just better organization!
Next Steps:
- Consider adding TypeScript for type safety
- Add unit tests for components
- Implement React Router for navigation
- Add API integration for real data