Skip to content

FutureForgeOrg/Ticket-Booking-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

149 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎬 Go Boot It - Ticket Booking System

A full-stack ticket booking application for movies and events with a comprehensive admin panel for management and control.

✨ Features

User Features

  • 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

Admin Features

  • 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

πŸ“‹ Tech Stack

Frontend

  • 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

Backend

  • 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

πŸ“ Project Structure

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)

πŸ”Œ API Endpoints

Authentication (/api/auth)

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 βœ“

Movies (/api/movies)

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

Cinemas (/api/cinemas)

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

Shows (/api/shows)

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

Tickets (/api/tickets)

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

Events (/api/events)

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

Payments (/api/payment)

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

Movie Likes (/api/movieLikes)

Method Endpoint Description Auth
POST /like/:movieId Toggle like/favorite βœ“
GET /like-status/:movieId Get like status βœ“

Featured Banners (/api/featured-banners)

Method Endpoint Description Auth
GET / Get featured banners -

πŸš€ Getting Started

Prerequisites

  • Node.js (v16+)
  • MongoDB
  • Razorpay account
  • Cloudinary account
  • Email service (Gmail or similar)

Backend Setup

cd backend
npm install

Create .env file from example:

cp .env.example .env

Configure .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:3001

Start server:

npm run dev

Frontend Setup

cd frontend
npm install

Create .env file from example:

cp .env.example .env

Configure .env:

VITE_API_URL=http://localhost:5000/api
VITE_RAZORPAY_KEY=your_razorpay_public_key

Start development server:

npm run dev

Admin Client Setup

cd admin-client
npm install

Create .env file from example:

cp .env.example .env

Configure .env:

VITE_API_URL=http://localhost:5000/api
VITE_RAZORPAY_KEY=your_razorpay_public_key

Start development server:

npm run dev

πŸ“ Key Features Implementation

  • 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

πŸ” Authentication

  • JWT tokens stored in HTTP-only cookies
  • Token-based session management
  • Role-based middleware for protected routes

πŸ“ˆ Database Models

  • 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

πŸ‘¨β€πŸ’» Developed by

  • Purv Patel
  • Param Bhavsar
  • Prince Patel

Version: 1.0.0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors