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
/client
)/src/components
Contains all reusable React components organized by feature:
/common
: Shared components used across the application
Header.jsx
: Navigation header componentFooter.jsx
: Application footerLoadingSpinner.jsx
: Loading indicator componentSlotCard.jsx
: Individual slot display component/auth
: Authentication-related components
LoginForm.jsx
: User login formRegisterForm.jsx
: User registration form/dashboard
: Dashboard components
AdminDashboard.jsx
: Administrative dashboardUserDashboard.jsx
: Regular user dashboard/booking
: Booking-related components
BookingModal.jsx
: Modal for booking confirmationSlotCalendar.jsx
: Calendar view for slotsBookingForm.jsx
: Form for creating bookings/src/pages
Page-level components that represent different routes:
/Login
: Authentication pages/Dashboard
: Dashboard pages/Booking
: Booking management pages/Admin
: Administrative pages/src/stores
Zustand state management stores:
authStore.js
: Authentication and user stateslotStore.js
: Slot data and operationsbookingStore.js
: Booking management state/src/services
API service modules for backend communication:
authAPI.js
: Authentication API callsslotAPI.js
: Slot-related API callsbookingAPI.js
: Booking API calls/src/utils
Utility functions and constants:
helpers.js
: Common helper functionsconstants.js
: Application constants/server
)/controllers
Request handlers and business logic:
authController.js
: Authentication logicslotController.js
: Slot management logicbookingController.js
: Booking operations/models
MongoDB/Mongoose schemas:
User.js
: User data modelSlot.js
: Slot data modelBooking.js
: Booking data model/routes
Express.js route definitions:
auth.js
: Authentication routesslots.js
: Slot management routesbookings.js
: Booking routes/middleware
Custom Express middleware:
auth.js
: Authentication middlewarevalidation.js
: Input validation middleware/config
Configuration files:
database.js
: MongoDB connection configuration/docs
)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 processesSlotCard.jsx
)authStore.js
)slotAPI.js
)LoginPage.jsx
)authController.js
)