Find information on popular movies that are currently out. Browse trending titles, search by name, and watch trailers, all in one place.
Demo: YouTube Showcase
master(default) runs on PostgreSQL via Flask-SQLAlchemy. This is the actively developed implementation, deployed at cineversehd.com. It doesn't currently have a working automated test suite: the checked-inapi/app_test.pypredates the move to SQLAlchemy and targets an older SQL API, so it won't run correctly againstmasteras-is.sqliteis an earlier implementation on SQLite (via CS50's SQL library) with a workingpytest/unittestsuite. Check out this branch if you want to run the tests locally.
Instructions below target Windows + VS Code; steps are equivalent on macOS/Linux aside from the virtual-environment activation command and PowerShell-specific notes.
- Clone the repository:
git clone https://github.com/ah410/cineverse.git cd cineverse - Create and activate a virtual environment (requires Python 3.11.x, 3.12+ is
not supported):
If Windows blocks the activation script, run PowerShell as Administrator and execute
python -m venv myenv myenv/scripts/activate
Set-ExecutionPolicy RemoteSignedfirst. - Install dependencies (includes
pytest):pip install -r requirements.txt
- Set the required environment variables (see below).
- Run the app:
cd api flask run - Run tests (on the
sqlitebranch only, see Branches above):pytest app_test.py # or python -m unittest app_test.py
| Variable | Purpose |
|---|---|
TMDB_API_KEY |
The Movie Database API key, used to fetch movie listings/details. |
TMDB_READ_ACCESS_TOKEN |
The Movie Database API v4 Read Access Token, sent as the Authorization: Bearer header on TMDB requests. |
YouTube_API_KEY |
YouTube Data API v3 key, used to fetch trailer links. Without it, the movie description page (trailer view) won't load; login and home page still work. Get a free key via the Google Cloud Console and the Google API Python Client docs. |
SECRET_KEY |
Flask session secret. |
POSTGRESQL_URL |
Postgres connection string (master branch only). |
On Windows, set these under User Variables. See these instructions.
Login/Sign-Up. Users land on the login page by default; unauthenticated
requests to any route redirect there. Sign-up takes a username and password
(confirmed twice), storing a werkzeug.security password hash rather than the
plaintext password.
Home Page. A grid of movie posters and titles pulled from TMDB, rendered via a Jinja loop. Hovering enlarges the poster; clicking a movie loads its description page.
Search. A search bar on the homepage matches movie titles using a SQL
LIKE query with wildcards against the locally cached movie table.
Description Page. Shows the enlarged poster, title, release date,
description, and an embedded trailer. The trailer is resolved at request time
via a YouTube Data API v3 search for "<title> trailer", extracting the first
result's video ID for the embed URL.
Front-End: HTML, CSS, JavaScript, Bootstrap
Back-End: Python, Flask
Data: PostgreSQL (master) / SQLite via CS50 SQL (sqlite branch), The
Movie Database (TMDB) API, YouTube Data API v3
- Login-required redirect: a
login_requireddecorator (using*args/**kwargs) wraps protected routes and redirects unauthenticated requests to/login. - TMDB and YouTube API integration: movie listings come from TMDB's popular
movies endpoint, and trailers are resolved via the YouTube Data API v3
(
googleapiclient.discovery.build), searching by title and extracting the video ID from the first search result to build an embeddable IFrame URL. Scraping approaches (Selenium, BeautifulSoup) were tried first but abandoned since YouTube's search results are client-side rendered. - Homepage layout: movie cards are rendered via a Jinja loop with a fixed percentage width for a fixed grid; each poster is wrapped in a form that POSTs the clicked movie's ID (via a hidden input) to load its description page.
- Favorite movies: let users save movies to a favorites list.
- Advanced search: filter by title, genre, rating, or release year.
- User reviews and ratings.
- Sort options on the homepage.