Thanks to visit codestin.com
Credit goes to github.com

Skip to content

swapnil5053/CineVerse

Repository files navigation

CineVerse

CineVerse is a database-driven theatre management and movie booking system built as a course project for the Database Management Systems (DBMS) curriculum. It demonstrates how core relational database features—such as tables, constraints, triggers, stored procedures, functions, and views—are integrated with a full-stack web application to handle real-world business requirements.

Note: As this course focuses purely on Database Management Systems and database principles without including frontend development in the syllabus, the React-based user interface was developed with the assistance of AI tools. This provides a modern, interactive presentation layer to visualize the underlying database routines in real-time.


User Interface Previews

Interactive Seat Selection Map

CineVerse Seat Selector Map

Show Booking & Ticket Selection

CineVerse Show Selection

Admin Analytics Dashboard

CineVerse Admin Dashboard


Project Objectives

The primary goal of this project is to implement robust business logic directly within the database engine rather than solely relying on application code. This enforces critical data integrity and prevents race conditions (such as double-bookings) at the database layer.

Key design principles demonstrated:

  • Data Consistency: Using foreign keys, checks, and unique constraints to prevent invalid data states.
  • Transactional Atomicity: Managing ticket purchases via stored procedures that lock relevant rows (SELECT ... FOR UPDATE) to prevent concurrent allocation of the same seat.
  • Dynamic Updates: Automatically recalculating available seat counts using MySQL triggers.
  • Separation of Concerns: Exposing data summaries through database views to simplify application queries.

Database Architecture and Design

The database schema is designed in Third Normal Form (3NF) to minimize redundancy and prevent anomalies.

Entities and Relations

The schema consists of eight main tables:

  • theatre: Represents physical cinema locations.
  • screen: Individual screen auditoriums inside theatres.
  • movie: Catalog of movies including durations, ratings, genres, and release details.
  • showtime: Specific instances of a movie showing on a screen at a date/time.
  • customer: User account directory supporting both Administrator and Customer roles.
  • booking: Customer transaction records indicating the show, seats booked, payment type, and status.
  • seat_booking: Granular mapping of individual seats (e.g., A1, B2) reserved under a booking.
  • staff: Employee list linked to specific theatres for administrative record-keeping.

Refer to REPORT.md for full descriptions of columns, data types, and index locations.

Database-Level Logic

  • Triggers:

    • trg_showtime_before_insert: Automatically assigns the initial available_seats count based on the parent screen's capacity when a new showtime is created.
    • trg_booking_after_insert: Decrements the available_seats count in the showtime table when a booking status is set to confirmed.
    • trg_booking_after_update: Restores the available_seats count and cancels individual seat records in the seat_booking table if a booking is cancelled or refunded.
    • trg_booking_after_delete: Restores showtime seat capacity if booking records are removed.
  • Stored Procedures:

    • sp_book_ticket: Orchestrates ticket purchases. It executes a database transaction that locks the targeted showtime row, verifies seat availability, inserts the booking record, and returns the unique booking identifier.
    • sp_get_total_revenue: Computes cumulative earnings from confirmed bookings over a defined date range.
  • Functions:

    • fn_show_revenue: Computes and returns the total revenue generated by a single showtime ID.
  • Views:

    • v_active_shows: Filters showtimes that are scheduled for today or later and still have empty seats.
    • v_theatre_revenue: Aggregates booking revenue and transaction counts grouped by theatre.

Application Structure

The project is structured as a decoupled three-tier application:

  1. Frontend (React + TypeScript):

    • A single-page application built with Vite and styled using Tailwind CSS and components from Shadcn UI.
    • Includes user authentication states, interactive show schedule browsers, and a graphic seat map selection tool.
    • Accessible via local port 8080.
  2. Backend (Flask + Python):

    • Serves as a RESTful API containing endpoints for authentication, resource lookups, transaction processing, and dashboard statistics.
    • Enforces session security via secure HTTP-only cookies and routes requests through a MySQL connection pool.
    • Accessible via local port 5000.
  3. Database (MySQL):

    • Stores all application state and runs the procedures, triggers, views, and integrity checks.

Data Seeding and Local Development

Because CineVerse is designed as a local DBMS project, it requires a local database instance to be initialized and seeded with data to function.

Seeding, Scale, and Customization

  • Show Schedule Window: The included generator script (generate_shows.py) generates showtime records spanning an 8-month window (specifically from November 15, 2025 to July 15, 2026), seeding over 5,100 shows.
  • Initial Dataset: The database starts pre-seeded with 40 movies, 3 theatres, and 7 screens to provide a rich dataset for evaluating search filters, capacity checks, and triggers.
  • Extending the Data: The system is designed to scale dynamically. Additional movies, screen configurations, or theatres can be appended to the SQL seed files, and the showtime database can be expanded to any duration by adjusting the target dates in generate_shows.py and running the script. The scheduling logic will automatically scale to match the updated parameters.

Installation and Execution

For detailed commands, database user permissions configuration, and troubleshooting steps to run the project on your machine, please refer to the Setup Guide.

About

A database-driven theatre management and movie booking system built as a DBMS course project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors