This project is a simple movie recommendation system that leverages various technologies to provide users with personalized movie recommendations. The system is built using a combination of MongoDB, Express, Node.js, React, and Django, incorporating several machine learning techniques and libraries.
- MongoDB: A NoSQL database used to store movie data efficiently.
- Express: A web application framework for Node.js, used to build the API endpoints.
- Node.js: A JavaScript runtime used to run the backend server.
- Django: A high-level Python web framework used to implement the machine learning model.
- React: A JavaScript library for building user interfaces.
- React-Bootstrap: A popular front-end framework for developing responsive and mobile-first websites.
- React Router: A standard library for routing in React applications.
- Font Awesome: A toolkit for icons and social logos.
- Axios: A promise-based HTTP client for the browser and Node.js, used to make HTTP requests from the frontend to the backend.
- Pandas: A powerful data manipulation and analysis library for Python.
- NumPy: A library for numerical operations in Python.
- NLTK (Natural Language Toolkit): A suite of libraries and programs for symbolic and statistical natural language processing.
- Scikit-learn: A machine learning library for Python, used for implementing the recommendation algorithm.
- PorterStemmer: An algorithm for removing common morphological and inflexional endings from words in English.
- CountVectorizer: A tool from Scikit-learn used to convert a collection of text documents to a matrix of token counts.
- Cosine Similarity: A metric used to measure how similar two data points are irrespective of their size.
- server.js: The main entry point of the backend application.
- models/Movie.js: The Mongoose schema for the Movie collection.
- src/index.js: The main entry point of the React application.
- src/App.js: The main component that includes routing and layout.
- src/components/Navbar.js: A navigation bar component.
- ml/recommendation.py: Python script containing the recommendation logic using Pandas, NumPy, and Scikit-learn.
- ml/config.py: Configuration file containing movie data and similarity matrices.
Movie data is stored in MongoDB. The data includes movie titles, genres, descriptions, and other relevant information.
A content-based filtering model is implemented using Scikit-learn. The model uses CountVectorizer to convert movie descriptions into a matrix of token counts, and Cosine Similarity to compute the similarity between movies.
The Express server exposes API endpoints to fetch movie data and recommendations. These endpoints interact with the MongoDB database and the Django machine learning model.
The React application provides a user-friendly interface for interacting with the recommendation system. Users can search for movies and get personalized recommendations.
Here is an overview of how the system works:
-
User Input:
- The user inputs a movie name in the React frontend.
-
Frontend Request:
- The React app sends a POST request to the Express server, passing the movie name.
-
Movie Data Fetch:
- The Express server queries MongoDB to fetch relevant movie data.
-
Machine Learning:
- Express sends the movie ID to Django, which uses a content-based filtering model to get similar movies.
-
Recommendation:
- Django sends the recommended movie IDs back to Express, which then queries MongoDB for the details of those recommended movies.
-
Display Results:
- Express sends the recommended movies back to React, which displays them to the user.
Before you begin, ensure you have the following installed:
- Node.js
- Python
- MongoDB
-
Clone the repository:
git clone https://github.com/dipanjanpathak/MERN_Movie_Recomendation.git cd MERN_Movie_Recomendation -
Install backend dependencies:
cd backend npm install -
Install frontend dependencies:
cd frontend npm install -
Install Python dependencies:
cd Movie_Python pip install -r requirements.txt
-
Start MongoDB:
mongod
-
Start the backend server:
cd backend npm start -
Start the frontend server:
cd frontend npm start -
Start the Django server:
cd Movie_Python python manage.py runserver
Navigate to http://localhost:3000 in your browser to use the application. Use the search bar to find movies and get recommendations based on the selected movie.
This project is licensed under the MIT License.
