yBlackBox
logo



Project Overview



Objective

To build the server-side component of a “movies” web application. An API that allows for queries to the movie database so that the user can interact with the client-side component by receiving, updating, and data.


Planning



User Stories

  • As a user, I want to be able to receive information on movies, directors, and genres so that I can learn more about movies I’ve watched or am interested in.
  • As a user, I want to be able to receive information on movies, directors, and genres so that I can learn more about movies I’ve watched or am interested in.



Development



Technologies Used

  • REST API:
    • uses HTTP requests to receive, send, create, and delete data or files.
    • Node.js
      • runtime environment for executing JavaScript without a browser
      • npm: default node package manager
      • Modules:
        • HTTP: to create a web server
        • URL: splits up a web address into readable parts
        • File System: managing file input and output
      • Express.js: server side framework, simplifies Node.js syntax
      • Morgan: logging middleware, to log the request URL to the terminal
  • MongoDB
    • A non relational database (NoSQL) was implemented. As these don't have predefined schemas or enforced "relationships" between the different types of dat they store, they are simpler to create and alter. They also offer more flexibilty.
  • Mongoose
    • Enforces uniformity in the data on the application-side. It acts as a translation service between the database layer and the rest of the application.
  • Postman: used to test the URL endpoints of the API
  • Authentication
    • HTTP
      • used as the initial authentification when users make a login request
    • JWT
      • A JWT token is generated for the user after login. Only users with a token can make requests on the website.
    • Passport: an authentication middleware
  • Encryption
    • bcrypt: a node.js module to hash passwords
  • HTML
  • CSS / React Bootstrap
  • JSON
  • Heroku: used for hosting services



Challenges:



  • I had used reference tables for some components such as actors and genres, which was not specified in the CareerFoundry lesson.
    • To build the endpoints for these components I had to research online how to get the data returned when making a HTTP request. I used the keyword populate to get the data from the reference table. Then I used a filter function to filter out the movies with the searched for keyword