How sanjeevveerapandian/booking-system-api works
Purpose and runtime
MovieBooking is a layered ASP.NET Core backend for cinema operations: identity, theater/movie/show administration, seat selection, booking, payment, invoicing, and ticket delivery. The HTTP host starts in MovieBooking.API/Program.cs; endpoint groups are implemented as MVC controllers under MovieBooking.API/Controllers.
Composition and dependency boundaries
The solution separates API delivery, application use cases, persistence, and infrastructure adapters. Dependency injection is assembled through MovieBooking.Application/Extensions/ApplicationServiceRegistration.cs, MovieBooking.Persistence/Extensions/PersistenceServiceRegistration.cs, and MovieBooking.Infrastructure/Extensions/InfrastructureServiceRegistration.cs. Application services depend on interfaces; persistence and infrastructure provide implementations.
HTTP API and authorization edge
Controllers expose resource-oriented operations for auth, bookings, catalog, venues, shows, payments, invoices, tickets, and administration. Key entry points include MovieBooking.API/Controllers/AuthController.cs, MovieBooking.API/Controllers/BookingsController.cs, and MovieBooking.API/Controllers/AdminController.cs. JWT issuance is abstracted by MovieBooking.Application/Interfaces/IJwtTokenGenerator.cs and implemented in MovieBooking.Infrastructure/Security/JwtTokenGenerator.cs, making authentication an infrastructure boundary.
Core booking lifecycle
Booking is the central transactional workflow: requests use booking DTOs, the application service coordinates availability and persistence, and booking/seat associations represent reserved seats. Primary paths are MovieBooking.Application/Services/BookingService.cs, MovieBooking.Application/DTOs/Booking/CreateBookingDto.cs, MovieBooking.Persistence/Models/Booking.cs, and MovieBooking.Persistence/Models/BookingSeat.cs. Seat availability is a separate service/repository concern through MovieBooking.Application/Services/SeatService.cs and MovieBooking.Persistence/Repositories/SeatRepository.cs.
Cinema catalog and scheduling
Theater, screen, seat, movie, and show services form the scheduling hierarchy that booking consumes. Relevant components are MovieBooking.Application/Services/TheaterService.cs, MovieBooking.Application/Services/ScreenService.cs, MovieBooking.Application/Services/ShowService.cs, plus persisted models MovieBooking.Persistence/Models/Theater.cs, MovieBooking.Persistence/Models/Screen.cs, and MovieBooking.Persistence/Models/Show.cs. Movie metadata is managed independently by MovieBooking.Application/Services/MovieService.cs and MovieBooking.Persistence/Models/Movie.cs.
Financial and fulfillment stages
After booking, payment, invoice, and ticket services model downstream commercial artifacts. The main application stages are MovieBooking.Application/Services/PaymentService.cs, MovieBooking.Application/Services/InvoiceService.cs, and MovieBooking.Application/Services/TicketService.cs; persisted financial records are MovieBooking.Persistence/Models/Payment.cs and MovieBooking.Persistence/Models/Invoice.cs. Generated ticket PDFs are served from API static content under MovieBooking.API/wwwroot/tickets.
Persistence and external services
Entity Framework-style data access is centralized in MovieBooking.Persistence/Context/MovieBookingDbContext.cs, with entity-specific repository interfaces/implementations such as MovieBooking.Persistence/Repositories/IBookingRepository.cs and MovieBooking.Persistence/Repositories/BookingRepository.cs. SMTP email is an external integration behind MovieBooking.Application/Interfaces/IEmailService.cs, implemented by MovieBooking.Infrastructure/Email/EmailService.cs; email logging is represented by MovieBooking.Persistence/Models/EmailLog.cs.
Main entry points: Controllers MVC controllers · MovieBookingDbContext.cs MovieBooking DbContext · BookingService.cs Booking service · PaymentService.cs Payment service
Components 20
API delivery
- ASP.NET Core host · Starts the API and composes dependency injection.
MovieBooking.API/Program.cs - MVC controllers · Resource endpoints for auth, booking, catalog, administration, and fulfillment.
MovieBooking.API/Controllers - Ticket PDFs · Generated tickets served by the API.
MovieBooking.API/wwwroot/tickets
Application use cases
- Booking service · Coordinates booking creation and reserved-seat persistence.
MovieBooking.Application/Services/BookingService.cs - Create booking DTO
MovieBooking.Application/DTOs/Booking/CreateBookingDto.cs - Seat service · Handles seat availability concerns.
MovieBooking.Application/Services/SeatService.cs - Cinema scheduling services · Manages theaters, screens, shows, and movies.
MovieBooking.Application/Services/ShowService.cs - Payment service
MovieBooking.Application/Services/PaymentService.cs - Invoice service
MovieBooking.Application/Services/InvoiceService.cs - Ticket service · Generates ticket fulfillment artifacts.
MovieBooking.Application/Services/TicketService.cs - JWT token contract
MovieBooking.Application/Interfaces/IJwtTokenGenerator.cs - Email contract
MovieBooking.Application/Interfaces/IEmailService.cs
Persistence
- MovieBooking DbContext · Centralized entity data access.
MovieBooking.Persistence/Context/MovieBookingDbContext.cs - Booking repository
MovieBooking.Persistence/Repositories/BookingRepository.cs - Seat repository
MovieBooking.Persistence/Repositories/SeatRepository.cs - Booking and seat records · Represents bookings and their reserved-seat associations.
MovieBooking.Persistence/Models/Booking.cs - Cinema catalog records · Theater, screen, show, and movie data.
MovieBooking.Persistence/Models/Show.cs - Payment and invoice records
MovieBooking.Persistence/Models/Payment.cs
Infrastructure
- JWT token generator
MovieBooking.Infrastructure/Security/JwtTokenGenerator.cs - SMTP email service
MovieBooking.Infrastructure/Email/EmailService.cs
Connections 26
- ASP.NET Core host → MVC controllers: hosts
- MVC controllers → Booking service: booking requests
- MVC controllers → Cinema scheduling services: catalog and show operations
- MVC controllers → Payment service: payment operations
- MVC controllers → Invoice service: invoice operations
- MVC controllers → Ticket service: ticket operations
- MVC controllers → JWT token contract: auth token issuance
- Create booking DTO → Booking service: input
- Booking service → Seat service: checks availability
- Booking service → Booking repository: persists booking
- Seat service → Seat repository: queries seats
- Booking repository → MovieBooking DbContext: uses
- Seat repository → MovieBooking DbContext: uses
- MovieBooking DbContext → Booking and seat records: maps
- MovieBooking DbContext → Cinema catalog records: maps
- MovieBooking DbContext → Payment and invoice records: maps
- Cinema scheduling services → MovieBooking DbContext: manages catalog
- Booking service → Payment service: initiates commercial flow
- Payment service → Invoice service: produces invoice
- Invoice service → Ticket service: enables ticket
- Payment service → Payment and invoice records: stores payment
- Invoice service → Payment and invoice records: stores invoice
- Ticket service → Ticket PDFs: writes PDFs
- JWT token contract → JWT token generator: implemented by
- Email contract → SMTP email service: implemented by
- Ticket service → Email contract: delivers ticket