# hashenudara/edoc-doctor-appointment-system architecture

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

- Interactive diagram: https://gitdiagram.com/hashenudara/edoc-doctor-appointment-system
- Repository: https://github.com/hashenudara/edoc-doctor-appointment-system

## Overview

##### Project Type and Purpose
- The project is a web-based, multi-role appointment booking system built using PHP, HTML, and CSS.
- Its purpose is to allow patients to make online appointments; enable doctors to manage schedules and appointments; and allow an administrator to handle doctor details, schedules, and overall system management.
- Additionally, the project is containerized (it includes a Dockerfile and docker-compose.yml) and uses a MySQL database (as indicated by SQL_Database_edoc.sql).

##### File Structure
- The file tree shows separate directories for the three main user roles – admin, doctor, and patient – each containing role-specific PHP pages for functionalities like appointments, profile editing, and schedule management.
- There are shared resources such as CSS files (organized in a dedicated “css” folder with additional assets like fonts and animations), connection.php (which likely defines database connectivity), and public-facing pages like index.html, login.php, and signup.php.
- Presence of Docker-related files suggests container deployment and possible separation between the web server environment (Apache/PHP) and the database service (MySQL).

##### Core Components
- Client/Browser Layer: Representing the end-user accessing the application via web pages.
- Role-based UI Modules:
▪ Admin Panel: (admin/* files) – where the administrator manages doctors, sessions, and patient details.
▪ Doctor Dashboard: (doctor/* files) – for handling appointment views, session management, and settings.
▪ Patient Portal: (patient/* files) – for making appointments, account management, and viewing bookings.
- Web Server / Application Layer:
▪ The PHP application, which includes all logic across various directories. It connects to the database using connection.php.
▪ Static assets (CSS, images, HTML) used to render the interface.
- Database Layer:
▪ MySQL database (as defined by SQL_Database_edoc.sql) which stores user details, appointments, doctor schedules, etc.
- Containerization:

##### Relationships and Interactions
- Clients (Admins, Doctors, and Patients) interact with the system via their respective web interfaces.
- The PHP backend handles requests and communicates with the MySQL database for operations such as booking, editing, and deleting appointments or sessions.
- Authentication flows (login.php, logout.php) tie into the user role distinction and should be shown as directional data flows.

##### Instructing the Principal Software Engineer
- Web Clients (Browsers) accessing the system.
- The central PHP application layer that processes requests.
- The MySQL database with which the application interacts.
- From the client to the PHP server.
- From the PHP server to the database for CRUD operations.
- From the database back to the PHP server for response generation.
- If needed, include deployment components indicating how Docker and docker-compose are used to run the Apache/PHP and MySQL containers.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Client/Browser Layer
    subgraph "Client Browser Layer"
        index_html("index.html"):::client
        login_php("login.php"):::client
        signup_php("signup.php"):::client
        logout_php("logout.php"):::client
    end

    %% Containerization Files
    subgraph "Containerization Files"
        dockerfile("Dockerfile"):::container
        dockercompose("docker-compose.yml"):::container
    end

    %% Docker Container: Web Server
    subgraph "Docker Container: Web Server"
        PHP_App("PHP Application/Logic\n(connection.php, create-account.php)"):::app
        Admin_Module("Admin Module\n(Manage doctors/sessions)"):::app
        Doctor_Module("Doctor Module\n(Appointments & Sessions)"):::app
        Patient_Module("Patient Module\n(Booking interface)"):::app
        Static_Assets("Static Assets\n(css/, img/)"):::app
    end

    %% Docker Container: MySQL
    subgraph "Docker Container: MySQL"
        DB("MySQL Database"):::database
    end

    %% Arrows from Client to PHP Application (Web Server)
    index_html -->|"request"| PHP_App
    login_php  -->|"authRequest"| PHP_App
    signup_php -->|"regRequest"| PHP_App
    logout_php -->|"logout"| PHP_App

    %% Role Modules forwarding requests to PHP Application
    Admin_Module  -->|"process"| PHP_App
    Doctor_Module -->|"process"| PHP_App
    Patient_Module -->|"process"| PHP_App
    Static_Assets -->|"serve"| PHP_App

    %% PHP Application interacting with Database
    PHP_App -->|"query"| DB
    DB -->|"result"| PHP_App

    %% Containerization configuration relationships
    dockerfile ---|"configures"| PHP_App
    dockercompose ---|"orchestrates"| PHP_App
    dockerfile ---|"configures"| DB
    dockercompose ---|"orchestrates"| DB

    %% Click Events
    click index_html "https://github.com/hashenudara/edoc-doctor-appointment-system/blob/main/index.html"
    click login_php "https://github.com/hashenudara/edoc-doctor-appointment-system/blob/main/login.php"
    click signup_php "https://github.com/hashenudara/edoc-doctor-appointment-system/blob/main/signup.php"
    click logout_php "https://github.com/hashenudara/edoc-doctor-appointment-system/blob/main/logout.php"
    click Admin_Module "https://github.com/hashenudara/edoc-doctor-appointment-system/tree/main/admin/"
    click Doctor_Module "https://github.com/hashenudara/edoc-doctor-appointment-system/tree/main/doctor/"
    click Patient_Module "https://github.com/hashenudara/edoc-doctor-appointment-system/tree/main/patient/"
    click PHP_App "https://github.com/hashenudara/edoc-doctor-appointment-system/blob/main/connection.php"
    click Static_Assets "https://github.com/hashenudara/edoc-doctor-appointment-system/tree/main/css/"
    click DB "https://github.com/hashenudara/edoc-doctor-appointment-system/blob/main/SQL_Database_edoc.sql"
    click dockerfile "https://github.com/hashenudara/edoc-doctor-appointment-system/tree/main/Dockerfile"
    click dockercompose "https://github.com/hashenudara/edoc-doctor-appointment-system/blob/main/docker-compose.yml"

    %% Styles
    classDef client fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef app fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef database fill:#ffdead,stroke:#000,stroke-width:2px,stroke-dasharray:5,5;
    classDef container fill:#F4A460,stroke:#000,stroke-width:1px;
```
