# lonelydreamer005/eventflow architecture

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

- Interactive diagram: https://gitdiagram.com/lonelydreamer005/eventflow
- Repository: https://github.com/lonelydreamer005/eventflow

## Overview

EventFlow is a full-stack event ticket reservation platform. Customers browse events, authenticate, choose ticket tiers, and submit bookings; admins manage events, tickets, users, and bookings. The documented booking service locks ticket inventory within a transaction before creating booking records, preventing overselling. The graph combines documented capabilities with relationships visible in the excerpts and source index; unsampled route-to-service and page-to-service wiring is not asserted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/App.jsx) (Application Router), [`backend/app/services/booking_service.py`](https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/services/booking_service.py) (Transactional Booking Service), [`backend/app/api`](https://github.com/lonelydreamer005/eventflow/tree/main/backend/app/api) (REST API), [`frontend/src/context/AuthContext.jsx`](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/context/AuthContext.jsx) (Authentication State)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web Client"]
  node_app["Application Router<br/>[App.jsx]"]
  node_authctx["Authentication State<br/>[AuthContext.jsx]"]
  node_authservice["Authentication Client<br/>[auth.js]"]
  node_apiservice["HTTP Client<br/>[api.js]"]
  node_landing["Landing Page<br/>[Landing.jsx]"]
  node_events["Event Browsing<br/>[Events.jsx]"]
  node_eventdetail["Event Details<br/>[EventDetail.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_register["Registration<br/>[Register.jsx]"]
  node_bookinghistory["Booking History<br/>[BookingHistory.jsx]"]
  node_bookingdetail["Booking Details<br/>[BookingDetail.jsx]"]
  node_admindashboard["Admin Dashboard<br/>[AdminDashboard.jsx]"]
  node_adminevents["Event Management<br/>[AdminEvents.jsx]"]
  node_eventform["Event Editor<br/>[EventForm.jsx]"]
  node_ticketmanager["Ticket Management<br/>[TicketManager.jsx]"]
  node_adminbookings["Booking Administration<br/>[AdminBookings.jsx]"]
  node_adminusers["User Directory<br/>[AdminUsers.jsx]"]
end

subgraph group_api["Backend API"]
  node_backendapi["REST API"]
  node_authapi["Auth Routes<br/>[auth.py]"]
  node_eventapi["Event Routes<br/>[events.py]"]
  node_bookingapi["Booking Routes<br/>[bookings.py]"]
  node_ticketapi["Ticket Routes<br/>[ticket_types.py]"]
  node_adminapi["Admin Routes<br/>[admin.py]"]
end

subgraph group_booking["Booking Domain"]
  node_bookingservice["Transactional Booking Service<br/>[booking_service.py]"]
  node_bookingmodel["Booking Records<br/>[booking.py]"]
  node_itemmodel["Booking Items<br/>[booking_item.py]"]
  node_eventmodel["Events<br/>[event.py]"]
  node_ticketmodel["Ticket Inventory<br/>[ticket_type.py]"]
  node_database[("PostgreSQL")]
end

subgraph group_platform["Platform Observability"]
  node_metrics["Booking Metrics<br/>[metrics.py]"]
  node_prometheus["Prometheus"]
end

node_customer(("Customer"))
node_admin(("Administrator"))

node_customer -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_app -->|"provides auth"| node_authctx
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_events
node_app -->|"routes to"| node_eventdetail
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_bookinghistory
node_app -->|"routes to"| node_bookingdetail
node_app -->|"routes to"| node_admindashboard
node_app -->|"routes to"| node_adminevents
node_app -->|"routes to"| node_eventform
node_app -->|"routes to"| node_ticketmanager
node_app -->|"routes to"| node_adminbookings
node_app -->|"routes to"| node_adminusers
node_authctx -->|"calls"| node_authservice
node_authservice -->|"sends requests"| node_apiservice
node_apiservice -.->|"calls"| node_backendapi
node_backendapi -.->|"dispatches auth"| node_authapi
node_backendapi -.->|"dispatches events"| node_eventapi
node_backendapi -.->|"dispatches bookings"| node_bookingapi
node_backendapi -.->|"dispatches tickets"| node_ticketapi
node_backendapi -.->|"dispatches admin"| node_adminapi
node_customer -->|"submits bookings"| node_backendapi
node_bookingapi -.->|"invokes"| node_bookingservice
node_bookingservice -->|"locks inventory"| node_ticketmodel
node_bookingservice -->|"checks event"| node_eventmodel
node_bookingservice -->|"creates booking"| node_bookingmodel
node_bookingservice -->|"creates items"| node_itemmodel
node_bookingservice -->|"commits transaction"| node_database
node_bookingservice -->|"increments counters"| node_metrics
node_prometheus -->|"scrapes metrics"| node_metrics

click node_app "https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/App.jsx"
click node_authctx "https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/context/AuthContext.jsx"
click node_authservice "https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/services/auth.js"
click node_apiservice "https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/services/api.js"
click node_landing "https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/Landing.jsx"
click node_events "https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/Events.jsx"
click node_eventdetail "https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/EventDetail.jsx"
click node_login "https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/Login.jsx"
click node_register "https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/Register.jsx"
click node_bookinghistory "https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/BookingHistory.jsx"
click node_bookingdetail "https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/BookingDetail.jsx"
click node_admindashboard "https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/AdminDashboard.jsx"
click node_adminevents "https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/AdminEvents.jsx"
click node_eventform "https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/EventForm.jsx"
click node_ticketmanager "https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/TicketManager.jsx"
click node_adminbookings "https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/AdminBookings.jsx"
click node_adminusers "https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/AdminUsers.jsx"
click node_backendapi "https://github.com/lonelydreamer005/eventflow/tree/main/backend/app/api"
click node_authapi "https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/api/auth.py"
click node_eventapi "https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/api/events.py"
click node_bookingapi "https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/api/bookings.py"
click node_ticketapi "https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/api/ticket_types.py"
click node_adminapi "https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/api/admin.py"
click node_bookingservice "https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/services/booking_service.py"
click node_bookingmodel "https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/models/booking.py"
click node_itemmodel "https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/models/booking_item.py"
click node_eventmodel "https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/models/event.py"
click node_ticketmodel "https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/models/ticket_type.py"
click node_metrics "https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/metrics.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_app,node_authctx,node_authservice,node_apiservice,node_landing,node_events,node_eventdetail,node_login,node_register,node_bookinghistory,node_bookingdetail,node_admindashboard,node_adminevents,node_eventform,node_ticketmanager,node_adminbookings,node_adminusers toneBlue
class node_backendapi,node_authapi,node_eventapi,node_bookingapi,node_ticketapi,node_adminapi toneAmber
class node_bookingservice,node_bookingmodel,node_itemmodel,node_eventmodel,node_ticketmodel,node_database toneMint
class node_metrics,node_prometheus toneRose
class node_customer,node_admin toneIndigo
```

## Components

### Web Client

- [Application Router](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Authentication State](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Authentication Client](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/services/auth.js): `frontend/src/services/auth.js`
- [HTTP Client](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Landing Page](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/Landing.jsx): `frontend/src/pages/Landing.jsx`
- [Event Browsing](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/Events.jsx): `frontend/src/pages/Events.jsx`
- [Event Details](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/EventDetail.jsx): `frontend/src/pages/EventDetail.jsx`
- [Login](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Registration](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/Register.jsx): `frontend/src/pages/Register.jsx`
- [Booking History](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/BookingHistory.jsx): `frontend/src/pages/BookingHistory.jsx`
- [Booking Details](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/BookingDetail.jsx): `frontend/src/pages/BookingDetail.jsx`
- [Admin Dashboard](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/AdminDashboard.jsx): `frontend/src/pages/AdminDashboard.jsx`
- [Event Management](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/AdminEvents.jsx): `frontend/src/pages/AdminEvents.jsx`
- [Event Editor](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/EventForm.jsx): `frontend/src/pages/EventForm.jsx`
- [Ticket Management](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/TicketManager.jsx): `frontend/src/pages/TicketManager.jsx`
- [Booking Administration](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/AdminBookings.jsx): `frontend/src/pages/AdminBookings.jsx`
- [User Directory](https://github.com/lonelydreamer005/eventflow/blob/main/frontend/src/pages/AdminUsers.jsx): `frontend/src/pages/AdminUsers.jsx`

### Backend API

- [REST API](https://github.com/lonelydreamer005/eventflow/tree/main/backend/app/api): `backend/app/api`
- [Auth Routes](https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/api/auth.py): `backend/app/api/auth.py`
- [Event Routes](https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/api/events.py): `backend/app/api/events.py`
- [Booking Routes](https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/api/bookings.py): `backend/app/api/bookings.py`
- [Ticket Routes](https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/api/ticket_types.py): `backend/app/api/ticket_types.py`
- [Admin Routes](https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/api/admin.py): `backend/app/api/admin.py`

### Booking Domain

- [Transactional Booking Service](https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/services/booking_service.py): `backend/app/services/booking_service.py`
- [Booking Records](https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/models/booking.py): `backend/app/models/booking.py`
- [Booking Items](https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/models/booking_item.py): `backend/app/models/booking_item.py`
- [Events](https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/models/event.py): `backend/app/models/event.py`
- [Ticket Inventory](https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/models/ticket_type.py): `backend/app/models/ticket_type.py`
- **PostgreSQL**

### Platform Observability

- [Booking Metrics](https://github.com/lonelydreamer005/eventflow/blob/main/backend/app/metrics.py): `backend/app/metrics.py`
- **Prometheus**

### Other components

- **Customer**
- **Administrator**

## Connections

- Customer → Application Router: uses (evidence: `README.md`)
- Administrator → Application Router: uses (evidence: `README.md`)
- Application Router → Authentication State: provides auth (evidence: `frontend/src/App.jsx`)
- Application Router → Landing Page: routes to (evidence: `frontend/src/App.jsx`)
- Application Router → Event Browsing: routes to (evidence: `frontend/src/App.jsx`)
- Application Router → Event Details: routes to (evidence: `frontend/src/App.jsx`)
- Application Router → Login: routes to (evidence: `frontend/src/App.jsx`)
- Application Router → Registration: routes to (evidence: `frontend/src/App.jsx`)
- Application Router → Booking History: routes to (evidence: `frontend/src/App.jsx`)
- Application Router → Booking Details: routes to (evidence: `frontend/src/App.jsx`)
- Application Router → Admin Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Application Router → Event Management: routes to (evidence: `frontend/src/App.jsx`)
- Application Router → Event Editor: routes to (evidence: `frontend/src/App.jsx`)
- Application Router → Ticket Management: routes to (evidence: `frontend/src/App.jsx`)
- Application Router → Booking Administration: routes to (evidence: `frontend/src/App.jsx`)
- Application Router → User Directory: routes to (evidence: `frontend/src/App.jsx`)
- Authentication State → Authentication Client: calls (evidence: `frontend/src/context/AuthContext.jsx`)
- Authentication Client → HTTP Client: sends requests (evidence: `frontend/src/services/auth.js`)
- HTTP Client → REST API: calls
- REST API → Auth Routes: dispatches auth
- REST API → Event Routes: dispatches events
- REST API → Booking Routes: dispatches bookings
- REST API → Ticket Routes: dispatches tickets
- REST API → Admin Routes: dispatches admin
- Customer → REST API: submits bookings (evidence: `README.md`)
- Booking Routes → Transactional Booking Service: invokes
- Transactional Booking Service → Ticket Inventory: locks inventory (evidence: `backend/app/services/booking_service.py`)
- Transactional Booking Service → Events: checks event (evidence: `backend/app/services/booking_service.py`)
- Transactional Booking Service → Booking Records: creates booking (evidence: `backend/app/services/booking_service.py`)
- Transactional Booking Service → Booking Items: creates items (evidence: `backend/app/services/booking_service.py`)
- Transactional Booking Service → PostgreSQL: commits transaction (evidence: `README.md`)
- Transactional Booking Service → Booking Metrics: increments counters (evidence: `backend/app/services/booking_service.py`)
- Prometheus → Booking Metrics: scrapes metrics (evidence: `README.md`)
