API-movies-catalog-management is a basic back-end project for a typescript and prisma POC
This application assists in movie catalog management, allowing the monitoring of movies registration and allowing users the option of adding movies to their lists.
- Clone this repository
- Install all dependencies
npm i
- Create a new PostgreSQL database
- Configure the
.env
file using the.env.example
- Run all migrations
npm run dev:migration
- Run seed db
npm run dev:seed
- Run the back-end in a development environment:
npm run dev
npm run build
npm start
Genres routes:
Post: /genres
BODY: {"name": "genre_name"}
This route creates a new genre.
GET: /genres
This route sends all genres recorded.
GET: /genres/amount
This route sends the amount of appearance of each genre.
DELETE: /genres/:id
This route deletes the genre with the given id.
Movies routes:
POST: /movies
BODY: {
title: "movie_title",
poster_picture:"movie_poster_picture"
description:"movie_description"
genre_ids:[genre_ids]
}
This route creates a new movie.
GET: /movies
This route sends all movies recorded.
GET: /movies/:id
This route sends the movie with the given id.
GET: /movies/genres/:id
This route sends the movies accordingly with the given genre id.
PATCH: /movies/:id
BODY: { description:"movie_description"}
This route updates the movie description with the given id.
DELETE: /movies/:id
This route deletes the movie with the given id.
Auth routes:
POST: /sign-up
BODY: {
name : "user_name",
email:"user_email"
password:"user_password"
confirmPassword:"user_password"
}
This route creates a account for the user.
POST: /sign-in
BODY: {
email:"user_email"
password:"user_password"
}
This route logs in the user.
Users routes:
POST: /users/movies-list/:movieId
BODY: {}
This route adds the movie with the given id to the user movies list.
GET: /users/movies-list/
This route sends all movies recorded in the user movies list.
PATCH: /users/movies-list/:movieId
BODY: {}
This route updates the watched status to true of the movie with the given id.
DELETE: /users/movies-list/:movieId
This route deletes the movie with the given id from the user movies list.
MIT