Code Monkey home page Code Monkey logo

phase-1-mock-cc-ramen-rater's Introduction

Phase 1 Mock Code Challenge: Ramen Rater

Learning Goals

  • Access information from an API using a GET request and use it to update the DOM
  • Listen for user events and update the DOM in response

Introduction

Today you'll be building an app for rating ramen. You will be using a local API and building out the frontend for our app.

Demo

Use this gif as an example of how the app should work.

demo

Setup

  • Run json-server --watch db.json to get the backend started
  • Open the index.html file on your browser
  • Write your code in the index.js file

Endpoints

Your base URL for your API will be: http://localhost:3000

The endpoints you may need are:

  • GET /ramens
  • GET /ramens/:id

Feel free to add any additional classes or ids to any elements in the HTML file as you see fit.

Core Deliverables

As a user, I can:

  • See all ramen images in the div with the id of ramen-menu. When the page loads, request the data from the server to get all the ramen objects. Then, display the image for each of the ramen using an img tag inside the #ramen-menu div.
  • Click on an image from the #ramen-menu div and see all the info about that ramen displayed inside the #ramen-detail div and where it says insert comment here and insert rating here.
  • Create a new ramen after submitting the new-ramen form. The new ramen should be added to the#ramen-menu div. The new ramen does not need to persist; in other words, if you refresh the page, it's okay that the new ramen is no longer on the page.

Advanced Deliverables

These deliverables are not required to pass the code challenge, but if you have the extra time, or even after the code challenge, they are a great way to stretch your skills.

Note: If you are going to attempt these advanced deliverables, please be sure to have a working commit with all the Core Deliverables first!

As a user, I can:

  • See the details for the first ramen as soon as the page loads (without clicking on an image)
  • Update the rating and comment for a ramen by submitting a form. Changes should be reflected on the frontend. No need to persist. You can add this HTML to the index.html file to create the edit form:
<form id="edit-ramen">
  <h4>Update the Featured Ramen</h4>
  <label for="rating">Rating: </label>
  <input type="number" name="rating" id="new-rating" />
  <label for="new-comment">Comment: </label>
  <textarea name="new-comment" id="new-comment"></textarea>
  <input type="submit" value="Update" />
</form>
  • Delete a ramen (you can add a "delete" button if you'd like, or use an existing element to handle the delete action). The ramen should be removed from the ramen-menu div, and should not be displayed in the ramen-detail div. No need to persist.

Extra Advanced Deliverables

You'll need these endpoints for the advanced deliverables:

  • POST /ramens
  • DELETE /ramens/:id
  • PATCH /ramens/:id

As a user, I can:

  • persist my updates to a ramen's rating and comment. (PATCH request)
  • persist new ramens that I create (POST request)
  • persist any ramen deletions (DELETE request)

phase-1-mock-cc-ramen-rater's People

Contributors

brendamichelle avatar codyjgreen avatar ihollander avatar jlboba avatar lizbur10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

phase-1-mock-cc-ramen-rater's Issues

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.