This document outlines the complete directory structure and organization of the Slot Booking System.
slot-booking-system/
├── client/ # Frontend React Application (Vite)
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ │ ├── common/
│ │ │ │ ├── Header.jsx
│ │ │ │ ├── Footer.jsx
│ │ │ │ ├── LoadingSpinner.jsx
│ │ │ │ └── SlotCard.jsx
│ │ │ ├── auth/
│ │ │ │ ├── LoginForm.jsx
│ │ │ │ └── RegisterForm.jsx
│ │ │ ├── dashboard/
│ │ │ │ ├── AdminDashboard.jsx
│ │ │ │ └── UserDashboard.jsx
│ │ │ └── booking/
│ │ │ ├── BookingModal.jsx
│ │ │ ├── SlotCalendar.jsx
│ │ │ └── BookingForm.jsx
│ │ ├── pages/ # Page components
│ │ │ ├── Login/
│ │ │ │ └── LoginPage.jsx
│ │ │ ├── Dashboard/
│ │ │ │ └── DashboardPage.jsx
│ │ │ ├── Booking/
│ │ │ │ ├── BookSlotPage.jsx
│ │ │ │ └── ViewSlotsPage.jsx
│ │ │ └── Admin/
│ │ │ └── AdminPage.jsx
│ │ ├── stores/ # Zustand state stores
│ │ │ ├── authStore.js
│ │ │ ├── slotStore.js
│ │ │ └── bookingStore.js
│ │ ├── services/ # API services
│ │ │ ├── authAPI.js
│ │ │ ├── slotAPI.js
│ │ │ └── bookingAPI.js
│ │ ├── utils/ # Utility functions
│ │ │ ├── helpers.js
│ │ │ └── constants.js
│ │ ├── App.jsx
│ │ ├── App.css
│ │ └── main.jsx
│ ├── public/
│ │ ├── index.html
│ │ └── favicon.ico
│ ├── package.json
│ ├── vite.config.js
│ └── .env
│
├── server/ # Backend Node.js Application
│ ├── controllers/ # Route controllers
│ │ ├── authController.js
│ │ ├── slotController.js
│ │ └── bookingController.js
│ ├── models/ # MongoDB schemas
│ │ ├── User.js
│ │ ├── Slot.js
│ │ └── Booking.js
│ ├── routes/ # API routes
│ │ ├── auth.js
│ │ ├── slots.js
│ │ └── bookings.js
│ ├── middleware/ # Custom middleware
│ │ ├── auth.js
│ │ └── validation.js
│ ├── config/ # Configuration files
│ │ └── database.js
│ ├── .env
│ ├── package.json
│ └── server.js
│
├── docs/ # Documentation files
│ ├── PROJECT_STRUCTURE.md
│ ├── DATABASE_SCHEMA.md
│ ├── STATE_MANAGEMENT.md
│ ├── API_DOCUMENTATION.md
│ └── USER_ROLES.md
│
│
├── README.md
├── .gitignore
└── LICENSE
Contains all reusable React components organized by feature:
-
/common: Shared components used across the applicationHeader.jsx: Navigation header componentFooter.jsx: Application footerLoadingSpinner.jsx: Loading indicator componentSlotCard.jsx: Individual slot display component
-
/auth: Authentication-related componentsLoginForm.jsx: User login formRegisterForm.jsx: User registration form
-
/dashboard: Dashboard componentsAdminDashboard.jsx: Administrative dashboardUserDashboard.jsx: Regular user dashboard
-
/booking: Booking-related componentsBookingModal.jsx: Modal for booking confirmationSlotCalendar.jsx: Calendar view for slotsBookingForm.jsx: Form for creating bookings
Page-level components that represent different routes:
/Login: Authentication pages/Dashboard: Dashboard pages/Booking: Booking management pages/Admin: Administrative pages
Zustand state management stores:
authStore.js: Authentication and user stateslotStore.js: Slot data and operationsbookingStore.js: Booking management state
API service modules for backend communication:
authAPI.js: Authentication API callsslotAPI.js: Slot-related API callsbookingAPI.js: Booking API calls
Utility functions and constants:
helpers.js: Common helper functionsconstants.js: Application constants
Request handlers and business logic:
authController.js: Authentication logicslotController.js: Slot management logicbookingController.js: Booking operations
MongoDB/Mongoose schemas:
User.js: User data modelSlot.js: Slot data modelBooking.js: Booking data model
Express.js route definitions:
auth.js: Authentication routesslots.js: Slot management routesbookings.js: Booking routes
Custom Express middleware:
auth.js: Authentication middlewarevalidation.js: Input validation middleware
Configuration files:
database.js: MongoDB connection configuration
Organized documentation files:
PROJECT_STRUCTURE.md: This file - project organizationDATABASE_SCHEMA.md: Database schemas and modelsSTATE_MANAGEMENT.md: Zustand store implementationsAPI_DOCUMENTATION.md: Complete API referenceUSER_ROLES.md: User roles and permissionsDEVELOPMENT_WORKFLOW.md: Development processes
- Feature-based grouping: Components are organized by functionality
- Reusability: Common components are separated for reuse
- Clear separation: Pages vs components distinction
- Centralized stores: Each domain has its own Zustand store
- Co-location: Related state and actions are grouped together
- Clear boundaries: Separate concerns between auth, slots, and bookings
- MVC pattern: Clear separation of routes, controllers, and models
- Middleware approach: Reusable middleware for common functionality
- Configuration management: Environment-specific settings
- Components: PascalCase (e.g.,
SlotCard.jsx) - Stores: camelCase with "Store" suffix (e.g.,
authStore.js) - Services: camelCase with "API" suffix (e.g.,
slotAPI.js) - Pages: PascalCase with "Page" suffix (e.g.,
LoginPage.jsx) - Controllers: camelCase with "Controller" suffix (e.g.,
authController.js)