deaneeth/enterprise-cinema-booking-platform
A scalable, multi-tenant cinema management platform built with the MERN Stack, TypeScript, and Docker. Features real-time seat reservation (WebSockets), role-based access control (RBAC), secure payments, and extensive automated testing.
๐ฌ Enterprise Cinema Booking Platform
A scalable, multi-tenant cinema management platform built with the MERN Stack
Features โข Tech Stack โข Installation โข Usage โข API โข Contributors
๐ธ Screenshots
๐ผ๏ธ View More Screenshots
| Page | Screenshot |
|---|---|
| Home | ![]() |
| Movie Listing | ![]() |
| Movie Details | ![]() |
| Seat Selection | ![]() |
| Payment | ![]() |
| Booking Confirmation | ![]() |
| User Profile | ![]() |
| Admin Dashboard | ![]() |
| Cinema-Admin Dashboard | ![]() |
โจ Features
๐๏ธ Booking System
|
๐ Authentication & Security
|
๐ณ Payment Integration
|
๐ฌ Cinema Management
|
๐ Admin Dashboards
|
โญ Reviews & Ratings
|
๐ ๏ธ Tech Stack
| Frontend | Backend | Database | DevOps |
|---|---|---|---|
|
React 18 |
Node.js |
MongoDB |
Docker |
|
TypeScript |
Express.js |
Mongoose |
CI/CD |
|
Tailwind CSS |
Socket.io |
Redis (Cache) |
Jest |
Additional Technologies
| Category | Technologies |
|---|---|
| State Management | React Query (TanStack Query) |
| Form Handling | React Hook Form |
| HTTP Client | Axios |
| Authentication | JWT, bcryptjs |
| Validation | Joi |
| Payment | PayPal Checkout SDK |
| File Generation | jsPDF, html2canvas, QRCode |
| Testing | Jest, Supertest, React Testing Library |
๐๏ธ Architecture
graph TB
subgraph Client["๐ฅ๏ธ Frontend (React)"]
UI[UI Components]
RQ[React Query]
WS[WebSocket Client]
end
subgraph Server["โ๏ธ Backend (Express)"]
API[REST API]
Auth[Auth Middleware]
WSS[WebSocket Server]
end
subgraph Data["๐พ Data Layer"]
MongoDB[(MongoDB)]
Cache[(Redis Cache)]
end
subgraph External["๐ External Services"]
PayPal[PayPal API]
Email[SendGrid]
end
UI --> RQ --> API
WS <--> WSS
API --> Auth --> MongoDB
API --> Cache
API --> PayPal
API --> Email๐ Installation
Prerequisites
- Node.js >= 18.x
- MongoDB >= 6.0 (or Docker)
- npm >= 9.x
Quick Start with Docker (Recommended)
# Clone the repository
git clone https://github.com/deaneeth/enterprise-cinema-booking-platform.git
cd enterprise-cinema-booking-platform
# Start all services
docker compose up -d
# Access the application
# Frontend: http://localhost:3000
# Backend API: http://localhost:5000
# MongoDB: localhost:27017Manual Installation
๐ Step-by-step instructions
1. Clone the repository
git clone https://github.com/deaneeth/enterprise-cinema-booking-platform.git
cd enterprise-cinema-booking-platform2. Install dependencies
# Install root dependencies
npm install
# Install backend dependencies
cd backend
npm install
# Install frontend dependencies
cd ../frontend
npm install3. Configure environment variables
# Backend (.env in /backend directory)
cp backend/.env.example backend/.envEdit backend/.env:
# Server
PORT=5000
NODE_ENV=development
# MongoDB
MONGODB_URI=mongodb://localhost:27017/cinema-booking
# JWT
JWT_SECRET=your-super-secret-key
JWT_EXPIRES_IN=7d
# PayPal (Optional - for payments)
PAYPAL_CLIENT_ID=your-paypal-client-id
PAYPAL_CLIENT_SECRET=your-paypal-client-secret
PAYPAL_MODE=sandbox
# Email (Optional - for verification)
SENDGRID_API_KEY=your-sendgrid-api-key
FROM_EMAIL=noreply@yourcinema.com4. Start MongoDB
# Using Docker
docker run -d -p 27017:27017 --name mongodb mongo:latest
# Or install MongoDB locally
# https://www.mongodb.com/docs/manual/installation/5. Run the application
# Start backend (from /backend directory)
cd backend
npm run dev
# Start frontend (from /frontend directory - new terminal)
cd frontend
npm start๐ Usage
Default Accounts
After seeding the database (or first run), use these accounts:
| Role | Password | |
|---|---|---|
| Platform Admin | admin@gmail.com |
Admin123 |
| Cinema Admin | cinema@gmail.com |
Cinema123 |
| Regular User | user@gmail.com |
User123 |
User Workflows
journey
title Movie Booking Journey
section Browse
View Movies: 5: User
Select Movie: 5: User
View Showtimes: 5: User
section Book
Select Seats: 4: User
15-min Timer Starts: 3: System
Proceed to Payment: 4: User
section Pay
PayPal Checkout: 4: User
Confirm Payment: 5: PayPal
section Receive
Get QR Ticket: 5: System
Download PDF: 5: User๐ก API Documentation
The API follows RESTful conventions with comprehensive documentation.
Base URL
Development: http://localhost:5000/api
Production: https://api.your-domain.com/api
Authentication
All protected endpoints require a Bearer token:
Authorization: Bearer <your-jwt-token>Quick Reference
| Endpoint | Method | Description | Auth |
|---|---|---|---|
/auth/register |
POST | Register new user | โ |
/auth/login |
POST | Login user | โ |
/movies |
GET | List all movies | โ |
/movies/:id |
GET | Get movie details | โ |
/cinemas |
GET | List all cinemas | โ |
/showtimes |
GET | Get showtimes | โ |
/bookings |
POST | Create booking | โ |
/bookings/:id |
GET | Get booking | โ |
/payments/create-order |
POST | Create PayPal order | โ |
/payments/capture |
POST | Capture payment | โ |
๐ View Full API Documentation
See API_DOCUMENTATION.md for complete endpoint details, request/response schemas, and examples.
๐งช Testing
# Run all backend tests
cd backend
npm test
# Run unit tests only
npm run test:unit
# Run integration tests
npm run test:integration
# Run with coverage report
npm run test:coverage
# Run frontend tests
cd frontend
npm testTest Coverage
| Module | Coverage |
|---|---|
| Controllers | ~80% |
| Services | ~85% |
| Models | ~90% |
| Middleware | ~75% |
๐ Project Structure
enterprise-cinema-booking-platform/
โโโ ๐ backend/
โ โโโ ๐ src/
โ โ โโโ ๐ config/ # Database & app configuration
โ โ โโโ ๐ controllers/ # Route handlers
โ โ โโโ ๐ middlewares/ # Auth, validation, error handling
โ โ โโโ ๐ models/ # Mongoose schemas
โ โ โโโ ๐ routes/ # API routes
โ โ โโโ ๐ services/ # Business logic
โ โ โโโ ๐ tests/ # Unit & integration tests
โ โ โโโ ๐ types/ # TypeScript definitions
โ โ โโโ ๐ utils/ # Helper functions
โ โ โโโ ๐ server.ts # Entry point
โ โโโ ๐ package.json
โ โโโ ๐ tsconfig.json
โ
โโโ ๐ frontend/
โ โโโ ๐ src/
โ โ โโโ ๐ components/ # Reusable UI components
โ โ โโโ ๐ contexts/ # React contexts
โ โ โโโ ๐ hooks/ # Custom hooks
โ โ โโโ ๐ pages/ # Page components
โ โ โโโ ๐ services/ # API client
โ โ โโโ ๐ types/ # TypeScript types
โ โ โโโ ๐ App.tsx # Root component
โ โโโ ๐ package.json
โ โโโ ๐ tailwind.config.js
โ
โโโ ๐ docs/ # Documentation
โโโ ๐ docker-compose.yml # Docker configuration
โโโ ๐ .github/workflows/ # CI/CD pipelines
โโโ ๐ README.md
๐๏ธ Database Schema
erDiagram
USER ||--o{ BOOKING : makes
USER ||--o{ REVIEW : writes
CINEMA ||--o{ SHOWTIME : has
CINEMA ||--o{ REVIEW : receives
MOVIE ||--o{ SHOWTIME : scheduled_in
MOVIE ||--o{ REVIEW : receives
SHOWTIME ||--o{ BOOKING : for
BOOKING ||--o| PAYMENT : has
USER {
ObjectId _id PK
string email UK
string password
string name
enum role
boolean isVerified
}
CINEMA {
ObjectId _id PK
string name
string location
array facilities
ObjectId adminId FK
}
MOVIE {
ObjectId _id PK
string title
string description
number duration
string genre
string poster
}
SHOWTIME {
ObjectId _id PK
ObjectId movieId FK
ObjectId cinemaId FK
datetime startTime
number price
array seats
}
BOOKING {
ObjectId _id PK
ObjectId userId FK
ObjectId showtimeId FK
array seats
enum status
number totalAmount
}
PAYMENT {
ObjectId _id PK
ObjectId bookingId FK
string paypalOrderId
number amount
enum status
}๐ค Contributors
Dineth Hettiarachchi Project Lead |
Wickramaarachchi B S Backend Developer |
Himasha Sandeepani Frontend Developer |
Kasun Madhusanka Full Stack Developer |
Kavindu Backend Developer |
Ashiru Frontend Developer |
Jayaweera HRK Developer |
Rashmi Edirisinghe Developer |
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- PayPal Developer - Payment integration
- Socket.io - Real-time communication
- TailwindCSS - Styling framework
- React Query - Data fetching
- MongoDB - Database
โญ Star this repository if you found it helpful!











