This project is a Spring Boot REST application that manages cinema movie screenings and seat reservations. It allows administrators to manage cinemas, halls, seats, movies, categories, screenings, and customers, while customers can view seat availability and create or cancel reservations.
All data is persisted in a relational database (PostgreSQL).
- The system must manage cinemas, each identified by name and city.
- A cinema must contain one or more halls.
- Each hall must contain a predefined set of seats, identified by row and number.
- The system must manage movies, including title, duration, age rating, description, and categories.
- A movie can belong to multiple categories, and categories can be reused.
- A movie can be scheduled for multiple screenings.
- A screening represents a movie shown in a specific hall at a specific date and time and has an associated price.
- Customers must be able to view seat availability for a screening.
- Customers must be able to create reservations for one or more seats for a screening.
- The system must prevent double booking of the same seat for the same screening and allow reservations to be cancelled.
-
Cinema, Hall, and Seat Management
Create and manage cinemas, halls inside cinemas, and seats inside halls. -
Movie & Category Management
Create, update, delete, and list movies and assign them to categories. -
Screening Management
Schedule screenings for movies in specific halls, with validation to prevent overlapping screenings. -
Seat Availability & Reservation
Display seat availability per screening and allow customers to reserve available seats. -
Reservation Management
View reservations, cancel reservations, and release seats automatically.
- Cinema
- Hall
- Seat
- Movie
- Category
- Screening
- Customer
- Reservation
- ReservationSeat (join entity)
- One Cinema has many Halls
- One Hall has many Seats
- One Movie has many Screenings
- One Hall has many Screenings
- One Customer has many Reservations
- One Reservation belongs to one Screening
- One Reservation has many ReservationSeats
- One Seat can appear in many ReservationSeats (for different screenings)
- Seat
(row, number)must be unique within a hall. - A seat can be reserved only once per screening.
- Reservation requests must contain at least one ticket.
- Ticket seat IDs must be unique inside a reservation request. (custom validation)
- Screening start time must be in the future.
- Customer email must be unique.
- Cancelling a reservation releases all associated seats.
- Create categories
- Create cinemas
- Create halls for a cinema
- Create seats for each hall
- Create movies and assign categories
- Create screenings for movies in halls
- View screenings and seat availability
- Create a customer
- Create a reservation
- Cancel a reservation if needed
This flow ensures correct setup and usage of the system.
All REST APIs in this application are fully documented using Swagger (OpenAPI 3).
The full visual API documentation exported from Swagger UI is available here: Swagger API Documentation (PDF).
The PDF was generated by exporting the Swagger UI using the browser print-to-PDF functionality.
GET /api/moviesPOST /api/moviesGET /api/screeningsGET /api/screenings/{id}/seatsPOST /api/reservationsPUT /api/reservations/{id}/cancelGET /api/customersPOST /api/customers
(Complete API documentation is available in Swagger.)
- Unit tests implemented for all services.
- Controller tests implemented for all REST endpoints.
- Validation and error scenarios fully tested.
- Java 21
- Spring Boot
- Spring Data JPA
- Hibernate
- PostgreSQL
- Bean Validation (Jakarta Validation)
- Swagger / OpenAPI (springdoc-openapi)
- JUnit 5 & Mockito