A full-stack ticket booking application for movies and events with a comprehensive admin panel for management and control.
- User registration & authentication with OTP verification
- Browse movies and events with filtering
- Seat selection and booking
- Real-time seat availability
- Online payment (Razorpay)
- Booking history and ticket management
- Like/favorite movies
- User dashboard & profile
- Complete movie management (CRUD operations)
- Cinema management with multi-screen support
- Show scheduling and management
- Event creation and management
- Booking & payment oversight
- User and RBAC management
- Revenue analytics
- Featured banner management
- React 18 with TypeScript
- TanStack React Query - State management & data fetching
- Zustand - Global state management
- React Hook Form - Form handling
- Zod - Schema validation
- Axios - HTTP client
- Tailwind CSS - Styling
- Vite - Build tool
- Node.js + Express.js - Server framework
- MongoDB + Mongoose - Database
- JWT + Cookies - Authentication
- Razorpay - Payment integration
- Cloudinary - Image storage
- Nodemailer - Email service
- Node Cron - Scheduled jobs
Ticket-Booking-System/
βββ backend/ # Node.js + Express server
β βββ controllers/ # Business logic
β βββ models/ # MongoDB schemas
β βββ routes/ # API endpoints
β βββ middlewares/ # Auth, role, multer
β βββ config/ # DB, Cloudinary, Razorpay config
β βββ jobs/ # Scheduled tasks (ticket expiry)
β βββ index.js # Server entry point
βββ frontend/ # React TypeScript app
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Route pages
β β βββ hooks/ # Custom hooks
β β βββ store/ # Zustand store
β β βββ api/ # API integration
β β βββ routes/ # App routing
β βββ vite.config.ts # Vite configuration
βββ admin-client/ # Admin dashboard (Vite + React)
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /register |
User registration | - |
| POST | /verify-otp |
Verify OTP | - |
| POST | /resend-otp |
Resend OTP | - |
| POST | /login |
User login | - |
| POST | /admin-login |
Admin login | - |
| POST | /create-admin |
Create admin user | β Admin |
| POST | /logout |
User logout | - |
| GET | /user |
Get current user | β |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | / |
Get all movies | - |
| GET | /trending |
Get most liked movies | - |
| GET | /:id |
Get movie details | - |
| GET | /status/:status |
Filter by status | - |
| POST | / |
Create movie | β Admin |
| PUT | /:id |
Update movie | β Admin |
| DELETE | /:id |
Delete movie | β Admin |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | / |
Get all cinemas | - |
| GET | /:id |
Get cinema details | - |
| POST | / |
Create cinema | β Admin |
| POST | /:cinemaId/screens |
Add screen | β Admin |
| DELETE | /:id |
Delete cinema | β Admin |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | / |
Get all active shows | - |
| GET | /:id |
Get show details | - |
| GET | /admin/all |
Get all shows (admin) | β Admin |
| GET | /movie/:movieId |
Get shows by movie & date | - |
| POST | / |
Create show | β Admin |
| PUT | /:id |
Update show | β Admin |
| PUT | /cancel/:id |
Cancel show | β Admin |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | / |
Get all tickets (admin) | β Admin |
| GET | /:ticketId |
Get ticket details | β |
| GET | /my-tickets |
Get user's tickets | β |
| POST | /book-seats |
Book seats | β |
| POST | /confirm-ticket/:ticketId |
Confirm booking | β |
| POST | /cancel-ticket |
Cancel ticket | β |
| POST | /admin/cancel-ticket |
Cancel ticket (admin) | β Admin |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | / |
Get all events | - |
| GET | /:id |
Get event details | - |
| GET | /trending |
Get trending events | - |
| GET | /my-bookings |
Get user's event bookings | β |
| GET | /bookings/:id |
Get booking details | β |
| POST | / |
Create event | β Admin |
| POST | /book |
Book event seats | β |
| POST | /confirm/:bookingId |
Confirm event booking | β |
| PUT | /:id |
Update event | β Admin |
| PUT | /cancel/:id |
Cancel event | β Admin |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /create-order |
Create Razorpay order | β |
| POST | /verify-payment |
Verify payment | β |
| POST | /refund-payment |
Process refund | β |
| GET | /revenue-stats |
Get revenue statistics | β Admin |
| GET | /all-payments |
Get all payments | β Admin |
| GET | /payment-details/:id |
Get payment details | β Admin |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /like/:movieId |
Toggle like/favorite | β |
| GET | /like-status/:movieId |
Get like status | β |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | / |
Get featured banners | - |
- Node.js (v16+)
- MongoDB
- Razorpay account
- Cloudinary account
- Email service (Gmail or similar)
cd backend
npm installCreate .env file from example:
cp .env.example .envConfigure .env:
PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secret
CLOUDINARY_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
EMAIL_USER=your_email@gmail.com
EMAIL_PASSWORD=your_app_password
FRONTEND_URL=http://localhost:5173
ADMIN_URL=http://localhost:3001Start server:
npm run devcd frontend
npm installCreate .env file from example:
cp .env.example .envConfigure .env:
VITE_API_URL=http://localhost:5000/api
VITE_RAZORPAY_KEY=your_razorpay_public_keyStart development server:
npm run devcd admin-client
npm installCreate .env file from example:
cp .env.example .envConfigure .env:
VITE_API_URL=http://localhost:5000/api
VITE_RAZORPAY_KEY=your_razorpay_public_keyStart development server:
npm run dev- RBAC: Role-based access control (User, Admin)
- OTP Verification: Email-based registration verification
- Seat Management: Dynamic seat layouts and real-time availability
- Auto Expiry: Tickets expire automatically based on show timing
- Payment Processing: Razorpay integration with order verification
- Image Uploads: Cloudinary for movie/event posters and banners
- Email Notifications: Nodemailer for booking confirmations
- JWT tokens stored in HTTP-only cookies
- Token-based session management
- Role-based middleware for protected routes
- User/Admin - User authentication and profiles
- Movie - Movie catalog
- Cinema - Cinema locations and screens
- Show - Movie schedules
- Ticket - Booking records
- Event - Event listings
- EventBooking - Event reservations
- Payment - Transaction history
- MovieLike - User preferences
- FeaturedBanner - Marketing banners
- Purv Patel
- Param Bhavsar
- Prince Patel
Version: 1.0.0