Welcome to the backend of the Movie App! This project provides the server-side functionality for managing movies, users, and reviews.
- Introduction
- Features
- Technologies
- Architecture
- Installation
- Usage
- API Endpoints
- Contributing
- License
- Contact
The Movie App Backend is a RESTful API built to handle the data and business logic for a movie application. It allows users to browse movies, read reviews, and manage their profiles.
- User authentication and authorization
- CRUD operations for movies
- User reviews and ratings
- Search and filter movies
- Secure and scalable architecture
- Programming Language: Node.js
- Framework: Express.js
- Database: MongoDB
- Authentication: JWT
- Environment Management: dotenv
The project follows a clean architecture approach, with the following layers:
- API Layer: Handles HTTP requests and responses.
- Service Layer: Contains business logic.
- Repository Layer: Handles data access.
- Model Layer: Defines the data structure and rules.
To get a local copy up and running, follow these steps:
-
Clone the repository:
git clone https://github.com/your-username/movie-app-backend.git
-
Navigate to the project directory:
cd movie-app-backend
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.env
file in the root directory and add the following:PORT=5000 MONGODB_URI=your_mongodb_uri JWT_SECRET=your_jwt_secret
-
Start the server:
npm start
Once the server is running, you can access the API at http://localhost:5000
.
Here are some of the main endpoints available in the API:
-
Movies:
GET /api/movies
- Get all moviesGET /api/movies/:id
- Get a single movie by IDPOST /api/movies
- Create a new moviePUT /api/movies/:id
- Update a movie by IDDELETE /api/movies/:id
- Delete a movie by ID
-
Users:
POST /api/users/register
- Register a new userPOST /api/users/login
- Login a userGET /api/users/profile
- Get user profile (requires authentication)
-
Reviews:
POST /api/movies/:id/reviews
- Add a review to a movie (requires authentication)GET /api/movies/:id/reviews
- Get all reviews for a movie
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Your Name - [email protected]
Project Link: https://github.com/your-username/movie-app-backend