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.
| 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 |
IUser— shared interface for registered and guest usersIPaymentMethod— payment abstraction (card, cash, etc.)IPaymentMethodFactory— Factory pattern for creating payment method instances at booking time
Genre— action, thriller, romance, etc.Language— English, Bangla, etc.PaymentMethods— available payment types
- 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
- Node.js
- TypeScript / ts-node
git clone https://github.com/adnansabbir/bookMyShow.git
cd bookMyShow
npm installnpm startRuns 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.
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
MIT