Git Product home page Git Product logo

bookmyshow's Introduction

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

bookmyshow's People

Contributors

praypratyay avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

shoib007

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.