Skip to content

🎬 FastAPI-based Movie & TV Show Recommender using TMDb API 🎱| Search movies, get recommendations & browse top-rated content!

License

Notifications You must be signed in to change notification settings

freedomofchoice1991/movie_night_planner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Movie & TV Show Recommender API

License Python FastAPI HTML GitHub issues Last Commit Repo Size PRs Welcome Contributions TMDb API GitHub commit activity

Overview

This is a FastAPI-based application that suggests movies and TV shows using The Movie Database (TMDb) API. Users can:

  • Search for movies 🎬
  • Get popular & top-rated movies ⭐
  • Get recommendations based on input
  • Browse top-rated TV shows 📺
  • Use a simple frontend to explore movies

Features

FastAPI backend

TMDb API integration for movie data

HTML & JavaScript frontend

Dynamic search with movie posters & descriptions

Deployment-ready for local or cloud hosting


1️⃣ Setup & Installation

1.1 Clone the Repository

Open a terminal and run:

#  Clone the repository
git clone https://github.com/YOUR_USERNAME/fastapi-movie-recommender.git

# Navigate to the project directory
cd fastapi-movie-recommender

1.2 Create a Virtual Environment

Use Python's venv to isolate dependencies:

#  Create virtual environment
python -m venv venv

# Activate it
# On macOS/Linux:
source venv/bin/activate

# On Windows:
venv\Scripts\activate

1.3 Install Dependencies

   pip install -r requirements.txt

2️⃣ Get a TMDb API Key

To fetch movies & TV shows, you must register for an API key at TMDb:

  1. Visit TMDb API
  2. Sign up & create a developer account
  3. Get your API Key (v3 auth)
  4. Store it in a .env file
#  Create the .env file in your project directory
nano .env

Inside .env, add:

TMDB_API_KEY=your_api_key_here

3️⃣ Running the Project Locally

3.1 Start the FastAPI Server

   uvicorn app.main:app --reload

This will run the server at: http://127.0.0.1:8000/

3.2 Access the Frontend

Open a browser and go to:


4️⃣ API Endpoints

Endpoint Method Description
/movies/popular GET Get popular movies
/movies/top-rated GET Get top-rated movies
/movies/search/?query=movie_name GET Search for a movie
/tv/top-rated GET Get top-rated TV shows

5️⃣ Deployment Options

Option 1: Local (Uvicorn)

   uvicorn app.main:app --host 0.0.0.0 --port 8000

Option 2: Deploy on Render Website

What is Render? A Cloud Application Service provider

Think of "Render" as a service that takes your website or application code and makes it live on the internet.

  1. Push your code to GitHub
   git add .
   git commit -m "Ready for deployment"
   git push origin main
  1. Go to Render & create a new Web Service
  2. Connect your GitHub repo & set up environment variables:
    • TMDB_API_KEY=your_api_key_here
  3. Deploy & test it at your Render URL 🚀

6️⃣ Additional Tips & Tricks

Use Postman or httpie to test API requests:

    http GET http://127.0.0.1:8000/movies/popular

Enable caching (if needed) using Redis:

    pip install fastapi-cache2 redis

Customize the frontend (static/index.html, static/style.css) ✅ Secure the API with authentication if required


💡 Contribution & Support

  • Found a bug? Open an issue on GitHub!
  • Want to contribute? Fork & submit a PR

📌 Made with ❤️ using FastAPI & TMDb API

About

🎬 FastAPI-based Movie & TV Show Recommender using TMDb API 🎱| Search movies, get recommendations & browse top-rated content!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published