Skip to content

Server-side web application that provides users with access to information about different movies, genres, directors and actors from the 1980s. Built with JavaScript, Node.js, Express and MongoDB.

License

gregoriodelasheras/myvhs-server

Repository files navigation

Logo

Web App for enthusiasts of 80's movies. All in one VHS! Built with the MEN stack.

Table of Contents
  1. About The Project
  2. Built With
  3. Dependencies
  4. Dev Dependencies
  5. Endpoints Design
  6. Documentation
  7. Client-side
  8. License
  9. Contact
  10. Acknowledgements

About The Project

Objective:

  • Build a web application that provides users with access to information about different movies, genres, directors and actors of the 1980s. Users are able to register, update their personal information, deregister and create a list of "Favorites" and "To Watch" movies.

User Stories:

  • As a user, I want to be able to receive information on movies, genres, directors and actors of the 1980s so that I can learn more about movies I’ve watched or am interested in.
  • As a user, I want to have a "Favorites" list and a "To Watch" list, and add and remove movies from them.
  • As a user, I want to access a simple web application with a minimalist interface, displaying only essential information.
  • As a user, I want to be able to create a profile so I can save data about my favorite movies.
  • As a user, I want to be able to update my personal data.
  • As a user, I want to be able to deregister my profile from the web application database.

Key Features:

  • Return a list of movies of the 80's to the user.
  • Return data about a single movie by title to the user.
  • Return data about movie genres to the user.
  • Return data about directors and actors to the user.
  • Allow new users to register.
  • Allow users to update their data by username.
  • Allow existing users to deregister by username.
  • Allow users to add and remove movies to their "Favorites" list by movie ID.
  • Allow users to add and remove movies to their "To Watch" list by movie ID.
  • Secure access to the API data: authentication and authorization with HTTP and JSON Web Token.

Kanban Board:

The development of this application was organized through a Kanban board. You can see the board by following this link.

Built With

Dependencies

  • bcrypt
  • body-parser
  • cors
  • dotenv
  • express
  • express-validator
  • jsonwebtoken
  • mongoose
  • morgan
  • passport
  • passport-jwt
  • passport-local

Dev Dependencies

  • eslint

Endpoints Design

# Business Logic URL HTTP Method Request Response
00 Display a welcome message to the user / GET None A text message that welcomes the user when entering the main page of the application. View example
01 Return a list of all movies to the user. /movies GET None A JSON object holding data about all the movies, containing title, genre, director, actors, releaseYear, runTime, imagePath and description. View example
02 Return data about a single movie by title to the user. /movies/:title GET None A JSON object holding data about a single movie queried, containing title, genre, director, actors, releaseYear, runTime, imagePath and description. View example
03 Return a list of the cast of a movie by title to the user. /movies/:title/cast GET None A JSON object holding data about a single movie queried, containing the list of the actors stars acting in it. View example
04 Return a list of all movie genres to the user. /genres GET None A JSON object holding data about all the movie genres, containing name and description. View example
05 Return data about a movie genre by name. /genres/:name GET None A JSON object holding data about the movie genre queried, containing name and description. View example
06 Return a list of all directors to the user. /directors GET None A JSON object holding data about all the movie directors, containing name, bio, birthYear, deathYear and movies. View example
07 Return data about a director by name. /directors/:name GET None A JSON object holding data about the movie director queried, containing name, bio, birthYear, deathYear and movies. View example
08 Return a list of all actors to the user. /actors GET None A JSON object holding data about all the movie actors, containing name, bio, birthYear, deathYear and movies. View example
09 Return data about an actor by name. /actors/:name GET None A JSON object holding data about the movie actor queried, containing name, bio, birthYear, deathYear and movies. View example
10 Allow an Admin to view all registered users in the database. /users GET None A JSON object holding data about all the users, containing name, lastName, birthday, country, email, username, password (hashed), favoriteMovies and toWatchMovies. View example
11 Allow an Admin to view a registered user in the database by username. /users/:username GET None A JSON object holding data about the user queried, containing name, lastName, birthday, country, email, username, password (hashed), favoriteMovies and toWatchMovies. View example
12 Allow new users to register. /users POST A JSON object holding data about the user to add, containing name, lastName, birthday, country, email, username, password (hashed), favoriteMovies and toWatchMovies. View example A JSON object holding data about the user that was added, containing name, lastName, birthday, country, email, username, password (hashed), favoriteMovies and toWatchMovies. View example
13 Allow users to update their data by username. /users/:username PUT A JSON object holding data about the user to update, containing name, lastName, birthday, country, email, username, password (hashed), favoriteMovies and toWatchMovies. View example A JSON object holding data about the user that was updated, containing name, lastName, birthday, country, email, username, password (hashed), favoriteMovies and toWatchMovies. View example
14 Allow existing users to deregister by username. /users/:username DELETE None A text message indicating the username of the user that was removed from the database, or a text message indicating that the username was not found in the database. View example
15 Allow users to add a movie to their "Favorites" list by movie ID. /users/:username/favorites/:movie_id POST A JSON object holding data about the movie to be added, containing the _id of the movie. View example A JSON object containing data about the updated user's "Favorites" list, containing the current IDs of the movies from the list. View example
16 Allow users to remove a movie from their "Favorites" list by movie ID. /users/:username/favorites/:movie_id DELETE None A JSON object containing data about the updated user's "Favorites" list, containing the current IDs of the movies from the list. View example
17 Allow users to add a movie to their "To Watch" list by movie ID. /users/:username/towatch/:movie_id POST A JSON object holding data about the movie to be added, containing the _id of the movie. View example A JSON object containing data about the updated user's "To Watch" list, containing the current IDs of the movies from the list. View example
18 Allow users to remove a movie from their "To Watch" list by movie ID. /users/:username/towatch/:movie_id DELETE None A JSON object containing data about the updated user's "To Watch" list, containing the current IDs of the movies from the list. View example
19 Allows a user to login to the application with their username and password (hashed), and automatically generates a JWT for the user. /login POST None A JSON object holding data about the user logged into the application, containing name, lastName, birthday, country, email, username, password (hashed), favoriteMovies and toWatchMovies. View example

Documentation

To read the API documentation, please follow this link.

Client-side

To see the Client-side of the app, please check this repository.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Francisco Gregorio de las Heras: LinkedIn

Project Link: https://myvhs.herokuapp.com/

Acknowledgements

About

Server-side web application that provides users with access to information about different movies, genres, directors and actors from the 1980s. Built with JavaScript, Node.js, Express and MongoDB.

Topics

Resources

License

Stars

Watchers

Forks