# antonbas/cinema architecture

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

- Interactive diagram: https://gitdiagram.com/antonbas/cinema
- Repository: https://github.com/antonbas/cinema

## Overview

Cinema Management System is a web app for discovering films and sessions, reserving seats, paying, and receiving usable tickets; staff manage content and validate tickets. The main visitor flow runs from the React app through the REST API to session discovery, seat reservation, booking, payment, and ticket delivery. Separate product branches cover refunds, accounts, bonuses, promotions, and staff administration/audit. The README documents the broad API integrations and background recovery behavior; sampled source additionally confirms schedule-query and OAuth user provisioning details. Other internal links are omitted where implementation excerpts were unavailable.

Main entry points: [`backend/src/main/java/ua/lviv/bas/cinema/CinemaApplication.java`](https://github.com/antonbas/cinema/blob/master/backend/src/main/java/ua/lviv/bas/cinema/CinemaApplication.java) (REST API), [`frontend/src/App.tsx`](https://github.com/antonbas/cinema/blob/master/frontend/src/App.tsx) (React app), [`backend/src/main/java/ua/lviv/bas/cinema/cinema/SessionScheduleQueryService.java`](https://github.com/antonbas/cinema/blob/master/backend/src/main/java/ua/lviv/bas/cinema/cinema/SessionScheduleQueryService.java) (Session schedule), [`backend/src/main/java/ua/lviv/bas/cinema/payment`](https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/payment) (Payment processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Films and scheduling"]
  node_catalog["Movie catalog"]
  node_schedule["Session schedule"]
  node_venues["Halls and seats"]
end

subgraph group_purchase["Booking and fulfilment"]
  node_reservation["Seat reservation"]
  node_booking["Booking"]
  node_payment["Payment processing"]
  node_tickets["Ticket issuance"]
  node_email["Email delivery<br/>[EmailService.java]"]
  node_refund["Refunds"]
end

subgraph group_accounts["Accounts and benefits"]
  node_auth["Authentication<br/>[AuthService.java]"]
  node_oauth["Google sign-in"]
  node_bonuses["Bonus points"]
  node_promotions["Promotions"]
end

subgraph group_operations["Staff and operations"]
  node_staffadmin["Staff administration"]
  node_audit["Change audit"]
end

node_visitor(("Visitor"))
node_staff(("Staff"))
node_web["React app<br/>[App.tsx]"]
node_api["REST API"]
node_liqpay{{"LiqPay"}}
node_database[("PostgreSQL")]
node_emailprovider{{"Email provider"}}

node_visitor -->|"uses"| node_web
node_staff -->|"uses"| node_web
node_web -->|"REST requests"| node_api
node_api -.->|"serves catalog"| node_catalog
node_api -.->|"queries schedule"| node_schedule
node_schedule -.->|"reads sessions"| node_database
node_api -.->|"manages halls"| node_venues
node_api -.->|"reserves seats"| node_reservation
node_api -.->|"creates booking"| node_booking
node_api -.->|"processes payment"| node_payment
node_payment -->|"exchanges payment"| node_liqpay
node_api -.->|"issues tickets"| node_tickets
node_api -.->|"sends tickets"| node_email
node_email -.->|"delivers email"| node_emailprovider
node_api -.->|"handles refunds"| node_refund
node_refund -.->|"requests refund"| node_liqpay
node_api -.->|"authenticates"| node_auth
node_api -.->|"supports Google sign-in"| node_oauth
node_api -.->|"manages points"| node_bonuses
node_api -.->|"manages promotions"| node_promotions
node_api -.->|"serves staff tools"| node_staffadmin
node_api -.->|"records changes"| node_audit
node_api -->|"reads and writes"| node_database
node_oauth -.->|"loads users"| node_database

click node_web "https://github.com/antonbas/cinema/blob/master/frontend/src/App.tsx"
click node_api "https://github.com/antonbas/cinema/blob/master/backend/src/main/java/ua/lviv/bas/cinema/CinemaApplication.java"
click node_catalog "https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/movie"
click node_schedule "https://github.com/antonbas/cinema/blob/master/backend/src/main/java/ua/lviv/bas/cinema/cinema/SessionScheduleQueryService.java"
click node_venues "https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/cinema/hall"
click node_reservation "https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/booking/reservation"
click node_booking "https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/booking"
click node_payment "https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/payment"
click node_tickets "https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/ticket"
click node_email "https://github.com/antonbas/cinema/blob/master/backend/src/main/java/ua/lviv/bas/cinema/notification/EmailService.java"
click node_refund "https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/refund"
click node_auth "https://github.com/antonbas/cinema/blob/master/backend/src/main/java/ua/lviv/bas/cinema/user/auth/AuthService.java"
click node_oauth "https://github.com/antonbas/cinema/blob/master/backend/src/main/java/ua/lviv/bas/cinema/config/security/CustomOAuth2UserService.java"
click node_bonuses "https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/bonus"
click node_promotions "https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/promotion"
click node_staffadmin "https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema"
click node_audit "https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/audit"

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_catalog,node_schedule,node_venues toneBlue
class node_reservation,node_booking,node_payment,node_tickets,node_email,node_refund,node_database toneAmber
class node_auth,node_oauth,node_bonuses,node_promotions,node_api toneMint
class node_staffadmin,node_audit toneRose
class node_visitor,node_staff,node_liqpay,node_emailprovider toneIndigo
class node_web toneTeal
```

## Components

### Films and scheduling

- [Movie catalog](https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/movie): `backend/src/main/java/ua/lviv/bas/cinema/movie`
- [Session schedule](https://github.com/antonbas/cinema/blob/master/backend/src/main/java/ua/lviv/bas/cinema/cinema/SessionScheduleQueryService.java): `backend/src/main/java/ua/lviv/bas/cinema/cinema/SessionScheduleQueryService.java`
- [Halls and seats](https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/cinema/hall): `backend/src/main/java/ua/lviv/bas/cinema/cinema/hall`

### Booking and fulfilment

- [Seat reservation](https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/booking/reservation): `backend/src/main/java/ua/lviv/bas/cinema/booking/reservation`
- [Booking](https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/booking): `backend/src/main/java/ua/lviv/bas/cinema/booking`
- [Payment processing](https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/payment): `backend/src/main/java/ua/lviv/bas/cinema/payment`
- [Ticket issuance](https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/ticket): `backend/src/main/java/ua/lviv/bas/cinema/ticket`
- [Email delivery](https://github.com/antonbas/cinema/blob/master/backend/src/main/java/ua/lviv/bas/cinema/notification/EmailService.java): `backend/src/main/java/ua/lviv/bas/cinema/notification/EmailService.java`
- [Refunds](https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/refund): `backend/src/main/java/ua/lviv/bas/cinema/refund`

### Accounts and benefits

- [Authentication](https://github.com/antonbas/cinema/blob/master/backend/src/main/java/ua/lviv/bas/cinema/user/auth/AuthService.java): `backend/src/main/java/ua/lviv/bas/cinema/user/auth/AuthService.java`
- [Google sign-in](https://github.com/antonbas/cinema/blob/master/backend/src/main/java/ua/lviv/bas/cinema/config/security/CustomOAuth2UserService.java): `backend/src/main/java/ua/lviv/bas/cinema/config/security/CustomOAuth2UserService.java`
- [Bonus points](https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/bonus): `backend/src/main/java/ua/lviv/bas/cinema/bonus`
- [Promotions](https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/promotion): `backend/src/main/java/ua/lviv/bas/cinema/promotion`

### Staff and operations

- [Staff administration](https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema): `backend/src/main/java/ua/lviv/bas/cinema`
- [Change audit](https://github.com/antonbas/cinema/tree/master/backend/src/main/java/ua/lviv/bas/cinema/audit): `backend/src/main/java/ua/lviv/bas/cinema/audit`

### Other components

- **Visitor**
- **Staff**
- [React app](https://github.com/antonbas/cinema/blob/master/frontend/src/App.tsx): `frontend/src/App.tsx`
- [REST API](https://github.com/antonbas/cinema/blob/master/backend/src/main/java/ua/lviv/bas/cinema/CinemaApplication.java): `backend/src/main/java/ua/lviv/bas/cinema/CinemaApplication.java`
- **LiqPay**
- **PostgreSQL**
- **Email provider**

## Connections

- Visitor → React app: uses
- Staff → React app: uses
- React app → REST API: REST requests
- REST API → Movie catalog: serves catalog
- REST API → Session schedule: queries schedule
- Session schedule → PostgreSQL: reads sessions
- REST API → Halls and seats: manages halls
- REST API → Seat reservation: reserves seats
- REST API → Booking: creates booking
- REST API → Payment processing: processes payment
- Payment processing → LiqPay: exchanges payment
- REST API → Ticket issuance: issues tickets
- REST API → Email delivery: sends tickets
- Email delivery → Email provider: delivers email
- REST API → Refunds: handles refunds
- Refunds → LiqPay: requests refund
- REST API → Authentication: authenticates
- REST API → Google sign-in: supports Google sign-in
- REST API → Bonus points: manages points
- REST API → Promotions: manages promotions
- REST API → Staff administration: serves staff tools
- REST API → Change audit: records changes
- REST API → PostgreSQL: reads and writes
- Google sign-in → PostgreSQL: loads users
