# vageeshwaran07/movie-ticket-booking-system architecture

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

- Interactive diagram: https://gitdiagram.com/vageeshwaran07/movie-ticket-booking-system
- Repository: https://github.com/vageeshwaran07/movie-ticket-booking-system

## Overview

This repository combines a Django movie-ticketing application with a FastAPI service for seat locking and payment-related operations, plus a browser frontend. The intended product journey is to discover movies and shows, select seats, lock them, and confirm a booking after payment. The graph includes the sampled domain models and explicitly evidenced calls. The README is empty; frontend behavior and several Django routing details were not sampled, so those connections are omitted rather than inferred.

Main entry points: [`fastapi_service/routers/payments.py`](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/routers/payments.py) (Payment operations), [`fastapi_service/routers/seats.py`](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/routers/seats.py) (Seat locking), [`fastapi_service/db/mongo.py`](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/db/mongo.py) (MongoDB seats), [`fastapi_service/main.py`](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/main.py) (FastAPI application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_django["Django ticketing"]
  node_django_api["Catalog API<br/>[views.py]"]
  node_api_serializers["API serializers<br/>[serializers.py]"]
  node_movie[("Movies<br/>[models.py]")]
  node_theatre[("Theatres and screens<br/>[models.py]")]
  node_show[("Show scheduling<br/>[models.py]")]
  node_booking[("Booking records<br/>[models.py]")]
  node_booking_views["Booking handlers<br/>[views.py]"]
end

subgraph group_fastapi["Seat and payment API"]
  node_fastapi_app["FastAPI application<br/>[main.py]"]
  node_auth_token["JWT verification<br/>[auth.py]"]
  node_seat_routes["Seat locking<br/>[seats.py]"]
  node_payment_routes["Payment operations<br/>[payments.py]"]
  node_booking_service["Booking confirmation"]
  node_seat_model["Seat state<br/>[seat_model.py]"]
  node_mongo[("MongoDB seats<br/>[mongo.py]")]
end

subgraph group_identity["Identity"]
  node_user_model[("User accounts<br/>[models.py]")]
  node_user_manager["User manager<br/>[managers.py]"]
  node_auth_backend["Authentication backend<br/>[backends.py]"]
end

subgraph group_client["Client"]
  node_webapp["Browser frontend<br/>[app.js]"]
end

node_customer(("Customer"))
node_razorpay["Razorpay"]

node_customer -.->|"uses"| node_webapp
node_customer -.->|"requests catalog"| node_django_api
node_customer -.->|"locks seats"| node_seat_routes
node_customer -.->|"pays"| node_payment_routes
node_django_api -->|"serializes"| node_api_serializers
node_booking_views -->|"uses"| node_booking
node_booking -->|"references"| node_user_model
node_booking -->|"references"| node_show
node_show -->|"references"| node_movie
node_show -->|"references"| node_theatre
node_user_model -->|"delegates creation"| node_user_manager
node_fastapi_app -->|"registers"| node_seat_routes
node_fastapi_app -->|"registers"| node_payment_routes
node_fastapi_app -->|"creates TTL index"| node_mongo
node_seat_routes -->|"verifies token"| node_auth_token
node_payment_routes -->|"verifies token"| node_auth_token
node_seat_routes -->|"updates seats"| node_mongo
node_seat_routes -->|"checks status"| node_seat_model
node_payment_routes -->|"reads seat locks"| node_mongo
node_payment_routes -->|"checks status"| node_seat_model
node_payment_routes -->|"confirms booking"| node_booking_service
node_booking_service -->|"updates seats"| node_mongo
node_booking_service -->|"checks status"| node_seat_model
node_payment_routes -->|"creates orders"| node_razorpay

click node_webapp "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/frontend/app.js"
click node_django_api "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/api/views.py"
click node_api_serializers "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/api/serializers.py"
click node_movie "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/movies/models.py"
click node_theatre "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/theatres/models.py"
click node_show "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/shows/models.py"
click node_booking "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/bookings/models.py"
click node_booking_views "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/bookings/views.py"
click node_user_model "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/users/models.py"
click node_user_manager "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/users/managers.py"
click node_auth_backend "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/users/backends.py"
click node_fastapi_app "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/main.py"
click node_auth_token "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/auth.py"
click node_seat_routes "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/routers/seats.py"
click node_payment_routes "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/routers/payments.py"
click node_booking_service "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/services/booking_services.py"
click node_seat_model "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/db/seat_model.py"
click node_mongo "https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/db/mongo.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_django_api,node_api_serializers,node_movie,node_theatre,node_show,node_booking,node_booking_views toneBlue
class node_fastapi_app,node_auth_token,node_seat_routes,node_payment_routes,node_booking_service,node_seat_model,node_mongo toneAmber
class node_user_model,node_user_manager,node_auth_backend toneMint
class node_webapp toneRose
class node_customer,node_razorpay toneIndigo
```

## Components

### Django ticketing

- [Catalog API](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/api/views.py): `movieticket/api/views.py`
- [API serializers](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/api/serializers.py): `movieticket/api/serializers.py`
- [Movies](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/movies/models.py): `movieticket/movies/models.py`
- [Theatres and screens](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/theatres/models.py): `movieticket/theatres/models.py`
- [Show scheduling](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/shows/models.py): `movieticket/shows/models.py`
- [Booking records](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/bookings/models.py): `movieticket/bookings/models.py`
- [Booking handlers](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/bookings/views.py): `movieticket/bookings/views.py`

### Seat and payment API

- [FastAPI application](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/main.py): `fastapi_service/main.py`
- [JWT verification](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/auth.py): `fastapi_service/auth.py`
- [Seat locking](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/routers/seats.py): `fastapi_service/routers/seats.py`
- [Payment operations](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/routers/payments.py): `fastapi_service/routers/payments.py`
- [Booking confirmation](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/services/booking_services.py): `fastapi_service/services/booking_services.py`
- [Seat state](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/db/seat_model.py): `fastapi_service/db/seat_model.py`
- [MongoDB seats](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/fastapi_service/db/mongo.py): `fastapi_service/db/mongo.py`

### Identity

- [User accounts](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/users/models.py): `movieticket/users/models.py`
- [User manager](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/users/managers.py): `movieticket/users/managers.py`
- [Authentication backend](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/movieticket/users/backends.py): `movieticket/users/backends.py`

### Client

- [Browser frontend](https://github.com/vageeshwaran07/movie-ticket-booking-system/blob/main/frontend/app.js): `frontend/app.js`

### Other components

- **Customer**
- **Razorpay**

## Connections

- Customer → Browser frontend: uses
- Customer → Catalog API: requests catalog
- Customer → Seat locking: locks seats
- Customer → Payment operations: pays
- Catalog API → API serializers: serializes (evidence: `movieticket/api/views.py`)
- Booking handlers → Booking records: uses (evidence: `movieticket/bookings/views.py`)
- Booking records → User accounts: references (evidence: `movieticket/bookings/models.py`)
- Booking records → Show scheduling: references (evidence: `movieticket/bookings/models.py`)
- Show scheduling → Movies: references (evidence: `movieticket/shows/models.py`)
- Show scheduling → Theatres and screens: references (evidence: `movieticket/shows/models.py`)
- User accounts → User manager: delegates creation (evidence: `movieticket/users/models.py`)
- FastAPI application → Seat locking: registers (evidence: `fastapi_service/main.py`)
- FastAPI application → Payment operations: registers (evidence: `fastapi_service/main.py`)
- FastAPI application → MongoDB seats: creates TTL index (evidence: `fastapi_service/main.py`)
- Seat locking → JWT verification: verifies token (evidence: `fastapi_service/routers/seats.py`)
- Payment operations → JWT verification: verifies token (evidence: `fastapi_service/routers/payments.py`)
- Seat locking → MongoDB seats: updates seats (evidence: `fastapi_service/routers/seats.py`)
- Seat locking → Seat state: checks status (evidence: `fastapi_service/routers/seats.py`)
- Payment operations → MongoDB seats: reads seat locks (evidence: `fastapi_service/routers/payments.py`)
- Payment operations → Seat state: checks status (evidence: `fastapi_service/routers/payments.py`)
- Payment operations → Booking confirmation: confirms booking (evidence: `fastapi_service/routers/payments.py`)
- Booking confirmation → MongoDB seats: updates seats (evidence: `fastapi_service/services/booking_services.py`)
- Booking confirmation → Seat state: checks status (evidence: `fastapi_service/services/booking_services.py`)
- Payment operations → Razorpay: creates orders (evidence: `fastapi_service/routers/payments.py`)
