The Movie Recommendation System is a graph-based web application developed using Python, Flask, and CognoDB. The application stores movies, users, genres, actors, and directors as graph nodes and uses graph traversal to recommend movies based on user interests.
Unlike traditional SQL databases, CognoDB efficiently manages highly connected data using nodes and relationships, making it ideal for recommendation systems.
- View All Movies
- Search Movies
- View Movie Details
- Add New Movie
- Edit Movie
- Delete Movie
- Personalized Movie Recommendations
- Graph Database Traversal
- Responsive Bootstrap User Interface
- REST API Support
- Python 3
- Flask
- CognoDB
- Neo4j Python Driver
- HTML5
- CSS3
- Bootstrap 5
- JavaScript
MovieRecommendationSystem/
│
├── queries/
│ ├── movie_queries.py
│ └── recommendation_queries.py
│
├── routes/
│ ├── movie_routes.py
│ └── recommendation_routes.py
│
├── services/
│ ├── movie_service.py
│ └── recommendation_service.py
│
├── templates/
│
├── static/
│ ├── css/
│ ├── js/
│ └── images/
│
├── tests/
│
├── app.py
├── config.py
├── database.py
├── seed.py
├── requirements.txt
├── README.md
├── GRAPH_MODEL.md
├── PROJECT_REPORT.md
└── .gitignore
Traditional relational databases store data in tables and retrieve related information using JOIN operations.
This project contains highly connected entities such as:
- Users
- Movies
- Genres
- Actors
- Directors
Graph databases like CognoDB store these relationships directly, making recommendation queries much faster and easier than multiple SQL JOIN operations.
Example relationships:
User ------LIKES------> Movie
Movie -----BELONGS_TO-----> Genre
Movie -----DIRECTED_BY-----> Director
Movie -----ACTED_BY-----> Actor
The recommendation engine traverses these relationships to suggest movies based on the genres of movies liked by a user.
+-----------+
| User |
+-----------+
|
LIKES
|
▼
+-----------+
| Movie |
+-----------+
/ | \
/ | \
▼ ▼ ▼
Genre Actor Director
- User
- Movie
- Genre
- Actor
- Director
- LIKES
- BELONGS_TO
- ACTED_BY
- DIRECTED_BY
MATCH (m:Movie)
RETURN m;MATCH (m:Movie {id:$id})
RETURN m;MATCH (m:Movie)
WHERE toLower(m.title) CONTAINS toLower($title)
RETURN m;MATCH (u:User {name:$user})-[:LIKES]->(:Movie)-[:BELONGS_TO]->(g:Genre)
MATCH (m:Movie)-[:BELONGS_TO]->(g)
WHERE NOT (u)-[:LIKES]->(m)
RETURN DISTINCT
m.title,
m.rating
ORDER BY m.rating DESC;MATCH (m:Movie)-[:DIRECTED_BY]->(d:Director)
RETURN m,d;MATCH (m:Movie)-[:ACTED_BY]->(a:Actor)
RETURN m,a;MATCH (m:Movie)-[:BELONGS_TO]->(g:Genre)
RETURN m,g;GET /movies
GET /movies/<id>
GET /search?title=MovieName
POST /add-movie
POST /edit-movie/<id>
GET /delete-movie/<id>
GET /recommend/Aravind
Clone the repository
git clone https://github.com/Diyash-18/MovieRecommendationSystem.gitMove into the project folder
cd MovieRecommendationSystemCreate a virtual environment
python -m venv venvActivate virtual environment
Windows
venv\Scripts\activateInstall dependencies
pip install -r requirements.txtSeed the database
python seed.pyRun the application
python app.pyOpen in browser
http://127.0.0.1:5000
Database Connection
python tests/test_connection.pyVerify Database
python tests/verify_db.pyRecommendation Test
python tests/test_recommendation.py- Graph Database Implementation
- Movie CRUD Operations
- Search Functionality
- Recommendation Engine
- Multi-Hop Graph Traversal
- Parameterized Cypher Queries
- Responsive Bootstrap UI
- REST API Integration
- Modular Flask Architecture
- User Authentication
- Login & Registration
- Movie Posters API
- User Ratings
- Watchlist Feature
- AI-Based Recommendations
- Admin Dashboard
- Collaborative Filtering
- Movie Reviews
https://movie-recommendation-system-ifn3.onrender.com
DIYA
Movie Recommendation System
Developed using Python, Flask, and CognoDB as part of the CognoDB Assignment.