# ankemravi/blood-donation-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/ankemravi/blood-donation-management-system
- Repository: https://github.com/ankemravi/blood-donation-management-system

## Overview

Blood Bridge is a blood-donation coordination web application: people register or sign in, requesters post blood needs, and donors find compatible nearby requests and accept them. Requesters can review and cancel requests or complete accepted donations; users can also view their own requests and donations. The ASP.NET API separates controllers, services, repositories, and persisted domain data, with a scheduled job expiring requests and resetting donor availability. Frontend-to-API calls and the authentication controller’s implementation were not shown, so those links are marked unverified.

Main entry points: [`blood-bridge-frontend/src/App.jsx`](https://github.com/ankemravi/blood-donation-management-system/blob/main/blood-bridge-frontend/src/App.jsx) (Routes and providers), [`blood-bridge-frontend/src/api/axios.js`](https://github.com/ankemravi/blood-donation-management-system/blob/main/blood-bridge-frontend/src/api/axios.js) (API client), [`BloodWebsite/Repositories/BloodRequestRepository.cs`](https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Repositories/BloodRequestRepository.cs) (Request repository), [`BloodWebsite/Data/AppDbContext.cs`](https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Data/AppDbContext.cs) (Application database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web frontend"]
  node_webapp["Routes and providers<br/>[App.jsx]"]
  node_authpages["Sign in and register<br/>[Login.jsx]"]
  node_requestpages["Create and browse<br/>[CreateRequest.jsx]"]
  node_accountpages["My requests and donations<br/>[MyRequests.jsx]"]
  node_detailpage["Request details<br/>[RequestDetails.jsx]"]
  node_authstate["Authentication state<br/>[AuthContext.jsx]"]
  node_httpclient["API client<br/>[axios.js]"]
end

subgraph group_api["API and application services"]
  node_authcontroller["Authentication endpoints<br/>[AuthController.cs]"]
  node_requestcontroller["Request endpoints"]
  node_authservice["Authentication rules<br/>[AuthService.cs]"]
  node_requestservice["Request coordination"]
  node_requestdto["Request data contracts"]
  node_authdto["Authentication contracts"]
end

subgraph group_domain["Donation domain and persistence"]
  node_authrepo["Account repository<br/>[AuthRepository.cs]"]
  node_requestrepo["Request repository"]
  node_distance["Distance calculation<br/>[DistanceHelper.cs]"]
  node_requestdata["Request and account data<br/>[BloodRequest.cs]"]
  node_database[("Application database<br/>[AppDbContext.cs]")]
end

subgraph group_background["Scheduled maintenance"]
  node_maintenance["Expiry and availability job"]
end

node_visitor(("Requester or donor"))
node_sqlserver[("SQL Server")]

node_visitor -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_authpages
node_webapp -->|"routes to"| node_requestpages
node_webapp -->|"routes to"| node_accountpages
node_webapp -->|"routes to"| node_detailpage
node_webapp -->|"provides"| node_authstate
node_authpages -.->|"uses"| node_authstate
node_authpages -.->|"calls"| node_httpclient
node_requestpages -.->|"calls"| node_httpclient
node_accountpages -.->|"calls"| node_httpclient
node_detailpage -.->|"calls"| node_httpclient
node_httpclient -.->|"sends API requests"| node_requestcontroller
node_httpclient -.->|"sends API requests"| node_authcontroller
node_requestcontroller -->|"calls"| node_requestservice
node_requestservice -->|"delegates to"| node_requestrepo
node_requestrepo -->|"queries and saves"| node_database
node_requestrepo -->|"calculates distance"| node_distance
node_requestservice -->|"calculates distance"| node_distance
node_requestrepo -->|"projects results"| node_requestdto
node_database -->|"maps entities"| node_requestdata
node_authcontroller -.->|"calls"| node_authservice
node_authservice -.->|"delegates to"| node_authrepo
node_authrepo -->|"queries and saves"| node_database
node_authservice -->|"uses contracts"| node_authdto
node_maintenance -->|"expires and resets"| node_requestrepo
node_sqlserver -.->|"stores data"| node_database

click node_webapp "https://github.com/ankemravi/blood-donation-management-system/blob/main/blood-bridge-frontend/src/App.jsx"
click node_authpages "https://github.com/ankemravi/blood-donation-management-system/blob/main/blood-bridge-frontend/src/pages/Login.jsx"
click node_requestpages "https://github.com/ankemravi/blood-donation-management-system/blob/main/blood-bridge-frontend/src/pages/CreateRequest.jsx"
click node_accountpages "https://github.com/ankemravi/blood-donation-management-system/blob/main/blood-bridge-frontend/src/pages/MyRequests.jsx"
click node_detailpage "https://github.com/ankemravi/blood-donation-management-system/blob/main/blood-bridge-frontend/src/pages/RequestDetails.jsx"
click node_authstate "https://github.com/ankemravi/blood-donation-management-system/blob/main/blood-bridge-frontend/src/context/AuthContext.jsx"
click node_httpclient "https://github.com/ankemravi/blood-donation-management-system/blob/main/blood-bridge-frontend/src/api/axios.js"
click node_authcontroller "https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Controllers/AuthController.cs"
click node_requestcontroller "https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Controllers/BloodRequestController.cs"
click node_authservice "https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Services/AuthService.cs"
click node_requestservice "https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Services/BloodRequestService.cs"
click node_authrepo "https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Repositories/AuthRepository.cs"
click node_requestrepo "https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Repositories/BloodRequestRepository.cs"
click node_distance "https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Helpers/DistanceHelper.cs"
click node_requestdata "https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Models/BloodRequest.cs"
click node_requestdto "https://github.com/ankemravi/blood-donation-management-system/tree/main/BloodWebsite/DTOs/BloodRequest"
click node_authdto "https://github.com/ankemravi/blood-donation-management-system/tree/main/BloodWebsite/DTOs"
click node_database "https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Data/AppDbContext.cs"
click node_maintenance "https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/BackgroundJobs/BloodRequestBackgroundService.cs"

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_webapp,node_authpages,node_requestpages,node_accountpages,node_detailpage,node_authstate,node_httpclient toneBlue
class node_authcontroller,node_requestcontroller,node_authservice,node_requestservice,node_requestdto,node_authdto,node_sqlserver toneAmber
class node_authrepo,node_requestrepo,node_distance,node_requestdata,node_database,node_visitor toneMint
class node_maintenance toneRose
```

## Components

### Web frontend

- [Routes and providers](https://github.com/ankemravi/blood-donation-management-system/blob/main/blood-bridge-frontend/src/App.jsx): `blood-bridge-frontend/src/App.jsx`
- [Sign in and register](https://github.com/ankemravi/blood-donation-management-system/blob/main/blood-bridge-frontend/src/pages/Login.jsx): `blood-bridge-frontend/src/pages/Login.jsx`
- [Create and browse](https://github.com/ankemravi/blood-donation-management-system/blob/main/blood-bridge-frontend/src/pages/CreateRequest.jsx): `blood-bridge-frontend/src/pages/CreateRequest.jsx`
- [My requests and donations](https://github.com/ankemravi/blood-donation-management-system/blob/main/blood-bridge-frontend/src/pages/MyRequests.jsx): `blood-bridge-frontend/src/pages/MyRequests.jsx`
- [Request details](https://github.com/ankemravi/blood-donation-management-system/blob/main/blood-bridge-frontend/src/pages/RequestDetails.jsx): `blood-bridge-frontend/src/pages/RequestDetails.jsx`
- [Authentication state](https://github.com/ankemravi/blood-donation-management-system/blob/main/blood-bridge-frontend/src/context/AuthContext.jsx): `blood-bridge-frontend/src/context/AuthContext.jsx`
- [API client](https://github.com/ankemravi/blood-donation-management-system/blob/main/blood-bridge-frontend/src/api/axios.js): `blood-bridge-frontend/src/api/axios.js`

### API and application services

- [Authentication endpoints](https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Controllers/AuthController.cs): `BloodWebsite/Controllers/AuthController.cs`
- [Request endpoints](https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Controllers/BloodRequestController.cs): `BloodWebsite/Controllers/BloodRequestController.cs`
- [Authentication rules](https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Services/AuthService.cs): `BloodWebsite/Services/AuthService.cs`
- [Request coordination](https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Services/BloodRequestService.cs): `BloodWebsite/Services/BloodRequestService.cs`
- [Request data contracts](https://github.com/ankemravi/blood-donation-management-system/tree/main/BloodWebsite/DTOs/BloodRequest): `BloodWebsite/DTOs/BloodRequest`
- [Authentication contracts](https://github.com/ankemravi/blood-donation-management-system/tree/main/BloodWebsite/DTOs): `BloodWebsite/DTOs`

### Donation domain and persistence

- [Account repository](https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Repositories/AuthRepository.cs): `BloodWebsite/Repositories/AuthRepository.cs`
- [Request repository](https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Repositories/BloodRequestRepository.cs): `BloodWebsite/Repositories/BloodRequestRepository.cs`
- [Distance calculation](https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Helpers/DistanceHelper.cs): `BloodWebsite/Helpers/DistanceHelper.cs`
- [Request and account data](https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Models/BloodRequest.cs): `BloodWebsite/Models/BloodRequest.cs`
- [Application database](https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/Data/AppDbContext.cs): `BloodWebsite/Data/AppDbContext.cs`

### Scheduled maintenance

- [Expiry and availability job](https://github.com/ankemravi/blood-donation-management-system/blob/main/BloodWebsite/BackgroundJobs/BloodRequestBackgroundService.cs): `BloodWebsite/BackgroundJobs/BloodRequestBackgroundService.cs`

### Other components

- **Requester or donor**
- **SQL Server**

## Connections

- Requester or donor → Routes and providers: uses
- Routes and providers → Sign in and register: routes to (evidence: `blood-bridge-frontend/src/App.jsx`)
- Routes and providers → Create and browse: routes to (evidence: `blood-bridge-frontend/src/App.jsx`)
- Routes and providers → My requests and donations: routes to (evidence: `blood-bridge-frontend/src/App.jsx`)
- Routes and providers → Request details: routes to (evidence: `blood-bridge-frontend/src/App.jsx`)
- Routes and providers → Authentication state: provides (evidence: `blood-bridge-frontend/src/App.jsx`)
- Sign in and register → Authentication state: uses
- Sign in and register → API client: calls
- Create and browse → API client: calls
- My requests and donations → API client: calls
- Request details → API client: calls
- API client → Request endpoints: sends API requests
- API client → Authentication endpoints: sends API requests
- Request endpoints → Request coordination: calls (evidence: `BloodWebsite/Controllers/BloodRequestController.cs`)
- Request coordination → Request repository: delegates to (evidence: `BloodWebsite/Services/BloodRequestService.cs`)
- Request repository → Application database: queries and saves (evidence: `BloodWebsite/Repositories/BloodRequestRepository.cs`)
- Request repository → Distance calculation: calculates distance (evidence: `BloodWebsite/Repositories/BloodRequestRepository.cs`)
- Request coordination → Distance calculation: calculates distance (evidence: `BloodWebsite/Services/BloodRequestService.cs`)
- Request repository → Request data contracts: projects results (evidence: `BloodWebsite/Repositories/BloodRequestRepository.cs`)
- Application database → Request and account data: maps entities (evidence: `BloodWebsite/Data/AppDbContext.cs`)
- Authentication endpoints → Authentication rules: calls
- Authentication rules → Account repository: delegates to
- Account repository → Application database: queries and saves (evidence: `BloodWebsite/Repositories/AuthRepository.cs`)
- Authentication rules → Authentication contracts: uses contracts
- Expiry and availability job → Request repository: expires and resets (evidence: `BloodWebsite/BackgroundJobs/BloodRequestBackgroundService.cs`)
- SQL Server → Application database: stores data
