pyBegin / projects / movie-rater
🔌

Movie Ratings API

This project is a simple Python API that manages movies and their respective ratings. It serves as a centralized hub for movie enthusiasts to share…

58 lines🖥 Desktop only

Movie Ratings API

Overview

This project is a simple Python API that manages movies and their respective ratings. It serves as a centralized hub for movie enthusiasts to share their opinions, discover new films, and assess the quality of movies they've watched.

Prerequisites

Before you begin, ensure you have met the following requirements:

Installation

  1. Clone the repository:

      git clone https://github.com/yourusername/your-project.git
      cd your-project
    
  2. Create and activate a virtual environment (optional but recommended):

        source venv/bin/activate  # On Windows, use venv\Scripts\activate
    
  3. Install the project dependencies:

    pip install -r requirements.txt
    

Example

Once the server is running, interact with the API at http://127.0.0.1:8000:

GET  /movies          → returns a list of popular movies from TMDB
GET  /movies/550      → returns details for the movie with id 550
POST /movies/550/rate?rating=8 → responds with {"message": "Movie rated successfully."}
  1. Running the Application

    To run the FastAPI application, use the following command:

    uvicorn main:app --reload