# aizen2510/sd_cuoiki architecture

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

- Interactive diagram: https://gitdiagram.com/aizen2510/sd_cuoiki
- Repository: https://github.com/aizen2510/sd_cuoiki

## Overview

MeoCinema is a cinema discovery and ticket-booking web application with a React/TypeScript frontend and FastAPI backend. The user journey runs from choosing a city, movie, theater, and showtime through seat/combo selection and checkout, ending in an electronic ticket that can be looked up later. The frontend also presents promotions, FAQs, movie details, search, and theme controls. Backend APIs serve catalog and schedule data and handle bookings, while a hybrid PostgreSQL/in-memory repository supports persistence and fallback. Some links reflect README documentation because the relevant implementation excerpts are partial.

Main entry points: [`FE/src/App.tsx`](https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/App.tsx) (Web application), [`BE/app/main.py`](https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/main.py) (FastAPI application), [`BE/app/database.py`](https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/database.py) (Hybrid repository), [`FE/src/services/api.ts`](https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/services/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Cinema frontend"]
  node_app["Web application<br/>[App.tsx]"]
  node_header["Navigation<br/>[Header.tsx]"]
  node_hero["Cinema introduction<br/>[HeroSection.tsx]"]
end

subgraph group_catalog["Discovery and catalog"]
  node_schedule["Showtime finder<br/>[ScheduleHub.tsx]"]
  node_location["Location selector<br/>[LocationModal.tsx]"]
  node_search["Catalog search<br/>[SearchModal.tsx]"]
  node_movie_detail["Movie details"]
  node_upcoming["Upcoming movies"]
  node_promotions["Promotions"]
  node_faq["Help and FAQs<br/>[FaqSection.tsx]"]
  node_cinema_data["Local cinema catalog<br/>[cinemaData.ts]"]
end

subgraph group_booking["Booking and tickets"]
  node_seat_booking["Seat checkout"]
  node_ticket_lookup["Ticket lookup<br/>[MyTicketsModal.tsx]"]
  node_booking_api["Booking API<br/>[bookings.py]"]
end

subgraph group_backend["API and persistence"]
  node_api_client["API client<br/>[api.ts]"]
  node_api_server["FastAPI application<br/>[main.py]"]
  node_movie_api["Movie API<br/>[movies.py]"]
  node_theater_api["Location API<br/>[theaters.py]"]
  node_showtime_api["Showtime and seats API<br/>[showtimes.py]"]
  node_combo_api["Combo API<br/>[combos.py]"]
  node_promotion_api["Voucher API<br/>[promotions.py]"]
  node_models["API data models<br/>[models.py]"]
  node_repository["Hybrid repository<br/>[database.py]"]
  node_postgres[("PostgreSQL")]
end

node_customer(("Moviegoer"))

node_customer -->|"uses"| node_app
node_app -->|"renders"| node_header
node_app -->|"renders"| node_hero
node_app -->|"renders"| node_schedule
node_app -->|"opens checkout"| node_seat_booking
node_app -->|"opens details"| node_movie_detail
node_app -->|"renders"| node_upcoming
node_app -->|"renders"| node_promotions
node_app -->|"renders"| node_faq
node_app -->|"opens selector"| node_location
node_header -.->|"opens search"| node_search
node_schedule -->|"uses catalog"| node_cinema_data
node_search -.->|"searches catalog"| node_cinema_data
node_seat_booking -->|"generates seats"| node_cinema_data
node_seat_booking -->|"submits booking"| node_api_client
node_ticket_lookup -->|"requests ticket"| node_api_client
node_app -->|"loads catalog"| node_api_client
node_api_client -->|"calls REST API"| node_api_server
node_api_server -->|"registers router"| node_movie_api
node_api_server -->|"registers router"| node_theater_api
node_api_server -->|"registers router"| node_showtime_api
node_api_server -->|"registers router"| node_combo_api
node_api_server -->|"registers router"| node_promotion_api
node_api_server -->|"registers router"| node_booking_api
node_movie_api -->|"reads catalog"| node_repository
node_theater_api -->|"reads locations"| node_repository
node_showtime_api -->|"reads availability"| node_repository
node_combo_api -->|"reads combos"| node_repository
node_promotion_api -->|"reads promotions"| node_repository
node_booking_api -->|"stores bookings"| node_repository
node_movie_api -->|"validates responses"| node_models
node_theater_api -->|"validates responses"| node_models
node_showtime_api -->|"validates responses"| node_models
node_booking_api -->|"validates tickets"| node_models
node_repository -->|"reads and writes"| node_postgres

click node_app "https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/App.tsx"
click node_header "https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/Header.tsx"
click node_hero "https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/HeroSection.tsx"
click node_schedule "https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/ScheduleHub.tsx"
click node_location "https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/LocationModal.tsx"
click node_search "https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/SearchModal.tsx"
click node_movie_detail "https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/MovieDetailModal.tsx"
click node_upcoming "https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/UpcomingSection.tsx"
click node_promotions "https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/PromotionSection.tsx"
click node_faq "https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/FaqSection.tsx"
click node_cinema_data "https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/data/cinemaData.ts"
click node_seat_booking "https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/SeatBookingModal.tsx"
click node_ticket_lookup "https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/MyTicketsModal.tsx"
click node_api_client "https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/services/api.ts"
click node_api_server "https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/main.py"
click node_movie_api "https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/routers/movies.py"
click node_theater_api "https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/routers/theaters.py"
click node_showtime_api "https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/routers/showtimes.py"
click node_combo_api "https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/routers/combos.py"
click node_promotion_api "https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/routers/promotions.py"
click node_booking_api "https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/routers/bookings.py"
click node_models "https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/models.py"
click node_repository "https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/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_app,node_header,node_hero toneBlue
class node_schedule,node_location,node_search,node_movie_detail,node_upcoming,node_promotions,node_faq,node_cinema_data toneAmber
class node_seat_booking,node_ticket_lookup,node_booking_api toneMint
class node_api_client,node_api_server,node_movie_api,node_theater_api,node_showtime_api,node_combo_api,node_promotion_api,node_models,node_repository,node_postgres toneRose
class node_customer toneIndigo
```

## Components

### Cinema frontend

- [Web application](https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/App.tsx): `FE/src/App.tsx`
- [Navigation](https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/Header.tsx): `FE/src/components/Header.tsx`
- [Cinema introduction](https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/HeroSection.tsx): `FE/src/components/HeroSection.tsx`

### Discovery and catalog

- [Showtime finder](https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/ScheduleHub.tsx): `FE/src/components/ScheduleHub.tsx`
- [Location selector](https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/LocationModal.tsx): `FE/src/components/LocationModal.tsx`
- [Catalog search](https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/SearchModal.tsx): `FE/src/components/SearchModal.tsx`
- [Movie details](https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/MovieDetailModal.tsx): `FE/src/components/MovieDetailModal.tsx`
- [Upcoming movies](https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/UpcomingSection.tsx): `FE/src/components/UpcomingSection.tsx`
- [Promotions](https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/PromotionSection.tsx): `FE/src/components/PromotionSection.tsx`
- [Help and FAQs](https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/FaqSection.tsx): `FE/src/components/FaqSection.tsx`
- [Local cinema catalog](https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/data/cinemaData.ts): `FE/src/data/cinemaData.ts`

### Booking and tickets

- [Seat checkout](https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/SeatBookingModal.tsx): `FE/src/components/SeatBookingModal.tsx`
- [Ticket lookup](https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/components/MyTicketsModal.tsx): `FE/src/components/MyTicketsModal.tsx`
- [Booking API](https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/routers/bookings.py): `BE/app/routers/bookings.py`

### API and persistence

- [API client](https://github.com/aizen2510/sd_cuoiki/blob/main/FE/src/services/api.ts): `FE/src/services/api.ts`
- [FastAPI application](https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/main.py): `BE/app/main.py`
- [Movie API](https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/routers/movies.py): `BE/app/routers/movies.py`
- [Location API](https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/routers/theaters.py): `BE/app/routers/theaters.py`
- [Showtime and seats API](https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/routers/showtimes.py): `BE/app/routers/showtimes.py`
- [Combo API](https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/routers/combos.py): `BE/app/routers/combos.py`
- [Voucher API](https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/routers/promotions.py): `BE/app/routers/promotions.py`
- [API data models](https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/models.py): `BE/app/models.py`
- [Hybrid repository](https://github.com/aizen2510/sd_cuoiki/blob/main/BE/app/database.py): `BE/app/database.py`
- **PostgreSQL**

### Other components

- **Moviegoer**

## Connections

- Moviegoer → Web application: uses (evidence: `README.md`)
- Web application → Navigation: renders (evidence: `FE/src/App.tsx`)
- Web application → Cinema introduction: renders (evidence: `FE/src/App.tsx`)
- Web application → Showtime finder: renders (evidence: `FE/src/App.tsx`)
- Web application → Seat checkout: opens checkout (evidence: `FE/src/App.tsx`)
- Web application → Movie details: opens details (evidence: `FE/src/App.tsx`)
- Web application → Upcoming movies: renders (evidence: `FE/src/App.tsx`)
- Web application → Promotions: renders (evidence: `FE/src/App.tsx`)
- Web application → Help and FAQs: renders (evidence: `FE/src/App.tsx`)
- Web application → Location selector: opens selector (evidence: `FE/src/App.tsx`)
- Navigation → Catalog search: opens search
- Showtime finder → Local cinema catalog: uses catalog (evidence: `FE/src/components/ScheduleHub.tsx`)
- Catalog search → Local cinema catalog: searches catalog
- Seat checkout → Local cinema catalog: generates seats (evidence: `FE/src/components/SeatBookingModal.tsx`)
- Seat checkout → API client: submits booking (evidence: `FE/src/services/api.ts`)
- Ticket lookup → API client: requests ticket (evidence: `FE/src/components/MyTicketsModal.tsx`)
- Web application → API client: loads catalog (evidence: `FE/src/App.tsx`)
- API client → FastAPI application: calls REST API (evidence: `README.md`)
- FastAPI application → Movie API: registers router (evidence: `BE/app/main.py`)
- FastAPI application → Location API: registers router (evidence: `BE/app/main.py`)
- FastAPI application → Showtime and seats API: registers router (evidence: `BE/app/main.py`)
- FastAPI application → Combo API: registers router (evidence: `BE/app/main.py`)
- FastAPI application → Voucher API: registers router (evidence: `BE/app/main.py`)
- FastAPI application → Booking API: registers router (evidence: `BE/app/main.py`)
- Movie API → Hybrid repository: reads catalog (evidence: `BE/app/routers/movies.py`)
- Location API → Hybrid repository: reads locations (evidence: `BE/app/routers/theaters.py`)
- Showtime and seats API → Hybrid repository: reads availability (evidence: `BE/app/routers/showtimes.py`)
- Combo API → Hybrid repository: reads combos (evidence: `BE/app/routers/combos.py`)
- Voucher API → Hybrid repository: reads promotions (evidence: `BE/app/routers/promotions.py`)
- Booking API → Hybrid repository: stores bookings (evidence: `BE/app/routers/bookings.py`)
- Movie API → API data models: validates responses (evidence: `BE/app/routers/movies.py`)
- Location API → API data models: validates responses (evidence: `BE/app/routers/theaters.py`)
- Showtime and seats API → API data models: validates responses (evidence: `BE/app/routers/showtimes.py`)
- Booking API → API data models: validates tickets (evidence: `BE/app/routers/bookings.py`)
- Hybrid repository → PostgreSQL: reads and writes (evidence: `README.md`)
