Skip to content

Repository files navigation

Movie Catalogue API 🎬

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.

Node.js Logo Express Logo MongoDB Logo Swagger Logo

Table of Contents

Features 🚀

  • 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 ☁️

Getting Started 🏁

Follow these instructions to set up the project on your local machine for development and testing purposes.

Prerequisites

Ensure you have Node.js and npm installed on your machine.

Installation

  1. Clone the repository:
git clone https://github.com/danieldjupvik/movie-catalogue-api.git
  1. Change to the project directory:
cd movie-catalogue-api
  1. Install the required dependencies:
npm install
  1. Create a .env file in the root directory and populate it with your MongoDB connection information:
MONGO_USERNAME=your_mongodb_username
MONGO_PASSWORD=your_mongodb_password
  1. Start the development server:
npm run dev

The API should now be running at http://localhost:6075/api.

Usage 📚

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.

Testing ⚙️

Note: Tests are currently not configured for this project. We plan to add tests in the near future to improve project stability and maintainability.

Deployment 🚀

The project is ready for deployment on Vercel. Follow these steps to deploy it quickly:

  1. Install the Vercel CLI:
npm install -g vercel
  1. Login to your Vercel account:
vercel login
  1. Deploy the project:
vercel --prod

Your API is now live on a Vercel-provided domain.

Author ✍️

Daniel Djupvik - GitHub

License 📄

This project is licensed under the MIT License - see the LICENSE file for details.

About

MovieAPI - test - first Nodejs REST API

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages