A progressive Node.js framework for building efficient and scalable server-side applications.
This repository contains a NestJS-based API for managing a list of favorite movies. It includes authentication and authorization using JWT.
- Docker
- Docker Compose
-
Clone the repository:
git clone https://github.com/your-repo/movie-api.git cd movie-api
-
Create a .env file in the root directory and add your environment variables:
DB_HOST=db DB_PORT=3306 DB_USERNAME=root DB_PASSWORD=your_password_here DB_NAME=movies_db JWT_SECRET=your_jwt_secret_here
- POST
/auth/login
: Logs in a user and returns a JWT token. - POST
/auth/register
: Registers a new user.
- GET
/movies
: Returns a list of favorite movies. - GET
/movies/:id
: Returns a movie by ID. - POST
/movies
: Creates a new movie. - PUT
/movies/:id
: Updates a movie by ID. - DELETE
/movies/:id
: Deletes a movie by ID.
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# Build and start the containers:
$ docker-compose up --build
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- Author - Kamil Myśliwiec
- Website - https://nestjs.com
- Twitter - @nestframework
Replace placeholders like your-repo
, your_password_here
, your_jwt_secret_here
, Your Name
, Your Website
, and @yourtwitterhandle
with your actual project details and author information. This structure integrates your specific project setup into the NestJS README template effectively.