This project is a Flask-based API that recommends movies based on your ratings and IMDb ratings.
- Docker
- Docker Compose
- Clone the repository:
git clone https://github.com/jorgedom5/IMDb-Movie-Recommender.git
-
Prepare your environment:
Make sure you have Docker and Docker Compose installed on your system.
- Build and start the Docker container:
docker-compose up --build
This will build the Docker image and start the Flask application. The API will be available at http://localhost:5000
.
- URL:
/
- Method:
GET
- Description: Returns an HTML table of recommended movies based on the ratings provided.
- URL:
/upload
- Method:
POST
- Description: Upload a CSV file containing user ratings.
To upload your CSV file using CURL, use the following command:
curl -X POST -F "file=@/path/to/your/file.csv" http://localhost:5000/upload
IMDb allows users to download their ratings in CSV format. Here are the steps to do it:
- Open your web browser and go to IMDb.
- Log in with your IMDb account. If you don't have an account, sign up first.
- Once logged in, click on your username at the top right of the page.
- From the dropdown menu, select "Your Ratings".
- On the ratings page, look for the option to export your data. This is usually found at the top right of the ratings list.
- Click on "Export this list".
- A CSV file will be downloaded to your computer.
- Once you have the CSV file prepared and correctly formatted, you can upload it to the API using the following CURL command:
curl -X POST -F "file=@/path/to/your/file.csv" http://localhost:5000/upload
This will upload your ratings into the system and allow you to get personalized movie recommendations through the API.
If the upload is successful, you will receive a JSON response with a confirmation message. If there is any error, check the error messages and adjust your CSV file as necessary.
.
├── app.py
├── docker-compose.yml
├── Dockerfile
├── requirements.txt
├── data
│ └── processed
│ ├── imdb_movies.csv
│ └── my_ratings.csv
└── templates
└── index.html
- Ensure that the
data/processed
directory exists and contains the necessary CSV files before starting the application. - The Flask application is set to run in development mode. For production, you may want to update the configuration accordingly.
For more information on Docker and Docker Compose, refer to the official documentation:
Enjoy your movie recommendations!