# mouad-dadda/doctor-appointment-booking-app architecture

> Architecture diagram of the GitHub repository mouad-dadda/doctor-appointment-booking-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mouad-dadda/doctor-appointment-booking-app
- Repository: https://github.com/mouad-dadda/doctor-appointment-booking-app

## Overview

##### Main Components

a) Client Layer:
- React Frontend Application
- Redux State Management
- i18n Internationalization
- Authentication Guards/Middleware
- User Interfaces (Admin, Doctor, Patient)

b) API Layer:
- Laravel Backend
- REST API Endpoints
- Authentication Controllers
- Route Protection

c) Data Layer:
- MySQL Database
- Models (Users, Doctors, Appointments, Admins)

##### Key Architectural Elements

Frontend Tier:
- User Interface Components
- Public Pages (Home, About, Contact)
- Admin Dashboard
- Doctor Portal
- Patient Portal

- State Management
- Redux Store
- Authentication Slices

- Middleware
- Auth Guards
- Role-based Access Control
- Email Verification

API Tier:
- Laravel Controllers
- Auth Controllers
- Appointment Management
- User Management

- Middleware
- Authentication
- CSRF Protection
- Request Validation

Data Tier:
- Database Schema
- Users Table
- Doctors Table
- Appointments Table
- Admins Table

##### Interaction Flows to Highlight

- Authentication Flow
- Appointment Booking Process
- Doctor Verification Workflow
- Admin Management Operations

##### Important Relationships

- Frontend-Backend communication via Axios
- Authentication flow between tiers
- Database relationships between models
- Role-based access control

##### Additional Elements

- Error handling paths
- Validation layers
- Security measures
- Internationalization points

##### Technical Stack Indicators

- React (Frontend Framework)
- Laravel (Backend Framework)
- Redux (State Management)
- MySQL (Database)
- Tailwind CSS (Styling)

Remember to highlight the three main user roles (Admin, Doctor, Patient) and their respective access patterns, as this is central to the application's functionality.

This system design should effectively communicate both the high-level architecture and the important implementation details of the DocAppoint system.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef frontend fill:#0085CA,color:white
    classDef api fill:#2ecc71,color:white
    classDef database fill:#e67e22,color:white
    classDef middleware fill:#95a5a6,color:white
    classDef auth fill:#8e44ad,color:white

    %% Frontend Layer
    subgraph Frontend
        UI[User Interface]
        UI --> AdminUI[Admin Dashboard]
        UI --> DoctorUI[Doctor Portal]
        UI --> PatientUI[Patient Portal]
        UI --> PublicPages[Public Pages]
        
        StateManagement[Redux Store]
        I18N[i18n System]
        AuthGuards[Auth Guards]
        
        StateManagement --> AdminSlice[Admin Auth Slice]
        StateManagement --> DoctorSlice[Doctor Auth Slice]
        StateManagement --> UserSlice[User Auth Slice]
    end

    %% API Layer
    subgraph Backend
        APIControllers[Laravel Controllers]
        APIControllers --> AdminController[Admin Controller]
        APIControllers --> DoctorController[Doctor Controller]
        APIControllers --> UserController[User Controller]
        APIControllers --> AppointmentController[Appointment Controller]
        
        AuthControllers[Auth Controllers]
        AuthControllers --> AdminAuth[Admin Auth]
        AuthControllers --> DoctorAuth[Doctor Auth]
        AuthControllers --> UserAuth[User Auth]
        
        APIMiddleware[Backend Middleware]
        APIMiddleware --> AuthMiddleware[Authentication]
        APIMiddleware --> CSRFProtection[CSRF Protection]
    end

    %% Data Layer
    subgraph Database
        Models[Database Models]
        Models --> UsersTable[Users]
        Models --> DoctorsTable[Doctors]
        Models --> AppointmentsTable[Appointments]
        Models --> AdminsTable[Admins]
    end

    %% Relationships
    UI --> StateManagement
    UI --> I18N
    StateManagement --> APIControllers
    AuthGuards --> AuthControllers
    APIControllers --> Models
    AuthControllers --> Models

    %% Click Events
    click UI "https://github.com/mouad-dadda/Doctor-appointment-booking-app/tree/main/FrontEnd/src/"
    click StateManagement "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/FrontEnd/src/Redux/Store.jsx"
    click AdminSlice "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/FrontEnd/src/Redux/SliceAuthAdmin.jsx"
    click DoctorSlice "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/FrontEnd/src/Redux/SliceAuthDoctor.jsx"
    click UserSlice "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/FrontEnd/src/Redux/SliceAuthUser.jsx"
    click I18N "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/FrontEnd/src/i18n.js"
    click AuthGuards "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/FrontEnd/src/Middleware/AuthGuard.jsx"
    click AdminUI "https://github.com/mouad-dadda/Doctor-appointment-booking-app/tree/main/FrontEnd/src/Components/Admin/"
    click DoctorUI "https://github.com/mouad-dadda/Doctor-appointment-booking-app/tree/main/FrontEnd/src/Components/Doctors/"
    click PatientUI "https://github.com/mouad-dadda/Doctor-appointment-booking-app/tree/main/FrontEnd/src/Components/User/"
    click AdminController "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/BackEnd/app/Http/Controllers/AdminController.php"
    click DoctorController "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/BackEnd/app/Http/Controllers/DoctorManagementController.php"
    click UserController "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/BackEnd/app/Http/Controllers/UsersManagementController.php"
    click AppointmentController "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/BackEnd/app/Http/Controllers/AppointmentManagementController.php"
    click AdminAuth "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/BackEnd/app/Http/Controllers/Auth/Admin/AdminAuthController.php"
    click DoctorAuth "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/BackEnd/app/Http/Controllers/Auth/Doctor/DoctorAuthController.php"
    click UserAuth "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/BackEnd/app/Http/Controllers/Auth/User/UserAuthController.php"
    click AuthMiddleware "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/BackEnd/app/Http/Middleware/Authenticate.php"
    click CSRFProtection "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/BackEnd/app/Http/Middleware/VerifyCsrfToken.php"
    click UsersTable "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/BackEnd/app/Models/User.php"
    click DoctorsTable "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/BackEnd/app/Models/Doctor.php"
    click AppointmentsTable "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/BackEnd/app/Models/Appointment.php"
    click AdminsTable "https://github.com/mouad-dadda/Doctor-appointment-booking-app/blob/main/BackEnd/app/Models/Admin.php"

    %% Style Applications
    class UI,AdminUI,DoctorUI,PatientUI,PublicPages,StateManagement,I18N,AuthGuards,AdminSlice,DoctorSlice,UserSlice frontend
    class APIControllers,AdminController,DoctorController,UserController,AppointmentController,AuthControllers,AdminAuth,DoctorAuth,UserAuth api
    class Models,UsersTable,DoctorsTable,AppointmentsTable,AdminsTable database
    class APIMiddleware,AuthMiddleware,CSRFProtection middleware
    class AuthControllers,AdminAuth,DoctorAuth,UserAuth auth
```
