Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BookMyShow — Low-Level Design

A TypeScript implementation of the BookMyShow online movie ticket booking system, built as a Low-Level Design (LLD) exercise. Focuses on OOP principles, design patterns, and clean class modeling.

Design

Core Classes

Class Responsibility
BookMyShow App entry point — manages theatres, movie-to-show index, and ticket booking
Theatre Holds shows and seat capacity, tied to a Location
Movie Movie entity with language, genre, and rating
Show A specific screening — links a Movie to a Theatre at a given time, tracks available seats
Ticket Booking record — owner, show, seat count, payment method, cancellation state
RegisteredUser Authenticated user with booking history
GuestUser Unauthenticated user

Interfaces & Patterns

  • IUser — shared interface for registered and guest users
  • IPaymentMethod — payment abstraction (card, cash, etc.)
  • IPaymentMethodFactory — Factory pattern for creating payment method instances at booking time

Enums

  • Genre — action, thriller, romance, etc.
  • Language — English, Bangla, etc.
  • PaymentMethods — available payment types

Features

  • Search shows by movie name across all theatres
  • Book tickets with seat count validation and real-time seat availability tracking
  • Multiple payment methods via the Factory pattern
  • Ticket cancellation
  • Per-user booking history
  • Registered user and guest user flows

Prerequisites

  • Node.js
  • TypeScript / ts-node

Setup

git clone https://github.com/adnansabbir/bookMyShow.git
cd bookMyShow
npm install

Run

npm start

Runs the demo in src/index.ts — sets up theatres, movies, shows, and users, then books and cancels tickets, printing the booking history to the console.

Project Structure

src/
├── classes/
│   ├── BookMyShow.ts
│   ├── Theatre.ts
│   ├── Location.ts
│   ├── Movie.ts
│   ├── Show.ts
│   ├── Ticket.ts
│   ├── RegisteredUser.ts
│   ├── GuestUser.ts
│   ├── IUser.ts
│   ├── IPaymentMethod.ts
│   └── IPaymentMethodFactory.ts
├── enums/
│   ├── Genre.enum.ts
│   ├── Language.enum.ts
│   └── PaymentMethods.enum.ts
└── index.ts

License

MIT

About

Low-level design of an online movie ticket booking system in TypeScript — OOP modeling with Factory pattern, seat tracking, booking history, and ticket cancellation.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages