# akashraajputh/healthcare_booking_payment_platform architecture

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

- Interactive diagram: https://gitdiagram.com/akashraajputh/healthcare_booking_payment_platform
- Repository: https://github.com/akashraajputh/healthcare_booking_payment_platform

## Overview

EVE is a FastAPI diagnostic-booking API. A client discovers centres, tests, and centre-specific prices; authenticates; creates a future booking at the server-derived price; then simulates payment or receives a provider webhook that updates the booking. Users can list, inspect, and cancel their own pending bookings, while admins manage the catalogue. The graph reflects documented route capabilities and sampled service logic; unsampled route internals are represented conservatively.

Main entry points: [`app/main.py`](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/main.py) (FastAPI app), [`app/core/database.py`](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/core/database.py) (Async DB sessions), [`app/services/payment_service.py`](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/services/payment_service.py) (Payment operations), [`app/services/booking_service.py`](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/services/booking_service.py) (Booking operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API surface"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_auth_routes["Auth routes<br/>[auth.py]"]
  node_centre_routes["Centre routes<br/>[centres.py]"]
  node_test_routes["Test routes<br/>[tests.py]"]
  node_booking_routes["Booking routes<br/>[bookings.py]"]
  node_payment_routes["Payment routes<br/>[payments.py]"]
  node_health["Health checks<br/>[main.py]"]
end

subgraph group_domain["Booking and payments"]
  node_booking_service["Booking operations<br/>[booking_service.py]"]
  node_payment_service["Payment operations<br/>[payment_service.py]"]
end

subgraph group_identity["Identity and access"]
  node_auth_service["Auth operations<br/>[auth_service.py]"]
  node_access["Token and roles<br/>[dependencies.py]"]
  node_security["Password and JWT<br/>[security.py]"]
end

subgraph group_persistence["Persistence"]
  node_booking_model["Bookings<br/>[booking.py]"]
  node_payment_model["Payments<br/>[payment.py]"]
  node_event_model["Webhook events<br/>[webhook_event.py]"]
  node_user_model["Users<br/>[user.py]"]
  node_db_session["Async DB sessions<br/>[database.py]"]
  node_postgres[("PostgreSQL")]
end

node_client(("Client"))
node_provider(("Payment provider"))

node_client -->|"sends requests"| node_api_app
node_provider -.->|"posts webhook"| node_payment_routes
node_api_app -->|"mounts router"| node_auth_routes
node_api_app -->|"mounts router"| node_centre_routes
node_api_app -->|"mounts router"| node_test_routes
node_api_app -->|"mounts router"| node_booking_routes
node_api_app -->|"mounts router"| node_payment_routes
node_api_app -->|"serves checks"| node_health
node_auth_routes -->|"calls"| node_auth_service
node_auth_service -->|"hashes and verifies"| node_security
node_auth_service -->|"reads and writes"| node_user_model
node_access -->|"decodes token"| node_security
node_access -->|"loads active user"| node_user_model
node_centre_routes -->|"uses session"| node_db_session
node_test_routes -->|"uses session"| node_db_session
node_booking_routes -->|"calls"| node_booking_service
node_booking_service -->|"creates and queries"| node_booking_model
node_booking_service -->|"queries and commits"| node_db_session
node_payment_routes -->|"calls"| node_payment_service
node_payment_service -->|"checks and updates"| node_booking_model
node_payment_service -->|"creates payment"| node_payment_model
node_payment_service -->|"records event"| node_event_model
node_payment_service -->|"transacts"| node_db_session
node_db_session -->|"connects"| node_postgres
node_health -->|"checks readiness"| node_db_session

click node_api_app "https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/main.py"
click node_auth_routes "https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/api/routes/auth.py"
click node_centre_routes "https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/api/routes/centres.py"
click node_test_routes "https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/api/routes/tests.py"
click node_booking_routes "https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/api/routes/bookings.py"
click node_payment_routes "https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/api/routes/payments.py"
click node_health "https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/main.py"
click node_auth_service "https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/services/auth_service.py"
click node_access "https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/api/dependencies.py"
click node_security "https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/core/security.py"
click node_booking_service "https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/services/booking_service.py"
click node_payment_service "https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/services/payment_service.py"
click node_booking_model "https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/models/booking.py"
click node_payment_model "https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/models/payment.py"
click node_event_model "https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/models/webhook_event.py"
click node_user_model "https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/models/user.py"
click node_db_session "https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/core/database.py"

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_api_app,node_auth_routes,node_centre_routes,node_test_routes,node_booking_routes,node_payment_routes,node_health,node_client toneBlue
class node_booking_service,node_payment_service toneAmber
class node_auth_service,node_access,node_security toneMint
class node_booking_model,node_payment_model,node_event_model,node_user_model,node_db_session,node_postgres toneRose
class node_provider toneIndigo
```

## Components

### API surface

- [FastAPI app](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/main.py): `app/main.py`
- [Auth routes](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/api/routes/auth.py): `app/api/routes/auth.py`
- [Centre routes](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/api/routes/centres.py): `app/api/routes/centres.py`
- [Test routes](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/api/routes/tests.py): `app/api/routes/tests.py`
- [Booking routes](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/api/routes/bookings.py): `app/api/routes/bookings.py`
- [Payment routes](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/api/routes/payments.py): `app/api/routes/payments.py`
- [Health checks](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/main.py): `app/main.py`

### Booking and payments

- [Booking operations](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/services/booking_service.py): `app/services/booking_service.py`
- [Payment operations](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/services/payment_service.py): `app/services/payment_service.py`

### Identity and access

- [Auth operations](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/services/auth_service.py): `app/services/auth_service.py`
- [Token and roles](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/api/dependencies.py): `app/api/dependencies.py`
- [Password and JWT](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/core/security.py): `app/core/security.py`

### Persistence

- [Bookings](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/models/booking.py): `app/models/booking.py`
- [Payments](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/models/payment.py): `app/models/payment.py`
- [Webhook events](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/models/webhook_event.py): `app/models/webhook_event.py`
- [Users](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/models/user.py): `app/models/user.py`
- [Async DB sessions](https://github.com/akashraajputh/healthcare_booking_payment_platform/blob/main/app/core/database.py): `app/core/database.py`
- **PostgreSQL**

### Other components

- **Client**
- **Payment provider**

## Connections

- Client → FastAPI app: sends requests
- Payment provider → Payment routes: posts webhook
- FastAPI app → Auth routes: mounts router
- FastAPI app → Centre routes: mounts router
- FastAPI app → Test routes: mounts router
- FastAPI app → Booking routes: mounts router
- FastAPI app → Payment routes: mounts router
- FastAPI app → Health checks: serves checks
- Auth routes → Auth operations: calls
- Auth operations → Password and JWT: hashes and verifies
- Auth operations → Users: reads and writes
- Token and roles → Password and JWT: decodes token
- Token and roles → Users: loads active user
- Centre routes → Async DB sessions: uses session
- Test routes → Async DB sessions: uses session
- Booking routes → Booking operations: calls
- Booking operations → Bookings: creates and queries
- Booking operations → Async DB sessions: queries and commits
- Payment routes → Payment operations: calls
- Payment operations → Bookings: checks and updates
- Payment operations → Payments: creates payment
- Payment operations → Webhook events: records event
- Payment operations → Async DB sessions: transacts
- Async DB sessions → PostgreSQL: connects
- Health checks → Async DB sessions: checks readiness
