A powerful and user-friendly REST API for managing a movie catalogue, built with Node.js, Express, and MongoDB. The API is hosted at api.danieldjupvik.dev/api, and the interactive Swagger documentation is available at api.danieldjupvik.dev/swagger.
- Comprehensive RESTful API for managing movies 🎥
- Perform CRUD operations on movies 🎦
- Secure JWT token-based authentication 🔐
- Interactive Swagger documentation for easy API exploration 📘
- MongoDB integration using Mongoose for seamless data management 🗄️
- CORS enabled for cross-origin requests 🌐
- Vercel deployment-ready for quick and hassle-free hosting ☁️
Follow these instructions to set up the project on your local machine for development and testing purposes.
Ensure you have Node.js and npm installed on your machine.
- Clone the repository:
git clone https://github.com/danieldjupvik/movie-catalogue-api.git
- Change to the project directory:
cd movie-catalogue-api
- Install the required dependencies:
npm install
- Create a
.envfile in the root directory and populate it with your MongoDB connection information:
MONGO_USERNAME=your_mongodb_username
MONGO_PASSWORD=your_mongodb_password
- Start the development server:
npm run dev
The API should now be running at http://localhost:6075/api.
To access the protected routes, first generate a JWT token:
GET /api/generate/token
Include the returned token as a query parameter for the following protected routes:
- GET /api/movies
- GET /api/movies/:id
- POST /api/movies/add
- PUT /api/movies/update/:id
- DELETE /api/movies/:id
For a comprehensive overview of the available API routes and their usage, consult the Swagger documentation.
Note: Tests are currently not configured for this project. We plan to add tests in the near future to improve project stability and maintainability.
The project is ready for deployment on Vercel. Follow these steps to deploy it quickly:
- Install the Vercel CLI:
npm install -g vercel
- Login to your Vercel account:
vercel login
- Deploy the project:
vercel --prod
Your API is now live on a Vercel-provided domain.
Daniel Djupvik - GitHub
This project is licensed under the MIT License - see the LICENSE file for details.