SLoP5.0-Slot-Booking-System

Project Structure

This document outlines the complete directory structure and organization of the Slot Booking System.

πŸ“ Complete Directory Structure

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

πŸ“‚ Directory Descriptions

Frontend (/client)

/src/components

Contains all reusable React components organized by feature:

/src/pages

Page-level components that represent different routes:

/src/stores

Zustand state management stores:

/src/services

API service modules for backend communication:

/src/utils

Utility functions and constants:

Backend (/server)

/controllers

Request handlers and business logic:

/models

MongoDB/Mongoose schemas:

/routes

Express.js route definitions:

/middleware

Custom Express middleware:

/config

Configuration files:

Documentation (/docs)

Organized documentation files:

🎯 Key Design Principles

Component Organization

State Management

Backend Structure

πŸ“ File Naming Conventions