Backend service for a Movie Reservation System that manages movies, showtimes, seats, and bookings with concurrency-safe seat locking.
- User authentication and authorization (User & Admin roles)
- Movie, theater, and showtime management
- Real-time seat availability handling
- Transactional booking logic to prevent double bookings
- Booking history and reservation management
- Role-based access control for admin operations
- Clean and scalable REST API architecture
- Node.js
- Express.js
- PostgreSQL
- REST APIs
- JWT Authentication
- Users can register and log in using email and password
- JWT token is issued on successful login
- Protected routes require a valid JWT
- Admin-only routes are secured using role-based middleware
- Seat availability is checked inside a database transaction
- Seats are locked during booking to avoid race conditions
- If booking fails, the transaction is rolled back
- Ensures no double booking during concurrent requests
POST /api/auth/register POST /api/auth/login
GET /api/movies GET /api/movies/:id POST /api/admin/movies POST /api/admin/shows
GET /api/shows/:id/seats POST /api/bookings GET /api/bookings/history
- Centralized error handling middleware
- Request validation for all APIs
- Proper HTTP status codes and error messages
- Payment gateway integration
- Redis-based caching and seat locking
- WebSocket support for real-time seat updates
- Rate limiting and security hardening
- Multi-theater and multi-city support