This project is the backend for a Movie Recommendation System. It provides a RESTful API for managing users, movies, reviews, recommendations, and more. The backend is built using Node.js, Express, and MongoDB, with API documentation provided by Swagger.
- User authentication and management
- Movie management (CRUD operations)
- Review and rating system
- Personalized movie recommendations
- Custom movie lists
- Article and discussion management
- Notification system
- Swagger API documentation
-
Clone the repository:
git clone https://github.com/Rayyan9477/Backend-for-Movie-Recommendation-System.git cd Backend-for-Movie-Recommendation-System
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.env
file in the root directory and add the following variables:PORT=5000 MONGO_URI=mongodb://localhost/movierecommendation JWT_SECRET=your_jwt_secret
-
Start the server:
npm start
For development with hot-reloading:
npm run dev
The API is available at http://localhost:5000/api
. Swagger documentation is accessible at http://localhost:5000/api-docs
.
POST /auth/register
- Register a new userPOST /auth/login
- User login
GET /users/profile
- Get user profilePUT /users/profile
- Update user profileGET /users/wishlist
- Get user's wishlistPOST /users/wishlist
- Add movie to wishlist
GET /movies/{id}
- Get movie detailsPOST /movies
- Add a new movie (Admin)PUT /movies/{id}
- Update a movie (Admin)DELETE /movies/{id}
- Delete a movie (Admin)GET /movies/{id}/similar
- Get similar moviesGET /movies/top/month
- Get top movies of the monthGET /movies/top/genre/{genre}
- Get top movies by genreGET /movies/{id}/boxoffice
- Get box office details of a movie
POST /reviews
- Add or update a reviewGET /reviews/{movieId}
- Get reviews for a movie
GET /recommendations
- Get personalized recommendationsGET /recommendations/trending
- Get trending movies
POST /lists
- Create a new custom listGET /lists
- Get user's custom listsPOST /lists/{listId}/movies
- Add a movie to a list
GET /articles
- Get all articles
GET /discussions
- Get all discussionsPOST /discussions
- Create a new discussionPOST /discussions/{id}/comments
- Add a comment to a discussion
GET /notifications
- Get user notificationsPUT /notifications/{id}/read
- Mark a notification as read
GET /admin/stats
- Get site statisticsDELETE /admin/reviews/{id}
- Delete a user reviewGET /admin/movies
- Retrieve all moviesGET /admin/trending-genres
- Get trending genres
Contributions are welcome! Please fork the repository and create a pull request with your changes.
- GitHub: Rayyan9477
- LinkedIn: Rayyan Ahmed
- Email: rayyanahmed265@yahoo.com