Applications / Movie Ticket System / Movie Booking design
Movie Booking
-
Design
1. Functional Requirements
1. Allow users to search for movies by title, genre, actor, or release date, and view movie details such as showtimes, ratings, and reviews.
2. Users can book movie tickets, select seats, and make payments using a secure payment gateway.
3. The system should send a confirmation email or SMS to the user with the booking details and QR code for entry.
4. Allow users to cancel or modify their bookings, and refund the appropriate amount based on the cancellation policy.
5. The system should notify the user and the theater management about any changes to the show timings, cancellations, or rescheduling of movies.
6. Provide an admin dashboard for the theater management to add and manage movies, update show timings, and view sales reports.
7. The system should ensure data privacy and security, and protect against fraud and unauthorized access.
2. Non-Functional Requirements
1. The system should be highly available and scalable to handle peak loads during weekends and holidays.
2. The system should be user-friendly, responsive, and accessible on different devices and platforms.
3. The system should have a fast and reliable search and booking engine, and provide real-time updates on seat availability and pricing.
4. The system should have a robust and reliable payment gateway, and ensure secure and seamless transactions.
5. The system should comply with industry standards and regulations, and protect the user's personal and financial data.
3. low-level design
class Person { constructor(firstName, lastName, gender, address, phoneNo) { this.firstName = firstName; this.lastName = lastName; this.gender = gender; this.address = address; this.phoneNo = phoneNo; } } class User extends Person { constructor(firstName, lastName, gender, address, phoneNo, email, password) { super(firstName, lastName, gender, address, phoneNo); this.email = email; this.password = password; } viewMovies() { // view movies logic here } searchMovies(searchQuery) { // search movies logic here } bookTicket(movie, showtime, seats) { // book ticket logic here } makePayment(paymentInfo) { // make payment logic here } modifyBooking(bookingId, newShowtime, newSeats) { // modify booking logic here } cancelBooking(bookingId) { // cancel booking logic here } } class Admin extends Person { constructor(firstName, lastName, gender, address, phoneNo, email, password) { super(firstName, lastName, gender, address, phoneNo); this.email = email; this.password = password; } manageMovies() { // manage movies logic here } manageShowtimes() { // manage showtimes logic here } viewBookings() { // view bookings logic here } cancelBooking(bookingId) { // cancel booking logic here } } class Movie { constructor(title, genre, director, cast, synopsis, duration, releaseDate, image) { this.title = title; this.genre = genre; this.director = director; this.cast = cast; this.synopsis = synopsis; this.duration = duration; this.releaseDate = releaseDate; this.image = image; } } class Showtime { constructor(movie, startTime, endTime, theater, seats) { this.movie = movie; this.startTime = startTime; this.endTime = endTime; this.theater = theater; this.seats = seats; } bookSeats(numSeats) { // book seats logic here } cancelSeats(numSeats) { // cancel seats logic here } } class Booking { constructor(user, showtime, seats, paymentInfo) { this.user = user; this.showtime = showtime; this.seats = seats; this.paymentInfo = paymentInfo; this.status = "Booked"; } modifyBooking(newShowtime, newSeats) { // modify booking logic here } cancelBooking() { // cancel booking logic here } } class Payment { constructor(cardholderName, cardNumber, expiryDate, cvv) { this.cardholderName = cardholderName; this.cardNumber = cardNumber; this.expiryDate = expiryDate; this.cvv = cvv; } makePayment(amount) { // make payment logic here } } 3. DB