Skip to content

praypratyay/BookMyShow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design BookMyShow (Low Level Design)

OVERVIEW

BookMyShow is an application generally used for booking movies/shows across different theatres in various cities. A person logs in into the app and books one/multiple tickets by selecting seats of one particular show. After confirming the seats, they make the payment and get the tickets.

We dont want just entities for this. We want to build an entire software system thats takes input. Persist data in a real database. I will be using Django for this.

Requirements and Clarifications

Q) Does BookMyShow support mulliple cities?

Yes.

Q) Can one theatre have multiple auditoriums?

Yes.

Q) Can auditorium have different seating arrangement?

Yes.

Q) Can seats in an auditorium be of multiple types?

Yes.

Q) The price of a seat typically depends on time of a show, the theatre, the movie, or type of a seat. Is that the case here?

Yes.

Q) Will there be dynamic pricing i.e tickets becomes expensive if seats are less?

No.

Q) Are we allowing booking events as well?

No, only support movies for now.

Q) What all attributes of a movie we need to support?

Rating. Cast. Features. Duration. Languages.

Q) People should see all available movies in a city and then see the theatres which are playing that movie. Right?

Yes.

Q) Is only registered user allowed to book?

Yes.

Q) Is there a max limit on the no. of tickets one can book?

Yes. Keep it 10.

Q) Can a user book tickets for multiple shows at a time?

No.

Q) Are we supporting cancellation of a booking?

Yes and they can get a refund.

Q) Are we supporting booking food add-ons or discount coupons?

No.

Q) What mode of payment does it support?

Online that is managed by 3rd Party.

Classes - Attributes - Interfaces

City

  • ID
  • Name
  • Theatres (list of Theatre)

Theatre

  • ID
  • TheatreName
  • Address
  • Auditoriums (list of Auditorium)

Auditorium

  • ID
  • Name
  • Seats (list of Seat)
  • SupportedFeatures

Feature

  • 3D/2D/DOLBYAUDIO

Seat

  • ID
  • SeatNumber
  • Row
  • Column
  • SeatType

SeatType

  • ID
  • SeatTypeName (Club/Exceutive)

Show

  • ID
  • Movie
  • Auditorium
  • StartTime
  • EndTime
  • Features
  • Language

Movie

  • ID
  • Name
  • Rating
  • Languages
  • Cast

ShowSeatType (Mapping)

  • ID
  • Show
  • SeatType
  • Price

ShowSeat (Mapping)

  • ID
  • Show
  • Seat
  • SeatStatus

SeatStatus

  • FREE/OCCUPIED/LOCKED

Language

  • ENGLISH/HINDI/TAMIL

User

  • ID
  • Name
  • Age
  • Email
  • Password
  • Phone

Ticket

  • ID
  • User
  • BookingTime
  • Show
  • Amount
  • Status
  • Seats (list of Seat)
  • Payments (list of Payment)

TicketStatus

  • BOOKED/CANCELLED

Payment

  • ID
  • Amount
  • PaymentProvider
  • Type
  • Status
  • RefID
  • Ticket

PaymentType

  • PAYING/REFUND

PaymentStatus

  • SUCCESSFULL/FAILED

PaymentProvider

  • RAZORPAY/PAYU

PaymentGatewayAdapter

  • RazorPayPaymentGatewayAdapter (PaymentGatewayAdapter)

  • PayUPaymentGatewayAdapter (PaymentGatewayAdapter)

Notes

  • The seating arrangement across auditoriums can be very different. We implement this by a 100x100 Matrix (KISS - Keep It Simple, Stupid.) which stores seat information, and delete completely empty rows and columns. This is what is sent to frontend to visualize the seats.

  • We are supporting concurrency in seat booking. Only one person is allowed to book seats at a time. We implement this by using soft locking :

    • Take DB lock
    • Get seats
    • Check seats status
    • If seats are not available, remove DB lock
    • If every seat available, change seat status to LOCK and remove DB lock
    • Go to payment
    • Remove DB lock depending upon exit conditions

Schema Design (TABLES)

Django ORMs

HOW TO RUN?

python3 manage.py migrate
python3 manage.py runserver 5555

Releases

No releases published

Packages

No packages published

Languages