# labib108/patient-management-system-laravel architecture

> Architecture diagram of the GitHub repository labib108/patient-management-system-laravel, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/labib108/patient-management-system-laravel
- Repository: https://github.com/labib108/patient-management-system-laravel

## Overview

##### Component Relationships

- User authentication flow
- SOAP notes data flow
- Appointment scheduling process
- Report generation pipeline

##### Specific Implementation Details

- Blue rectangles: Core modules (Dashboard, Appointments, SOAP Notes)
- Green diamonds: Security components (Authentication, Middleware)
- Purple rectangles: External services (Mail system)

##### Key Architectural Elements to Highlight

a) Authentication System:
- OTP verification flow
- JWT token handling
- Session management

b) SOAP Notes Management:
- Basic SOAP
- General SOAP
- Detailed SOAP
- Voice-to-text integration

c) Data Management:
- Patient records
- Appointment scheduling
- History tracking
- Report generation

##### Specific Features

- Voice-to-text functionality
- Automated report generation
- Patient history management
- Appointment scheduling system
- Search functionality

##### Technical Stack Indicators

- Laravel framework
- Frontend: Blade templates, CSS, JavaScript
- Database: MySQL/PostgreSQL
- Authentication: JWT
- Mail system integration

##### Data Flow Indicators

- User request flows
- Data persistence paths
- Authentication processes
- Report generation workflows

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        UI["User Interface"]:::frontend
        click UI "https://github.com/labib108/patient-management-system-laravel/blob/main/resources/views/layout/app.blade.php"
        Auth["Authentication Pages"]:::frontend
        click Auth "https://github.com/labib108/patient-management-system-laravel/tree/main/resources/views/components/login"
        Dashboard["Dashboard Interface"]:::frontend
        click Dashboard "https://github.com/labib108/patient-management-system-laravel/tree/main/resources/views/components/dashboard"
        SOAPUI["SOAP Notes Interface"]:::frontend
        click SOAPUI "https://github.com/labib108/patient-management-system-laravel/tree/main/resources/views/components/soap"
        AppointUI["Appointment Interface"]:::frontend
        click AppointUI "https://github.com/labib108/patient-management-system-laravel/tree/main/resources/views/components/appointment"
        ReportUI["Report Interface"]:::frontend
        click ReportUI "https://github.com/labib108/patient-management-system-laravel/tree/main/resources/views/components/report"
        Assets["Static Assets"]:::frontend
        click Assets "https://github.com/labib108/patient-management-system-laravel/tree/main/public"
    end

    subgraph Application
        AuthSystem["Authentication System"]:::auth
        click AuthSystem "https://github.com/labib108/patient-management-system-laravel/blob/main/app/Http/Middleware/TokenVerification.php"
        JWT["JWT Handler"]:::auth
        click JWT "https://github.com/labib108/patient-management-system-laravel/blob/main/app/helper/JWTToken.php"
        MailService["Mail Service/OTP"]:::service
        click MailService "https://github.com/labib108/patient-management-system-laravel/blob/main/app/Mail/OTPMail.php"
        
        subgraph Controllers
            DashboardCtrl["Dashboard Controller"]:::controller
            click DashboardCtrl "https://github.com/labib108/patient-management-system-laravel/blob/main/app/Http/Controllers/DashboardController.php"
            SOAPCtrl["SOAP Controller"]:::controller
            click SOAPCtrl "https://github.com/labib108/patient-management-system-laravel/blob/main/app/Http/Controllers/soapController.php"
            AppointCtrl["Appointment Controller"]:::controller
            click AppointCtrl "https://github.com/labib108/patient-management-system-laravel/blob/main/app/Http/Controllers/appiontmentController.php"
            ReportCtrl["Report Controller"]:::controller
            click ReportCtrl "https://github.com/labib108/patient-management-system-laravel/blob/main/app/Http/Controllers/ReportController.php"
            HistoryCtrl["History Controller"]:::controller
            click HistoryCtrl "https://github.com/labib108/patient-management-system-laravel/blob/main/app/Http/Controllers/HistoryController.php"
        end

        VoiceText["Voice-to-Text Service"]:::service
    end

    subgraph Data
        subgraph Models
            UserModel["User Model"]:::model
            click UserModel "https://github.com/labib108/patient-management-system-laravel/blob/main/app/Models/User.php"
            AppointModel["Appointment Model"]:::model
            click AppointModel "https://github.com/labib108/patient-management-system-laravel/blob/main/app/Models/Appointment.php"
            HistoryModel["History Model"]:::model
            click HistoryModel "https://github.com/labib108/patient-management-system-laravel/blob/main/app/Models/History.php"
            BasicSOAP["Basic SOAP Model"]:::model
            click BasicSOAP "https://github.com/labib108/patient-management-system-laravel/blob/main/app/Models/BasicSoapAnswer.php"
            GeneralSOAP["General SOAP Model"]:::model
            click GeneralSOAP "https://github.com/labib108/patient-management-system-laravel/blob/main/app/Models/GeneralSoapAnswer.php"
            DetailSOAP["Detailed SOAP Model"]:::model
            click DetailSOAP "https://github.com/labib108/patient-management-system-laravel/blob/main/app/Models/DetailSoapAnswer.php"
        end
        
        DB[(Database)]:::database
        click DB "https://github.com/labib108/patient-management-system-laravel/tree/main/database/migrations"
    end

    %% Frontend to Application Connections
    UI --> AuthSystem
    Auth --> AuthSystem
    Dashboard --> DashboardCtrl
    SOAPUI --> SOAPCtrl
    AppointUI --> AppointCtrl
    ReportUI --> ReportCtrl

    %% Application Layer Connections
    AuthSystem --> JWT
    AuthSystem --> MailService
    SOAPCtrl --> VoiceText
    
    %% Controller to Model Connections
    DashboardCtrl --> UserModel
    SOAPCtrl --> BasicSOAP
    SOAPCtrl --> GeneralSOAP
    SOAPCtrl --> DetailSOAP
    AppointCtrl --> AppointModel
    HistoryCtrl --> HistoryModel
    
    %% Model to Database Connections
    UserModel --> DB
    AppointModel --> DB
    HistoryModel --> DB
    BasicSOAP --> DB
    GeneralSOAP --> DB
    DetailSOAP --> DB

    %% Styling
    classDef frontend fill:#a8d5ff,stroke:#333,stroke-width:2px
    classDef auth fill:#98ff98,stroke:#333,stroke-width:2px
    classDef service fill:#ffb6c1,stroke:#333,stroke-width:2px
    classDef controller fill:#f8d486,stroke:#333,stroke-width:2px
    classDef model fill:#dda0dd,stroke:#333,stroke-width:2px
    classDef database fill:#b8860b,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        Frontend_L["Frontend Component"]:::frontend
        Auth_L["Auth Component"]:::auth
        Service_L["Service Component"]:::service
        Controller_L["Controller"]:::controller
        Model_L["Model"]:::model
        DB_L[(Database)]:::database
    end
```
