This is a Node.js and Express.js-based API for managing movies.
- Add new movies.
- Fetch a list of movies.
- Update movie details.
- rate the movies
Before setting up the project, ensure you have the following installed:
Follow the steps below to set up the API locally.
git clone https://github.com/rayan2228/movie-management.git
cd movie-management
Use npm or yarn to install the required dependencies:
npm install
yarn install
Create a .env
file in the root directory and add the following variables from .env.example
file.
Run the following command to start the development server:
npm start
yarn start
The API should now be running at http://localhost:8000/api/v1
(or the port you configured in the .env
file).
Use a tool like Postman to test the API endpoints.
Use the following accounts to test authentication-related features of the API:
Email: admin@admin.com
Password: Pa$$0word
Email: rayanhossain.dev@gmail.com
Password: Pa$$0word
Email: rayanh.dev@gmail.com
Password: Pa$$0word
movie-management-api/
├── src/
│ ├── public/ # any public files
│ ├── controllers/ # API logic
│ ├── models/ # Mongoose models
│ ├── routes/ # Express routes
│ ├── middlewares/ # Middleware functions (e.g., authentication)
│ ├── db/ # Setup database
│ ├── utils/ # Utility functions
│ ├── services/ # External services
│ ├── templates/ # Like mail templates
│ └── app.js # Express app setup
│ └── constants.js # Setup constants variables
├── .env # Environment variables
├── .env.example # Environment variables copy
├── .gitignore # Git ignore file
├── package.json # Project dependencies and scripts
├── README.md # Documentation
└── server.js # Entry point
Here are the scripts defined in package.json
:
npm start
: Start the server in production mode.npm run dev
: Start the server in development mode using nodemon.
- Node.js - Backend runtime
- Express.js - Web framework
- MongoDB - Database
- Mongoose - MongoDB ODM
- JWT - Authentication
This project is licensed under the MIT License. See the LICENSE
file for details.