Code Monkey home page Code Monkey logo

jr-enrichment's Introduction

Junior Enrichment

Sequelize

Write the necessary Sequelize for 2 models : Students and Teachers:

Students must have:

- a name
- a GPA 
- a teacherID for their corresponding teacher.
- a method for giving a letter grade based on their GPA (4.0 == A, 3.0 == B, 2.0 == C etc). 
- A class method for getting all students with a perfect (4.0) GPA.

Teachers must have:

 - a name 
 - a subject

Express

Write the necessary Express routes for the following db interactions:

- GET all students and return them in json
- GET all teachers and return them in json 
- GET student by ID # and return a json of that student
- GET teacher by ID # and return a json of that teacher
- GET all students for a specific teacher's ID #
- DELETE a student and return a status code of 202
- UPDATE a student's teacher and return a status code of 204

This should complete a fully working API. Don't worry about having anything pretty in the browser, we just wanna see the proper results via CURL, Postman or Chrome Dev Tools. Feel free to look at the (Express Sequelize Checkpoint Prep Workshop)[https://learn.fullstackacademy.com/workshop/554a4f402cee9103007178dd/landing] for a high-level overview of these concepts, as well as the solution code for Twitter.JS and Wikistack

Getting Started

	- npm install
	- open postgres
	- use postico or psql to add a database called 'juniorenrichment'
	- npm start (You should see a message saying your db synced and the server is listening on port 8080)

Extra Notes: How to test functionality without a frontend

  • GET: use your browser
  • POST / PUT / DELETE :
  • CLI (command line interface) with curl
    • e.g. curl -H "Content-Type: application/json" -X POST -d '{"username":"kate","password":"1234"}' http://localhost:3000/api/login
    • -H: headers. -X: verb. -d: data (must be of the type specified in headers). http://[address]:[port]/[route_path]
  • Postman
  • Databases: use Sequelize in your routes and see if you are receiving what you expect

jr-enrichment's People

Contributors

danceoval avatar bmccann36 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.