AI-powered movie recommendation engine with structured output validation and a clean web interface.
- AI-Powered Recommendations - Natural language queries transformed into personalized movie suggestions using GPT-4o-mini
- Structured Output - Pydantic validation ensures consistent, reliable data format with title, genre, year, rating, synopsis, and cast information
- Web Interface - Clean, responsive UI for easy interaction without technical setup
- RESTful API - FastAPI backend with automatic OpenAPI documentation
- Production Ready - Containerized with Docker, deployed on Render, health monitoring included
- Backend: FastAPI (Python 3.11)
- AI Model: OpenAI GPT-4o-mini
- Validation: Pydantic v2
- Deployment: Docker on Render
- Frontend: Vanilla JavaScript
# Clone the repository
git clone https://github.com/davidleocadio94/movie-recommender-ralph-test-1.git
cd movie-recommender-ralph-test-1
# Install dependencies
pip install -r requirements.txt
# Set up environment
cp .env.example .env # Add your OpenAI API key
# Run the application
uvicorn src.api:app --reloadVisit http://localhost:8000 to use the web interface.
# Build and run with Docker
docker build -t movie-recommender .
docker run -p 8000:8000 -e OPENAI_API_KEY=your-key-here movie-recommenderInteractive API documentation is available at:
curl -X POST "https://movie-recommender-ralph-test-1.onrender.com/recommend" \
-H "Content-Type: application/json" \
-d '{"query": "Recommend a sci-fi movie for a relaxing weekend"}'{
"title": "Arrival",
"genre": "sci-fi",
"year": 2016,
"rating": 8.0,
"synopsis": "A linguist is recruited by the military to communicate with alien lifeforms after twelve mysterious spacecraft appear around the world.",
"director": "Denis Villeneuve",
"lead_actor": "Amy Adams"
}movie-recommender-ralph-test-1/
├── src/
│ ├── main.py # Pydantic model + core recommendation function
│ ├── api.py # FastAPI application with endpoints
│ └── static/
│ └── index.html # Web UI
├── requirements.txt # Python dependencies
├── Dockerfile # Container configuration
├── render.yaml # Render deployment config
├── .env.example # Environment template
└── README.md
Built as part of the DeepLearning.AI Pydantic Course