Skip to content

wale-dot/Cinema-api

Repository files navigation

Cinema API

This was my first backend project. I built it to practice working with MySQL, FastAPI, Pandas and Docker together in one project. The idea is a movie theatre booking system where customers can book seats and prices change depending on the seat type and day of the week.

What I used

  • Python and FastAPI for the REST API
  • MySQL for storing movies, customers and bookings
  • SQLAlchemy as the ORM
  • Pandas for cleaning and loading movie data from CSV into the database
  • Docker to containerize the API and database together

How to run it

Clone the repo and create a .env file from the example:

cp .env.example .env

Update the .env with your MySQL credentials then run with Docker:

docker compose up --build

Or run locally:

pip install -r requirements.txt uvicorn main:app --reload

The API will be at http://localhost:8000 and the docs at http://localhost:8000/docs

Loading sample data

To clean and load sample movies from CSV run:

python3 seed.py

Pandas reads the CSV, drops missing values, fixes text casing, removes duplicates and checks for existing records before inserting. This avoids loading the same data twice.

What the API covers

Movies, customers and bookings each have GET, POST and DELETE endpoints. When a booking is made the system looks up the seat type to get the base price, checks the day of the week for any discount and calculates the final price automatically.

Seat types are regular, VIP and recliner. Discounts are higher mid-week and zero on weekends.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors