Welcome to the Movie Store API, a Node.js application that provides a comprehensive backend service for managing movie-related data. This API allows you to create, read, update, and delete movie records, as well as manage user authentication and authorization.
To get started with the Movie Store API, follow these steps:
-
Clone the repository:
git clone https://github.com/RubaAlhasan/movie-store.git
-
Navigate to the project directory:
cd movie-store
-
Install the dependencies:
npm install
To run the API locally, use the following command:
npm start
By default, the API will be accessible at http://localhost:3000
.
-
Get all movies
GET /api/movies
-
Get a single movie
GET /api/movies/:id
-
Create a new movie
POST /api/movies
-
Update a movie
PUT /api/movies/:id
-
Delete a movie
DELETE /api/movies/:id
-
Register a new user
POST /api/users/register
-
User login
POST /api/users/login
-
Get user profile
GET /api/users/profile
-
Get all genres
GET /api/genres
-
Get a single genre
GET /api/genres/:id
-
Create a new genre
POST /api/genres
-
Update a genre
PUT /api/genres/:id
-
Delete a genre
DELETE /api/genres/:id
-
Get all reviews for a movie
GET /api/movies/:movieId/reviews
-
Create a new review for a movie
POST /api/movies/:movieId/reviews
-
Update a review
PUT /api/movies/:movieId/reviews/:reviewId
-
Delete a review
DELETE /api/movies/:movieId/reviews/:reviewId
-
Get all orders
GET /api/orders
-
Get a single order
GET /api/orders/:id
-
Create a new order
POST /api/orders
-
Update an order
PUT /api/orders/:id
-
Delete an order
DELETE /api/orders/:id
The Movie Store API requires the following environment variables to function correctly. Create a .env
file in the root directory and add the necessary variables:
PORT=3000
MONGODB_URI=<your-mongodb-uri>
JWT_SECRET=<your-jwt-secret>
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes.
- Push your branch to your forked repository.
- Create a pull request to the main repository.
This project is licensed under the MIT License. See the LICENSE file for more details.