Giter Site home page Giter Site logo

backend-shopping-list's Introduction

Half-Baked Shopping List

Please read the description carefully before starting this deliverable

Demo

Link to Demo

Getting Started

Use this template to get started.

Learning Objectives

  • Add CORS middleware to allow requests from a specific domain
  • Parse authentication cookie to associate data with a specific user
  • Add authorization middleware that parses auth cookie to add row-level security to your database

Description

A backend developer quit half-way through building out a shopping list endpoint for your friend's startup. They have enlisted your help in finishing the application. Thankfully, the front-end is already built, all you need to do is finish up the missing CRUD routes and ensure that the application allows cross-origin requests from the front-end.

The front-end for this application has been built for you and can be found here -- notice that there is an input for your backend url. While testing you can set that to http://localhost:7890 and once your site is deployed, you can change it to your deployed URL. Its VERY important to check that your app works BOTH locally and on production. Cookies and CORS can act differently depending on the environment.

Acceptance Criteria

  • Backend application is able to receive requests from the demo front end (i.e. CORS is enabled)
  • All items CRUD routes implemented (you don't need a detail route - only list)
  • All items CRUD routes are limited to the authenticated user (for example at /api/v1/items/ you only see items with the same user_id as the authenticated user)
  • All existing tests are passing

Rubric

Task Points
CORS enabled for https://alchemy-shopping-front-end-demo.netlify.app/ 1
GET /api/v1/items/ lists all items for the authenticated user 2
POST /api/v1/items/ creates a new item for the authenticated user 2
PUT /api/v1/items/:id updates an item if associated with authenticated user 2
DELETE /api/v1/items/:id deletes an item if associated with authenticated user 2
PUT and DELETE routes use an authorize middleware to check authed user 1

backend-shopping-list's People

Contributors

emilysellers avatar

Watchers

 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.