// README - Modular Sidrah Business App Structure
📁 FILE STRUCTURE
src/
├── App.tsx (MAIN - Login + Router)
├── components/
│ ├── Sidebar.tsx (Navigation)
│ ├── Header.tsx (Page Title/Subtitle)
│ └── common.tsx (Colors, Styles, Helpers)
├── pages/
│ ├── Dashboard.tsx (Overview Page)
│ ├── incidents/
│ │ ├── IncidentForm.tsx (Submit Form)
│ │ └── IncidentsList.tsx (View All)
│ ├── ideas/
│ │ ├── IdeaForm.tsx (Submit Form)
│ │ └── IdeasList.tsx (View All)
│ ├── orders/
│ │ ├── OrderForm.tsx (Submit Form)
│ │ └── OrdersList.tsx (View All)
│ └── organizations/
│ └── OrganizationsList.tsx (View All)
├── types/
│ └── index.ts (All Interfaces)
└── utils/
└── api.ts (API Calls)
🚀 SETUP INSTRUCTIONS
1. Create Folder Structure
mkdir -p src/{components,pages/{incidents,ideas,orders,organizations},types,utils}
2. Copy Files to Correct Locations
Root Level:
App.tsx→src/App.tsx
Components:
components_Sidebar.tsx→src/components/Sidebar.tsxcomponents_Header.tsx→src/components/Header.tsxcomponents_common.tsx→src/components/common.tsx
Types:
types_index.ts→src/types/index.ts
Utils:
utils_api.ts→src/utils/api.ts
Pages:
pages_Dashboard.tsx→src/pages/Dashboard.tsxpages_incidents_IncidentForm.tsx→src/pages/incidents/IncidentForm.tsxpages_incidents_IncidentsList.tsx→src/pages/incidents/IncidentsList.tsxpages_ideas_IdeaForm.tsx→src/pages/ideas/IdeaForm.tsxpages_ideas_IdeasList.tsx→src/pages/ideas/IdeasList.tsxpages_orders_OrderForm.tsx→src/pages/orders/OrderForm.tsxpages_orders_OrdersList.tsx→src/pages/orders/OrdersList.tsxpages_organizations_OrganizationsList.tsx→src/pages/organizations/OrganizationsList.tsx
📦 KEY BENEFITS
✅ Modular - Each page in its own file ✅ Scalable - Easy to add new pages ✅ Maintainable - Clear folder structure ✅ Reusable - Shared components & utilities ✅ Type-Safe - Centralized type definitions ✅ Clean - Separated concerns
🔧 HOW TO ADD NEW PAGE
- Create folder:
src/pages/newfeature/ - Create component files:
NewFeatureForm.tsxNewFeatureList.tsx
- Import in
App.tsx - Add to Sidebar navigation
- Done! 🎉
📝 EDIT COLORS
Edit src/components/common.tsx:
export const colors = {
primary: '#3b82f6', // Change this
secondary: '#10b981',
// ... etc
}
🔒 ENABLE ROLE RESTRICTIONS
In src/App.tsx, uncomment lines to enable roles:
// const isManager = user.role === 'Manager'
// const isReadOnly = user.role === 'Auditor'
Then pass to page components to conditionally render.
All modular, organized, production-ready! 🚀