# rohith121/bloodbank-app architecture

> Architecture diagram of the GitHub repository rohith121/bloodbank-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rohith121/bloodbank-app
- Repository: https://github.com/rohith121/bloodbank-app

## Overview

This repository is a PHP/MySQL blood-bank application, with standalone browser-based health calculators alongside it. The main user flow is login, then donor registration or donor search; an admin login leads to donor-data management. The sampled PHP shows session checks and database operations, while the README documents the MySQL donor/user schema. Calculator scripts independently compute BMI, calorie needs, and weight conversions. Some PHP excerpts are incomplete, so links for unsampled behavior are omitted; deployment configuration and build tooling are not part of this runtime map.

Main entry points: [`config.php`](https://github.com/rohith121/bloodbank-app/blob/master/config.php) (DB connection and session), [`database/init.sql`](https://github.com/rohith121/bloodbank-app/blob/master/database/init.sql) (Blood-bank database), [`index.php`](https://github.com/rohith121/bloodbank-app/blob/master/index.php) (User login), [`indexadmin.php`](https://github.com/rohith121/bloodbank-app/blob/master/indexadmin.php) (Admin login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and accounts"]
  node_login["User login<br/>[index.php]"]
  node_adminlogin["Admin login<br/>[indexadmin.php]"]
  node_home["Application home<br/>[index.html]"]
  node_signup["Account signup<br/>[signup.php]"]
end

subgraph group_donors["Donor workflows"]
  node_donate["Register donor<br/>[donate-blood.php]"]
  node_find["Find donors<br/>[find-donor.php]"]
  node_search["Blood-group search<br/>[search.php]"]
  node_admin["Manage donor data<br/>[deletedata.php]"]
end

subgraph group_persistence["Data access"]
  node_config["DB connection and session<br/>[config.php]"]
  node_db[("Blood-bank database<br/>[init.sql]")]
end

subgraph group_health["Health calculators"]
  node_bmi["BMI calculator<br/>[script.js]"]
  node_calories["Calorie calculator<br/>[app.js]"]
  node_weight["Weight converter<br/>[script.js]"]
end

node_visitor(("Visitor"))

node_visitor -->|"submits credentials"| node_login
node_login -->|"opens connection"| node_config
node_login -->|"redirects on success"| node_home
node_visitor -->|"submits credentials"| node_adminlogin
node_adminlogin -->|"opens connection"| node_config
node_adminlogin -->|"redirects on success"| node_admin
node_donate -->|"includes"| node_config
node_donate -.->|"adds donor"| node_db
node_find -->|"includes"| node_config
node_find -.->|"reads donors"| node_db
node_search -->|"includes"| node_config
node_search -.->|"queries donors"| node_db
node_admin -->|"includes"| node_config
node_admin -.->|"deletes donor data"| node_db
node_db -.->|"stores donor and user records"| node_config

click node_login "https://github.com/rohith121/bloodbank-app/blob/master/index.php"
click node_adminlogin "https://github.com/rohith121/bloodbank-app/blob/master/indexadmin.php"
click node_home "https://github.com/rohith121/bloodbank-app/blob/master/index.html"
click node_signup "https://github.com/rohith121/bloodbank-app/blob/master/signup.php"
click node_donate "https://github.com/rohith121/bloodbank-app/blob/master/donate-blood.php"
click node_find "https://github.com/rohith121/bloodbank-app/blob/master/find-donor.php"
click node_search "https://github.com/rohith121/bloodbank-app/blob/master/search.php"
click node_admin "https://github.com/rohith121/bloodbank-app/blob/master/deletedata.php"
click node_config "https://github.com/rohith121/bloodbank-app/blob/master/config.php"
click node_db "https://github.com/rohith121/bloodbank-app/blob/master/database/init.sql"
click node_bmi "https://github.com/rohith121/bloodbank-app/blob/master/bmi/script.js"
click node_calories "https://github.com/rohith121/bloodbank-app/blob/master/caloriecalculator/app.js"
click node_weight "https://github.com/rohith121/bloodbank-app/blob/master/weightconverter/script.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_login,node_adminlogin,node_home,node_signup toneBlue
class node_donate,node_find,node_search,node_admin toneAmber
class node_config,node_db toneMint
class node_bmi,node_calories,node_weight toneRose
class node_visitor toneIndigo
```

## Components

### Access and accounts

- [User login](https://github.com/rohith121/bloodbank-app/blob/master/index.php): `index.php`
- [Admin login](https://github.com/rohith121/bloodbank-app/blob/master/indexadmin.php): `indexadmin.php`
- [Application home](https://github.com/rohith121/bloodbank-app/blob/master/index.html): `index.html`
- [Account signup](https://github.com/rohith121/bloodbank-app/blob/master/signup.php): `signup.php`

### Donor workflows

- [Register donor](https://github.com/rohith121/bloodbank-app/blob/master/donate-blood.php): `donate-blood.php`
- [Find donors](https://github.com/rohith121/bloodbank-app/blob/master/find-donor.php): `find-donor.php`
- [Blood-group search](https://github.com/rohith121/bloodbank-app/blob/master/search.php): `search.php`
- [Manage donor data](https://github.com/rohith121/bloodbank-app/blob/master/deletedata.php): `deletedata.php`

### Data access

- [DB connection and session](https://github.com/rohith121/bloodbank-app/blob/master/config.php): `config.php`
- [Blood-bank database](https://github.com/rohith121/bloodbank-app/blob/master/database/init.sql): `database/init.sql`

### Health calculators

- [BMI calculator](https://github.com/rohith121/bloodbank-app/blob/master/bmi/script.js): `bmi/script.js`
- [Calorie calculator](https://github.com/rohith121/bloodbank-app/blob/master/caloriecalculator/app.js): `caloriecalculator/app.js`
- [Weight converter](https://github.com/rohith121/bloodbank-app/blob/master/weightconverter/script.js): `weightconverter/script.js`

### Other components

- **Visitor**

## Connections

- Visitor → User login: submits credentials (evidence: `index.php`)
- User login → DB connection and session: opens connection (evidence: `index.php`)
- User login → Application home: redirects on success (evidence: `index.php`)
- Visitor → Admin login: submits credentials (evidence: `indexadmin.php`)
- Admin login → DB connection and session: opens connection (evidence: `indexadmin.php`)
- Admin login → Manage donor data: redirects on success (evidence: `indexadmin.php`)
- Register donor → DB connection and session: includes (evidence: `donate-blood.php`)
- Register donor → Blood-bank database: adds donor
- Find donors → DB connection and session: includes (evidence: `find-donor.php`)
- Find donors → Blood-bank database: reads donors
- Blood-group search → DB connection and session: includes (evidence: `search.php`)
- Blood-group search → Blood-bank database: queries donors
- Manage donor data → DB connection and session: includes (evidence: `deletedata.php`)
- Manage donor data → Blood-bank database: deletes donor data
- Blood-bank database → DB connection and session: stores donor and user records
