Skip to content

mv-swe-fiserv-us-classroom-movie-theater-api-project-movieTheaterAPIStarter created by GitHub Classroom

Notifications You must be signed in to change notification settings

MAR-Clover/movie-theater-api-project-MAR-Clover

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

Movie Theater API

TASK: You are a Software Engineer for a movie theater company, and your team is tasked with creating an API that can work with and serve data on our database through an application server. We will be testing our API endpoints using Postman, so no UI code is needed for now.

Your main task is creating the API! We will be working with Express to create Routers for Users and Shows. We have a seed file that contains a list of users and shows to add to the database. We will need to include that seed file in our main server. While we don’t have a front-end, we will be using Postman to interact with our API.

We’ll have 2 Express Routers:

  • Users
  • Shows

Specifications

User story

As a user, I want to keep track of the shows I have watched, so that I can satisfy my urge to list things

Install Dependencies

  • Install the following npm packages:
    • sqlite3
    • sequelize
    • express
    • express-validator
    • nodemon

Once everything is installed, you can run npm run seed to reset and fill your database with initial seed data. You can run this command at any time to reset the database to the initial seed data.

Create Express Server

  • Create a file for your server and initialize it on port 3000 using Express.

Define Routes

Create the route handlers for the project, per these definitions:

Users

  • GET all users
  • GET one user
  • GET all shows watched by a user (user id in req.params)
  • PUT associate a user with a show they have watched

Shows

  • GET all shows
  • GET one show
  • GET all users who watched a show
  • PUT update the available property of a show
  • DELETE a show
  • GET shows of a particular genre (genre in req.query)

Make sure to include your routers in a directory named routes

Tests

  • Test your endpoints using Postman

Commit & Push

  • git add ., git commit -m “somemessage” and git push so we can see your work.

Server Side Validation

Updating Show Status

Use server-side validation in your routes to ensure that:

  • The title of a show must be a maximum of 25 characters
  • The username must be an email address hint

About

mv-swe-fiserv-us-classroom-movie-theater-api-project-movieTheaterAPIStarter created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%