Yassir Chebaa

Eager software engineer with a BSc in Computer Science. C++ and Rust enthusiast, always learning.

  • Posts
  • About
  • Contact
  • GitHub
  • LinkedIn

Movie App

done2025-04-09Source

  • react
  • flask
  • python
  • rest-api
  • tailwind
  • tmdb
  • university

A movie browser: a Flask REST API over TMDB and a React + Tailwind frontend to look up movies, like them and find similar ones.

Why

A university assignment: design a RESTful API that wraps a third-party API, then build a frontend that consumes it. The data comes from TMDB; my API adds its own resources on top (favourites, similar movies, comparison plots).

MovieApp homepage

How it works

React frontend ──> Flask API (/api/*) ──> TMDB API      (movie data)
                                     └──> QuickChart API (bar plots)
  • Backend: Flask + Flask-RESTful, one resource class per endpoint, all under an /api prefix. Swagger docs generated with Flasgger.
  • Frontend: React with React Router, Axios calls through a small useFetch hook, styled with Tailwind.
  • Test script: consume_api.py calls every endpoint and prints the results.

Endpoints

MethodEndpointDoes
GET/movies/{id}Movie details
PUT/movies/{id}Like or unlike a movie
DELETE/movies/{id}Remove a movie
GET/movies/favouritesLiked movies
GET/movies/popular?amount=Popular movies
GET/movies/{id}/same_genreMovies sharing its genres
GET/movies/{id}/same_runtimeMovies with a similar runtime
GET/movies/bar_plot?movie_ids=Bar chart comparing up to 10 movies (QuickChart)

With the API running, all endpoints can be tried interactively in the Swagger UI at /apidocs/ (generated by Flasgger).

Frontend pages

Home, movie details, popular, similar movies, favourites and bar plot.

Design notes

  • RESTful: URLs name resources, not actions (/movies/5, /movies/popular), HTTP methods carry the verb, and paths are hackable up the tree (/movies/{id}/same_genre).
  • Errors: path and query parameters are type- and value-checked; bad input returns 400, a failed TMDB call returns 500. The bar plot still draws the remaining movies when one ID is not found, and the frontend tells the user which one failed.
  • Known limits: liked and deleted movies live in in-memory sets (no database), there is no caching, and lists are capped instead of paginated (popular at 20 movies per request, bar plot at 10).

Stack

  • Backend: Python, Flask 3.1, Flask-RESTful, Flask-CORS, Flasgger, requests, python-dotenv.
  • Frontend: React 19, React Router 7, Axios, Tailwind CSS, Create React App.
  • APIs: TMDB (movie data), QuickChart (plots).
  • Run scripts: one-command start for the API, frontend and test script, on Linux and Windows.

Links

  • TMDB API
  • QuickChart
OlderScaler 3 at KoalaDSPNeweredge at Snowcrash BV
All projects

Source codeQuestions about this project? Contact me

Disclaimer|Privacy Policy