Skip to content

Instantly share code, notes, and snippets.

@Pholisa-Fatyela
Forked from Gideon877/MovieApp.md
Last active June 23, 2022 12:49
Show Gist options
  • Save Pholisa-Fatyela/7ede76bf1516a23dd1a1e78d72fac5cf to your computer and use it in GitHub Desktop.
Save Pholisa-Fatyela/7ede76bf1516a23dd1a1e78d72fac5cf to your computer and use it in GitHub Desktop.
Movie API with AlpineJS

Movie App

You are a movie lover, and you need to create your our movie app and with no subscriptions.

Create a web application that can help view for all the available movies.

Your app should be able to do the following.

Your app should be able to do the following.:

  • Create a new user account
    • Login/Sign up
  • Create a movie playlist
    • Add Movie to playlist
    • Remove Movie from playlist

Login

  • User need username and password to login.
  • Password should be encrypted using bcrypt
  • If a username already exist, return an error message.
  • If a username don't exist, redirect to registration page or show error message: user doestn't exist.

Home

Playlists

  • User should be able to add a movie to a playlist (use movie id only)
  • User should be able to remove movie.
  • User should be able to view all movies in the playlist

Application directory folder:

  • create a client and server folder,
  • the client folder is a ViteJS app - deployed to Github pages
  • the server folder is an ExpressJS app - deployed to Heroku - you will need to enable cors - to ensure your client app can call the API

JSON Examples

"user":  {
      "id": 1,
      "firstName": "Pholisa",
      "lastName": "Fatyela",
      "username": "__pf__9000",
      "password": "hashedPassword",
  }

"user_playlist":  {
      "id": 1,
      "name":"watchlater", // new playlist name
      "user_id": 1,  
      "movie_list" : [224333,456677,776988],
  }

Routes

Methods Path Description
GET /signIn Login page
POST /signIn verify username and password
GET /signUp Create new account page
POST /signUp create new account for user
GET /movies/:username Home page
POST /movie/:username/add Add movie to playlist
POST /playlist/:username/:movieId Remove movie from playlist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment