# knehe/aero_bound_ventures-public architecture

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

- Interactive diagram: https://gitdiagram.com/knehe/aero_bound_ventures-public
- Repository: https://github.com/knehe/aero_bound_ventures-public

## Overview

Aero Bound Ventures is a full-stack flight-booking platform. Travelers search and price flights, create bookings, pay, manage seats and bookings, and receive ticket and notification updates; users can also authenticate, while administrators manage bookings and tickets. The graph separates the Next.js experience, FastAPI entry points and domain use cases, persistence, and external/event integrations. README statements support the broad system links; source-index references and excerpts support selected implementation links. Unsampled routes and adapters are represented at directory level, so their internal call wiring is not asserted.

Main entry points: [`backend/main.py`](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/main.py) (FastAPI entry), [`backend/routers/flights.py`](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/routers/flights.py) (Flight and booking routes), [`backend/crud/database.py`](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/crud/database.py) (PostgreSQL), [`backend/application/oauth/oauth_login.py`](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/application/oauth/oauth_login.py) (OAuth login workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_frontend["Next.js application<br/>[page.tsx]"]
end

subgraph group_api["API and workflows"]
  node_api_entry["FastAPI entry<br/>[main.py]"]
  node_flight_routes["Flight and booking routes<br/>[flights.py]"]
  node_flight_usecases["Flight workflows"]
  node_booking_usecases["Booking workflows"]
  node_payment_routes["Payment routes<br/>[payments.py]"]
  node_payment_usecases["Payment workflows"]
  node_oauth_routes["OAuth routes<br/>[oauth.py]"]
  node_oauth_workflow["OAuth login workflow<br/>[oauth_login.py]"]
  node_ticket_routes["Ticket routes<br/>[tickets.py]"]
  node_notification_routes["Notification routes<br/>[notifications.py]"]
  node_admin_routes["Admin routes<br/>[admin.py]"]
end

subgraph group_data["Persistence"]
  node_booking_repo["Booking repository"]
  node_notification_repo["Notification repository"]
  node_database[("PostgreSQL<br/>[database.py]")]
end

subgraph group_integrations["External services"]
  node_flight_provider["Amadeus or mock flights<br/>[flight.py]"]
  node_pesapal["Pesapal payments<br/>[pesapal.py]"]
  node_google["Google OAuth"]
  node_cloudinary["Cloudinary ticket storage"]
end

subgraph group_events["Async notifications"]
  node_redis[("Redis cache and streams<br/>[redis.py]")]
  node_kafka["Kafka<br/>[kafka.py]"]
  node_worker["Notification worker<br/>[worker.py]"]
  node_notification_service["Notification publisher"]
end

node_traveler(("Traveler"))
node_admin(("Administrator"))

node_traveler -->|"uses"| node_frontend
node_admin -->|"uses"| node_frontend
node_frontend -->|"REST and SSE"| node_api_entry
node_api_entry -->|"mounts routes"| node_flight_routes
node_api_entry -->|"mounts routes"| node_payment_routes
node_api_entry -->|"mounts routes"| node_oauth_routes
node_api_entry -->|"mounts routes"| node_ticket_routes
node_api_entry -->|"mounts routes"| node_notification_routes
node_api_entry -->|"mounts routes"| node_admin_routes
node_flight_routes -->|"dispatches to"| node_flight_usecases
node_flight_routes -->|"dispatches to"| node_booking_usecases
node_flight_routes -->|"configures repository"| node_booking_repo
node_booking_repo -->|"queries"| node_database
node_booking_usecases -->|"uses repository"| node_booking_repo
node_flight_usecases -->|"flight data"| node_flight_provider
node_payment_routes -->|"dispatches to"| node_payment_usecases
node_payment_usecases -->|"processes payments"| node_pesapal
node_oauth_routes -->|"dispatches to"| node_oauth_workflow
node_oauth_workflow -->|"fetches identity"| node_google
node_oauth_workflow -->|"user records"| node_database
node_ticket_routes -->|"stores uploads"| node_cloudinary
node_notification_routes -->|"notification records"| node_notification_repo
node_notification_service -->|"persists notification"| node_database
node_notification_service -->|"publishes updates"| node_redis
node_api_entry -->|"starts producer"| node_kafka
node_kafka -->|"delivers events"| node_worker
node_api_entry -->|"uses storage"| node_database
node_api_entry -->|"uses cache and Pub/Sub"| node_redis
node_api_entry -.->|"ticket uploads"| node_cloudinary

click node_frontend "https://github.com/knehe/aero_bound_ventures-public/blob/main/frontend/src/app/page.tsx"
click node_api_entry "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/main.py"
click node_flight_routes "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/routers/flights.py"
click node_flight_usecases "https://github.com/knehe/aero_bound_ventures-public/tree/main/backend/application/flights"
click node_booking_usecases "https://github.com/knehe/aero_bound_ventures-public/tree/main/backend/application/bookings"
click node_payment_routes "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/routers/payments.py"
click node_payment_usecases "https://github.com/knehe/aero_bound_ventures-public/tree/main/backend/application/payments"
click node_oauth_routes "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/routers/oauth.py"
click node_oauth_workflow "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/application/oauth/oauth_login.py"
click node_ticket_routes "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/routers/tickets.py"
click node_notification_routes "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/routers/notifications.py"
click node_admin_routes "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/routers/admin.py"
click node_booking_repo "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/infrastructure/bookings/sqlmodel_booking_repository.py"
click node_notification_repo "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/infrastructure/notifications/sqlmodel_notification_repository.py"
click node_database "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/crud/database.py"
click node_flight_provider "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/external_services/flight.py"
click node_pesapal "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/external_services/pesapal.py"
click node_google "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/infrastructure/oauth/google_oauth_provider.py"
click node_cloudinary "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/infrastructure/tickets/cloudinary_ticket_file_storage.py"
click node_redis "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/utils/redis.py"
click node_kafka "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/utils/kafka.py"
click node_worker "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/worker.py"
click node_notification_service "https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/utils/notification_service.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_frontend toneBlue
class node_api_entry,node_flight_routes,node_flight_usecases,node_booking_usecases,node_payment_routes,node_payment_usecases,node_oauth_routes,node_oauth_workflow,node_ticket_routes,node_notification_routes,node_admin_routes toneAmber
class node_booking_repo,node_notification_repo,node_database toneMint
class node_flight_provider,node_pesapal,node_google,node_cloudinary toneRose
class node_redis,node_kafka,node_worker,node_notification_service,node_traveler,node_admin toneIndigo
```

## Components

### Web experience

- [Next.js application](https://github.com/knehe/aero_bound_ventures-public/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`

### API and workflows

- [FastAPI entry](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/main.py): `backend/main.py`
- [Flight and booking routes](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/routers/flights.py): `backend/routers/flights.py`
- [Flight workflows](https://github.com/knehe/aero_bound_ventures-public/tree/main/backend/application/flights): `backend/application/flights`
- [Booking workflows](https://github.com/knehe/aero_bound_ventures-public/tree/main/backend/application/bookings): `backend/application/bookings`
- [Payment routes](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/routers/payments.py): `backend/routers/payments.py`
- [Payment workflows](https://github.com/knehe/aero_bound_ventures-public/tree/main/backend/application/payments): `backend/application/payments`
- [OAuth routes](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/routers/oauth.py): `backend/routers/oauth.py`
- [OAuth login workflow](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/application/oauth/oauth_login.py): `backend/application/oauth/oauth_login.py`
- [Ticket routes](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/routers/tickets.py): `backend/routers/tickets.py`
- [Notification routes](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/routers/notifications.py): `backend/routers/notifications.py`
- [Admin routes](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/routers/admin.py): `backend/routers/admin.py`

### Persistence

- [Booking repository](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/infrastructure/bookings/sqlmodel_booking_repository.py): `backend/infrastructure/bookings/sqlmodel_booking_repository.py`
- [Notification repository](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/infrastructure/notifications/sqlmodel_notification_repository.py): `backend/infrastructure/notifications/sqlmodel_notification_repository.py`
- [PostgreSQL](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/crud/database.py): `backend/crud/database.py`

### External services

- [Amadeus or mock flights](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/external_services/flight.py): `backend/external_services/flight.py`
- [Pesapal payments](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/external_services/pesapal.py): `backend/external_services/pesapal.py`
- [Google OAuth](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/infrastructure/oauth/google_oauth_provider.py): `backend/infrastructure/oauth/google_oauth_provider.py`
- [Cloudinary ticket storage](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/infrastructure/tickets/cloudinary_ticket_file_storage.py): `backend/infrastructure/tickets/cloudinary_ticket_file_storage.py`

### Async notifications

- [Redis cache and streams](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/utils/redis.py): `backend/utils/redis.py`
- [Kafka](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/utils/kafka.py): `backend/utils/kafka.py`
- [Notification worker](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/worker.py): `backend/worker.py`
- [Notification publisher](https://github.com/knehe/aero_bound_ventures-public/blob/main/backend/utils/notification_service.py): `backend/utils/notification_service.py`

### Other components

- **Traveler**
- **Administrator**

## Connections

- Traveler → Next.js application: uses (evidence: `README.md`)
- Administrator → Next.js application: uses (evidence: `README.md`)
- Next.js application → FastAPI entry: REST and SSE (evidence: `README.md`)
- FastAPI entry → Flight and booking routes: mounts routes (evidence: `backend/main.py`)
- FastAPI entry → Payment routes: mounts routes (evidence: `backend/main.py`)
- FastAPI entry → OAuth routes: mounts routes (evidence: `backend/main.py`)
- FastAPI entry → Ticket routes: mounts routes (evidence: `backend/main.py`)
- FastAPI entry → Notification routes: mounts routes (evidence: `backend/main.py`)
- FastAPI entry → Admin routes: mounts routes (evidence: `backend/main.py`)
- Flight and booking routes → Flight workflows: dispatches to (evidence: `backend/routers/flights.py`)
- Flight and booking routes → Booking workflows: dispatches to (evidence: `backend/routers/flights.py`)
- Flight and booking routes → Booking repository: configures repository (evidence: `backend/routers/flights.py`)
- Booking repository → PostgreSQL: queries (evidence: `backend/infrastructure/bookings/sqlmodel_booking_repository.py`)
- Booking workflows → Booking repository: uses repository (evidence: `backend/infrastructure/bookings/sqlmodel_booking_repository.py`)
- Flight workflows → Amadeus or mock flights: flight data (evidence: `README.md`)
- Payment routes → Payment workflows: dispatches to (evidence: `README.md`)
- Payment workflows → Pesapal payments: processes payments (evidence: `README.md`)
- OAuth routes → OAuth login workflow: dispatches to (evidence: `backend/routers/oauth.py`)
- OAuth login workflow → Google OAuth: fetches identity (evidence: `backend/routers/oauth.py`)
- OAuth login workflow → PostgreSQL: user records
- Ticket routes → Cloudinary ticket storage: stores uploads (evidence: `backend/infrastructure/tickets/cloudinary_ticket_file_storage.py`)
- Notification routes → Notification repository: notification records (evidence: `backend/infrastructure/notifications/sqlmodel_notification_repository.py`)
- Notification publisher → PostgreSQL: persists notification (evidence: `backend/utils/notification_service.py`)
- Notification publisher → Redis cache and streams: publishes updates (evidence: `backend/utils/notification_service.py`)
- FastAPI entry → Kafka: starts producer (evidence: `backend/main.py`)
- Kafka → Notification worker: delivers events (evidence: `README.md`)
- FastAPI entry → PostgreSQL: uses storage (evidence: `README.md`)
- FastAPI entry → Redis cache and streams: uses cache and Pub/Sub (evidence: `README.md`)
- FastAPI entry → Cloudinary ticket storage: ticket uploads (evidence: `README.md`)
