# dhvanil-pansuriya/healthstream architecture

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

- Interactive diagram: https://gitdiagram.com/dhvanil-pansuriya/healthstream
- Repository: https://github.com/dhvanil-pansuriya/healthstream

## Overview

##### Project type and purpose
- It supports four user roles (Patient, Doctor, Assistant, Sudo-Admin) each with its own portal, plus shared pages (index.php, signup.php, navbar.php, logout.php).
- It uses Bootstrap (CSS/JS), custom JS (app.js, bot.js), and a MySQL dump (healthstream.sql) for data storage.

##### File structure
- Top-level files & folders:
- config.php – central configuration (database credentials, session setup)
- DataBase/healthstream.sql – MySQL schema and seed data
- css/, js/, fonts/ – static assets for styling and client-side behavior
- signup.php, index.php, navbar.php, logout.php – shared entry points and UI
- Role-specific directories (MVC-lite):
- Patient/, Doctor/, Assistant/, Sudo-Admin/ – each contains index.php (dashboard), navbar.php, logout.php, plus role-specific actions (e.g., myPatient.php, removeUser.php)
- No explicit “models” or “controllers” folders; logic is embedded in each page.
- No external microservices—this is a single monolithic PHP application.

##### README
- README only contains the project name “HealthStream,” so there are no additional architectural clues beyond the folder layout.

##### Critical details
- Four user-role modules distinctly.
- Shared components: config.php, navbar.php, logout.php.
- Single database and its tables (users, patients, doctors, appointments, etc.).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Clients"
        PB["Patient Browser"]:::browsers
        DBR["Doctor Browser"]:::browsers
        AB["Assistant Browser"]:::browsers
        SB["Admin Browser"]:::browsers
    end

    WS["Web Server<br/>(Apache/PHP)"]:::webserver

    subgraph "Static Assets"
        CSS["CSS"]:::static
        JS["JavaScript"]:::static
        FONTS["Fonts"]:::static
    end

    subgraph "PHP Application"
        CFG["config.php"]:::phpapp

        subgraph "Shared Pages"
            SH_index["index.php"]:::phpapp
            SH_signup["signup.php"]:::phpapp
            SH_navbar["navbar.php"]:::phpapp
            SH_logout["logout.php"]:::phpapp
        end

        subgraph "Patient Module"
            P_index["index.php"]:::phpapp
            P_navbar["navbar.php"]:::phpapp
            P_logout["logout.php"]:::phpapp
            P_bot["bot.php"]:::phpapp
            P_mydoctor["mydoctor.php"]:::phpapp
            P_more["moreAboutDoctor.php"]:::phpapp
        end

        subgraph "Doctor Module"
            D_index["index.php"]:::phpapp
            D_navbar["navbar.php"]:::phpapp
            D_logout["logout.php"]:::phpapp
            D_mypatient["myPatient.php"]:::phpapp
            D_remove["removeUser.php"]:::phpapp
        end

        subgraph "Assistant Module"
            A_index["index.php"]:::phpapp
            A_navbar["navbar.php"]:::phpapp
            A_logout["logout.php"]:::phpapp
            A_all["allPatient.php"]:::phpapp
            A_remove["removeUser.php"]:::phpapp
        end

        subgraph "Sudo-Admin Module"
            S_index["index.php"]:::phpapp
            S_navbar["navbar.php"]:::phpapp
            S_logout["logout.php"]:::phpapp
            S_kickA["kickoutAssistant.php"]:::phpapp
            S_kickD["kickoutDoctor.php"]:::phpapp
            S_manageA["manageAssistant.php"]:::phpapp
            S_manageD["manageDoctor.php"]:::phpapp
            S_removeA["removeAssistant.php"]:::phpapp
            S_removeD["removeDoctor.php"]:::phpapp
        end
    end

    DB["MySQL Database"]:::database

    %% Connections
    PB -->|HTTPS Request| WS
    DBR -->|HTTPS Request| WS
    AB -->|HTTPS Request| WS
    SB -->|HTTPS Request| WS

    WS -->|loads config| CFG
    WS -->|serves assets| CSS
    WS -->|serves assets| JS
    WS -->|serves assets| FONTS

    CFG --> SH_index
    CFG --> SH_signup
    CFG --> SH_navbar
    CFG --> SH_logout

    CFG --> P_index
    CFG --> D_index
    CFG --> A_index
    CFG --> S_index

    SH_index --> DB
    SH_signup --> DB

    P_index --> DB
    P_bot --> DB
    P_mydoctor --> DB
    P_more --> DB

    D_index --> DB
    D_mypatient --> DB
    D_remove --> DB

    A_index --> DB
    A_all --> DB
    A_remove --> DB

    S_index --> DB
    S_kickA --> DB
    S_kickD --> DB
    S_manageA --> DB
    S_manageD --> DB
    S_removeA --> DB
    S_removeD --> DB

    CSS --> PB
    JS --> PB
    FONTS --> PB

    %% Click Events
    click CFG "https://github.com/dhvanil-pansuriya/healthstream/blob/main/config.php"
    click DB "https://github.com/dhvanil-pansuriya/healthstream/blob/main/DataBase/healthstream.sql"
    click CSS "https://github.com/dhvanil-pansuriya/healthstream/tree/main/css/"
    click JS "https://github.com/dhvanil-pansuriya/healthstream/tree/main/js/"
    click FONTS "https://github.com/dhvanil-pansuriya/healthstream/tree/main/fonts/"
    click SH_index "https://github.com/dhvanil-pansuriya/healthstream/blob/main/index.php"
    click SH_signup "https://github.com/dhvanil-pansuriya/healthstream/blob/main/signup.php"
    click SH_navbar "https://github.com/dhvanil-pansuriya/healthstream/blob/main/navbar.php"
    click SH_logout "https://github.com/dhvanil-pansuriya/healthstream/blob/main/logout.php"
    click P_index "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Patient/index.php"
    click P_navbar "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Patient/navbar.php"
    click P_logout "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Patient/logout.php"
    click P_bot "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Patient/bot.php"
    click P_mydoctor "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Patient/mydoctor.php"
    click P_more "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Patient/moreAboutDoctor.php"
    click D_index "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Doctor/index.php"
    click D_navbar "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Doctor/navbar.php"
    click D_logout "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Doctor/logout.php"
    click D_mypatient "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Doctor/myPatient.php"
    click D_remove "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Doctor/removeUser.php"
    click A_index "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Assistant/index.php"
    click A_navbar "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Assistant/navbar.php"
    click A_logout "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Assistant/logout.php"
    click A_all "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Assistant/allPatient.php"
    click A_remove "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Assistant/removeUser.php"
    click S_index "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Sudo-Admin/index.php"
    click S_navbar "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Sudo-Admin/navbar.php"
    click S_logout "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Sudo-Admin/logout.php"
    click S_kickA "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Sudo-Admin/kickoutAssistant.php"
    click S_kickD "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Sudo-Admin/kickoutDoctor.php"
    click S_manageA "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Sudo-Admin/manageAssistant.php"
    click S_manageD "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Sudo-Admin/manageDoctor.php"
    click S_removeA "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Sudo-Admin/removeAssistant.php"
    click S_removeD "https://github.com/dhvanil-pansuriya/healthstream/blob/main/Sudo-Admin/removeDoctor.php"

    %% Styles
    classDef browsers fill:#B3E5FC,stroke:#333,stroke-width:1px
    classDef webserver fill:#FFCC80,stroke:#333,stroke-width:1px
    classDef phpapp fill:#FFE0B2,stroke:#333,stroke-width:1px
    classDef database fill:#C8E6C9,stroke:#333,stroke-width:1px
    classDef static fill:#E1BEE7,stroke:#333,stroke-width:1px
```
