# anujakunniyarath/bbms_project architecture

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

- Interactive diagram: https://gitdiagram.com/anujakunniyarath/bbms_project
- Repository: https://github.com/anujakunniyarath/bbms_project

## Overview

##### Main components
- Client Browser (HTML/CSS/JS)
- Web Server (Apache + PHP runtime)
- Database Server (MySQL)
- Static Asset Store (CSS, HTML templates, JS files)

##### Break down the Web Server tier into functional modules
- Authentication Module
– loginpage.php → validates credentials → session management
- Donor Management Module
– donor_form.php → donor_submit.php → donor_details.php
- Patient Management Module
– patient_form.php → patient_process.php → patient_details.php
- Doctor Management Module
– doctor_details.php
- Blood Stock Module
– stock.php → updates/retrieves stock levels
- Search Module
– search.php → dynamic queries on donors/patients/doctors/stock
- Presentation Layer
– index.html → home page
– bbms_bbDetails.html
– CSS (style.css, loginstyle.css, bbms_bbDetails.css)

##### Relationships and data flows
– Browser issues HTTP(s) requests → Web Server (PHP scripts)
– PHP scripts read/write → MySQL database (CRUD operations)
– Responses rendered as HTML/CSS/JS and sent back → Browser

##### Architectural patterns
- Three‑Tier Architecture (Presentation, Business Logic, Data)
- Monolithic PHP application (no microservices)
- Server‑side rendering for all pages
- Logical MVC separation (controllers = .php scripts, views = HTML/CSS, model = MySQL)

##### Relevant technologies to annotate
- Apache HTTP Server + mod_php
- PHP 7.x/8.x
- MySQL 5.x/8.x
- HTML5/CSS3/Vanilla JS

##### Detail to capture
- Static assets served directly (CSS/HTML) vs dynamic pages (PHP scripts)
- Session management crossing between Authentication and other modules
- Data‑flow for key use cases: donor registration, patient lookup, stock update
- Search module hitting multiple tables

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Tier
    subgraph "Client Browser" 
        direction TB
        C1["index.html"] 
        C2["bbms_bbDetails.html"]
        C3["style.css"]
        C4["loginstyle.css"]
        C5["bbms_bbDetails.css"]
    end

    %% Web Server Tier
    subgraph "Web Server (Apache + PHP)"
        direction TB
        subgraph "Authentication Module"
            A["loginpage.php"]
        end
        subgraph "Donor Management Module"
            D1["donor_form.php"]
            D2["donor_submit.php"]
            D3["donor_details.php"]
        end
        subgraph "Patient Management Module"
            P1["patient_form.php"]
            P2["patient_process.php"]
            P3["patient_details.php"]
        end
        subgraph "Doctor Management Module"
            DR["doctor_details.php"]
        end
        subgraph "Blood Stock Module"
            S["stock.php"]
        end
        subgraph "Search Module"
            SR["search.php"]
        end
    end

    %% Database Tier
    DB["MySQL Database"]:::database

    %% Relationships
    C1 -->|"HTTP GET"| A
    C2 -->|"HTTP GET"| A
    C3 -->|"static asset"| A
    C4 -->|"static asset"| A
    C5 -->|"static asset"| A

    C1 -->|"POST/GET"| D1
    C1 -->|"POST/GET"| P1
    C1 -->|"GET"| DR
    C1 -->|"GET/POST"| S
    C1 -->|"GET/POST"| SR

    A -->|"Validate credentials\nSession start"| DB
    D2 -->|"INSERT donor record"| DB
    D3 -->|"SELECT donor details"| DB
    P2 -->|"INSERT patient record"| DB
    P3 -->|"SELECT patient details"| DB
    DR -->|"SELECT doctor details"| DB
    S -->|"UPDATE/SELECT stock"| DB
    SR -->|"Dynamic queries"| DB

    DB -->|"Query results"| A
    DB -->|"Query results"| D3
    DB -->|"Query results"| P3
    DB -->|"Query results"| DR
    DB -->|"Query results"| S
    DB -->|"Query results"| SR

    %% Click Events
    click C1 "https://github.com/anujakunniyarath/bbms_project/blob/main/index.html"
    click C2 "https://github.com/anujakunniyarath/bbms_project/blob/main/bbms_bbDetails.html"
    click C3 "https://github.com/anujakunniyarath/bbms_project/blob/main/style.css"
    click C4 "https://github.com/anujakunniyarath/bbms_project/blob/main/loginstyle.css"
    click C5 "https://github.com/anujakunniyarath/bbms_project/blob/main/bbms_bbDetails.css"
    click A "https://github.com/anujakunniyarath/bbms_project/blob/main/loginpage.php"
    click D1 "https://github.com/anujakunniyarath/bbms_project/blob/main/donor_form.php"
    click D2 "https://github.com/anujakunniyarath/bbms_project/blob/main/donor_submit.php"
    click D3 "https://github.com/anujakunniyarath/bbms_project/blob/main/donor_details.php"
    click P1 "https://github.com/anujakunniyarath/bbms_project/blob/main/patient_form.php"
    click P2 "https://github.com/anujakunniyarath/bbms_project/blob/main/patient_process.php"
    click P3 "https://github.com/anujakunniyarath/bbms_project/blob/main/patient_details.php"
    click DR "https://github.com/anujakunniyarath/bbms_project/blob/main/doctor_details.php"
    click S "https://github.com/anujakunniyarath/bbms_project/blob/main/stock.php"
    click SR "https://github.com/anujakunniyarath/bbms_project/blob/main/search.php"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef backend fill:#d4edda,stroke:#333,stroke-width:1px
    classDef database fill:#ffeeba,stroke:#333,stroke-width:1px

    class C1,C2,C3,C4,C5 frontend
    class A,D1,D2,D3,P1,P2,P3,DR,S,SR backend
```
