A comprehensive movie ticket booking platform built with Spring Boot, featuring dynamic pricing, waitlist management, and smart cancellation policies.
- π€ User Management - Registration and profile management
- π¬ Movie Management - Add and browse movies
- ποΈ Theater Management - Manage theaters and seating
- π Show Scheduling - Create and manage movie shows
- πΊ Smart Seat Selection - Real-time availability with temporary holds
- ποΈ Ticket Booking - Instant booking confirmation
- Time-based refund policy (100% to 0% based on time before show)
- Automatic refund processing
- Instant seat release back to inventory
Refund Policy:
- More than 48 hours: 100% refund
- 24-48 hours: 75% refund
- 12-24 hours: 50% refund
- 6-12 hours: 25% refund
- Less than 6 hours: No refund
- Demand-Based: Prices increase as seats fill up
- Time-Based: Different pricing for morning/evening shows
- Day-Based: Weekend vs weekday pricing
- Real-time price calculation
- FIFO queue management
- Automatic notifications when seats become available
- Position tracking
- Auto-expiry after show time
- Java 21 + Spring Boot 3.2.5
- MySQL 8.0 + JPA/Hibernate
- Maven + Lombok
- JUnit 5 + Mockito
- Swagger/OpenAPI for API documentation
- Java JDK 21+
- MySQL 8.0+
- Maven 3.6+ (or use included wrapper)
- IDE (IntelliJ IDEA / Eclipse)
CREATE DATABASE cineconnect;Update src/main/resources/application.properties:
spring.datasource.url=jdbc:mysql://localhost:3306/cineconnect
spring.datasource.username=root
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=updateUsing IDE:
- Open project in IntelliJ/Eclipse
- Run
BookMyShowApplication.java
Using Maven:
mvn spring-boot:runUsing JAR:
mvn clean package
java -jar target/book-my-show-application-0.0.1-SNAPSHOT.war- Application: http://localhost:8080
- Swagger UI: http://localhost:8080/swagger-ui.html
Base URL: http://localhost:8080/api/v1
POST /api/v1/users - Register user
GET /api/v1/users/{userId} - Get user
GET /api/v1/users/mobile/{mobNo} - Get user by mobile
POST /api/v1/movies - Add movie
GET /api/v1/movies - Get all movies
GET /api/v1/movies/{movieId} - Get movie
PUT /api/v1/movies/{movieId} - Update movie
POST /api/v1/theaters - Add theater
POST /api/v1/theaters/{id}/seats - Add seats
GET /api/v1/theaters - Get all theaters
POST /api/v1/shows - Create show
POST /api/v1/shows/{id}/seats - Add show seats
GET /api/v1/shows - Get all shows
POST /api/v1/seats/available - Check availability
POST /api/v1/seats/select - Select seats (10 min hold)
POST /api/v1/tickets/book - Book ticket
GET /api/v1/tickets/{ticketId} - Get ticket
GET /api/v1/tickets/user/{userId} - Get user bookings
POST /api/v1/tickets/{id}/cancel - Cancel ticket
GET /api/v1/tickets/{id}/refund - Get refund status
POST /api/v1/waitlist - Add to waitlist
DELETE /api/v1/waitlist/{id} - Cancel waitlist
GET /api/v1/waitlist/user/{userId} - Get user waitlists
GET /api/v1/pricing/shows/{id} - Get pricing
POST /api/v1/pricing/shows/{id}/apply - Apply pricing
GET /api/v1/pricing/configs - Get pricing rules
Total: 31 RESTful APIs
- Register User
POST /api/v1/users
{
"name": "John Doe",
"emailId": "john@example.com",
"mobNo": "9876543210"
}- Check Available Seats
POST /api/v1/seats/available
{
"movieName": "Inception",
"showDate": "2026-01-25",
"showTime": "18:00:00",
"theaterId": 1
}- Select Seats
POST /api/v1/seats/select
{
"showId": 1,
"selectedSeats": ["1A", "1B"],
"userMobNo": "9876543210"
}- Book Ticket
POST /api/v1/tickets/book
{
"movieName": "Inception",
"showDate": "2026-01-25",
"showTime": "18:00:00",
"requestedSeats": ["1A", "1B"],
"theaterId": 1,
"mobNo": "9876543210"
}- Cancel if Needed
POST /api/v1/tickets/{ticketId}/cancel
{
"cancellationReason": "Emergency"
}CineConnect/
βββ Controllers/ # 9 REST Controllers
βββ Service/ # 10 Business Logic Services
βββ Repository/ # 11 Data Access Repositories
βββ Models/ # 11 JPA Entities
βββ Requests/ # 10 Request DTOs
βββ Responses/ # 5 Response DTOs
βββ Exceptions/ # 6 Custom Exceptions
βββ Enums/ # 7 Enumerations
# Run all tests
mvn test
# Run specific test
mvn test -Dtest=CancellationServiceTestTest Coverage: 74 test cases
- CancellationService: 16 tests
- DynamicPricingService: 18 tests
- WaitlistService: 18 tests
- TicketService: 10 tests
- Integration Tests: 12 tests
Tables: 11 tables including users, movies, theaters, shows, tickets, waitlists, pricing_configs, refund_transactions
Auto-created by Hibernate with spring.jpa.hibernate.ddl-auto=update
Success:
{
"success": true,
"message": "Operation successful",
"data": { ... }
}Error:
{
"timestamp": "2026-01-23T10:30:00",
"status": 404,
"error": "Not Found",
"message": "User not found",
"path": "/api/v1/users/123"
}- Seats held for 10 minutes during selection
- FIFO waitlist queue management
- Time-based refund calculation
- Multi-factor dynamic pricing
- Automatic seat cleanup for expired selections
Genres: HORROR, ROMANTIC, COMEDY, BIOGRAPHY, DRAMA, ACTION, THRILLER, SCIFI, FICTIONAL
Languages: ENGLISH, HINDI, TELUGU, TAMIL, KANNADA, BENGALI, MARATHI, PUNJABI
Seat Types: CLASSIC, PREMIUM
- API Endpoints: 31
- Controllers: 9
- Services: 10
- Test Cases: 74
- Code Quality: Principal Software Engineer standards β
- Use
spring.jpa.show-sql=truefor SQL debugging - Configure email for waitlist notifications
- Set up scheduled tasks for cleanup
- Enable Swagger at
/swagger-ui.html
API_DOCUMENTATION.md- Detailed API referenceQUICK_START.md- 5-minute setup guideREFACTORING_COMPLETE.md- Recent improvements
- Fork the repository
- Create feature branch (
git checkout -b feature/NewFeature) - Commit changes (
git commit -m 'Add NewFeature') - Push to branch (
git push origin feature/NewFeature) - Open Pull Request
MIT License - see LICENSE file for details
Built with β€οΈ using Spring Boot 3.2.5
β Star this repo if you find it useful!