Skip to content

RubaAlhasan/movie-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Movie Store API

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.

Table of Contents

Installation

To get started with the Movie Store API, follow these steps:

  1. Clone the repository:

    git clone https://github.com/RubaAlhasan/movie-store.git
  2. Navigate to the project directory:

    cd movie-store
  3. Install the dependencies:

    npm install

Usage

To run the API locally, use the following command:

npm start

By default, the API will be accessible at http://localhost:3000.

API Endpoints

Movies

  • 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

Users

  • Register a new user

    POST /api/users/register
  • User login

    POST /api/users/login
  • Get user profile

    GET /api/users/profile

Genres

  • 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

Reviews

  • 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

Orders

  • 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

Environment Variables

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>

Contributing

Contributions are welcome! Please follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Commit your changes.
  4. Push your branch to your forked repository.
  5. Create a pull request to the main repository.

License

This project is licensed under the MIT License. See the LICENSE file for more details.