Coder Social home page Coder Social logo

phase-1-mock-cc-flatburger's Introduction

Phase 1 Mock Code Challenge: Flatburger

Flatiron's Burger Restaurant is open for business! You will be using a local API and building out the frontend for our app, Flatburger.

To view in VSCode, right click on the README.md file and select "Open Preview".

Demo

Use this image as an example of how the app should look once it is complete.

Finished Product

Setup

Run this command to get the backend started:

json-server --watch db.json

Test your server by visiting this route in the browser:

http://localhost:3000/burgers

Then, open the index.html file on your browser to run the application.

Write your code in the src/index.js file. The base URL for your API will be http://localhost:3000.

Deliverables

As a user, I can:

  1. See all of the burger names in a div with the id of restaurant-menu. Create a span tag with the name of the burger and add it to the div#restaurant-menu once you have retrieved the burger data from the server. You will need to make a GET request to the following endpoint to retrieve the burger data:

    GET /burgers
    
    Example response:
    [
       {
         "id": 1,
         "name": "Flatburger",
         "image": "./assets/food/flatburger.jpeg",
         "number_in_cart": 0
       },
       {
         "id": 2,
         "name": "Maple Bacon Burger",
         "image": "./assets/food/maple-bacon-burger.jpeg",
         "number_in_cart": 0
       }
    ]
  2. When the burger in the div#restaurant-menu is clicked, display the burger's details in the div#food-detail.

  3. When the form#add-to-cart-form is submitted, add the value from the input field to the burger displayed in the div#food-detail. No persistence is needed. The number in cart should be cumulative. For example, if a burger currently has 7 for the number in cart, and a user add another 7 to the number in cart via the form, the number in cart displayed for the burger should increase to 14.

phase-1-mock-cc-flatburger's People

Contributors

rikkux491 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.