# sinchanacsajjanashettar/event_ticket_booking_system architecture

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

- Interactive diagram: https://gitdiagram.com/sinchanacsajjanashettar/event_ticket_booking_system
- Repository: https://github.com/sinchanacsajjanashettar/event_ticket_booking_system

## Overview

This is a Flask/MySQL event-ticket booking application. A customer uses the web UI to access Flask routes for registration, login, event discovery, booking, cancellation, and reports; the routes query or update the EventTicketBooking database. Booking is handled through the BookTicket procedure, with triggers maintaining seat inventory and related state. The README documents database capabilities not visible in the sampled source; those relationships are shown as documented rather than inferred from unsampled SQL.

Main entry points: [`app.py`](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py) (Flask application), [`Event_Ticket_Booking.sql`](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/Event_Ticket_Booking.sql) (Tickets and payments), [`templates/index.html`](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/templates/index.html) (Web UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_web_ui["Web UI<br/>[index.html]"]
end

subgraph group_api["Flask API"]
  node_flask_app["Flask application<br/>[app.py]"]
  node_customer_accounts["Customer accounts<br/>[app.py]"]
  node_event_discovery["Event discovery<br/>[app.py]"]
  node_event_categories["Ticket categories<br/>[app.py]"]
  node_ticket_booking["Ticket booking<br/>[app.py]"]
  node_booking_history["Booking history<br/>[app.py]"]
  node_ticket_cancellation["Ticket cancellation<br/>[app.py]"]
end

subgraph group_booking["Booking database"]
  node_event_schema[("Events and venues")]
  node_booking_records[("Tickets and payments")]
  node_booking_procedure["BookTicket procedure"]
  node_integrity_triggers["Validation and inventory triggers"]
end

subgraph group_insights["Customer and reports"]
  node_customer_age["Customer age report<br/>[app.py]"]
  node_revenue_report["Event revenue report<br/>[app.py]"]
  node_top_customers["Top customer rankings<br/>[app.py]"]
end

node_customer(("Customer"))

node_customer -->|"uses"| node_web_ui
node_web_ui -->|"requests pages and APIs"| node_flask_app
node_flask_app -->|"renders"| node_web_ui
node_flask_app -->|"routes account requests"| node_customer_accounts
node_flask_app -->|"routes event requests"| node_event_discovery
node_flask_app -->|"routes category requests"| node_event_categories
node_flask_app -->|"routes booking requests"| node_ticket_booking
node_flask_app -->|"routes booking requests"| node_booking_history
node_flask_app -->|"routes cancellation requests"| node_ticket_cancellation
node_customer_accounts -->|"queries customer data"| node_booking_records
node_event_discovery -->|"queries events and venues"| node_event_schema
node_event_categories -->|"reads category inventory"| node_event_schema
node_ticket_booking -->|"calls"| node_booking_procedure
node_booking_procedure -->|"creates booking records"| node_booking_records
node_booking_procedure -->|"activates"| node_integrity_triggers
node_integrity_triggers -->|"updates inventory and booking state"| node_booking_records
node_booking_history -->|"queries customer tickets"| node_booking_records
node_ticket_cancellation -->|"checks and updates ticket"| node_booking_records
node_ticket_cancellation -->|"activates cancellation trigger"| node_integrity_triggers
node_customer_accounts -.->|"provides customer identity"| node_customer_age
node_customer_age -->|"queries customer data"| node_booking_records
node_flask_app -->|"routes report requests"| node_revenue_report
node_revenue_report -->|"queries ticket sales"| node_booking_records
node_flask_app -->|"routes report requests"| node_top_customers
node_top_customers -->|"ranks customer spending"| node_booking_records

click node_web_ui "https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/templates/index.html"
click node_flask_app "https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py"
click node_customer_accounts "https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py"
click node_event_discovery "https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py"
click node_event_categories "https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py"
click node_ticket_booking "https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py"
click node_booking_history "https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py"
click node_ticket_cancellation "https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py"
click node_event_schema "https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/Event_Ticket_Booking.sql"
click node_booking_records "https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/Event_Ticket_Booking.sql"
click node_booking_procedure "https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/Event_Ticket_Booking.sql"
click node_integrity_triggers "https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/Event_Ticket_Booking.sql"
click node_customer_age "https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py"
click node_revenue_report "https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py"
click node_top_customers "https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.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_web_ui toneBlue
class node_flask_app,node_customer_accounts,node_event_discovery,node_event_categories,node_ticket_booking,node_booking_history,node_ticket_cancellation toneAmber
class node_event_schema,node_booking_records,node_booking_procedure,node_integrity_triggers toneMint
class node_customer_age,node_revenue_report,node_top_customers toneRose
class node_customer toneIndigo
```

## Components

### Web experience

- [Web UI](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/templates/index.html): `templates/index.html`

### Flask API

- [Flask application](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py): `app.py`
- [Customer accounts](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py): `app.py`
- [Event discovery](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py): `app.py`
- [Ticket categories](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py): `app.py`
- [Ticket booking](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py): `app.py`
- [Booking history](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py): `app.py`
- [Ticket cancellation](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py): `app.py`

### Booking database

- [Events and venues](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/Event_Ticket_Booking.sql): `Event_Ticket_Booking.sql`
- [Tickets and payments](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/Event_Ticket_Booking.sql): `Event_Ticket_Booking.sql`
- [BookTicket procedure](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/Event_Ticket_Booking.sql): `Event_Ticket_Booking.sql`
- [Validation and inventory triggers](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/Event_Ticket_Booking.sql): `Event_Ticket_Booking.sql`

### Customer and reports

- [Customer age report](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py): `app.py`
- [Event revenue report](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py): `app.py`
- [Top customer rankings](https://github.com/sinchanacsajjanashettar/event_ticket_booking_system/blob/main/app.py): `app.py`

### Other components

- **Customer**

## Connections

- Customer → Web UI: uses (evidence: `README.md`)
- Web UI → Flask application: requests pages and APIs (evidence: `README.md`)
- Flask application → Web UI: renders (evidence: `app.py`)
- Flask application → Customer accounts: routes account requests (evidence: `app.py`)
- Flask application → Event discovery: routes event requests (evidence: `app.py`)
- Flask application → Ticket categories: routes category requests (evidence: `app.py`)
- Flask application → Ticket booking: routes booking requests (evidence: `app.py`)
- Flask application → Booking history: routes booking requests (evidence: `app.py`)
- Flask application → Ticket cancellation: routes cancellation requests (evidence: `app.py`)
- Customer accounts → Tickets and payments: queries customer data (evidence: `app.py`)
- Event discovery → Events and venues: queries events and venues (evidence: `app.py`)
- Ticket categories → Events and venues: reads category inventory (evidence: `app.py`)
- Ticket booking → BookTicket procedure: calls (evidence: `app.py`)
- BookTicket procedure → Tickets and payments: creates booking records (evidence: `README.md`)
- BookTicket procedure → Validation and inventory triggers: activates
- Validation and inventory triggers → Tickets and payments: updates inventory and booking state (evidence: `README.md`)
- Booking history → Tickets and payments: queries customer tickets (evidence: `app.py`)
- Ticket cancellation → Tickets and payments: checks and updates ticket (evidence: `app.py`)
- Ticket cancellation → Validation and inventory triggers: activates cancellation trigger (evidence: `app.py`)
- Customer accounts → Customer age report: provides customer identity (evidence: `app.py`)
- Customer age report → Tickets and payments: queries customer data (evidence: `app.py`)
- Flask application → Event revenue report: routes report requests (evidence: `app.py`)
- Event revenue report → Tickets and payments: queries ticket sales (evidence: `app.py`)
- Flask application → Top customer rankings: routes report requests (evidence: `app.py`)
- Top customer rankings → Tickets and payments: ranks customer spending (evidence: `README.md`)
