Code Monkey home page Code Monkey logo

dog-liker-js-practice's Introduction

We need to build a Dog Liking website!

This website should allow people to like pictures of dogs, comment on dogs, and submit new dogs in both the front end and the back (persisting the data to the json file included).

Setup

To begin, first start your json server by running json-server --watch db.json

Once you can confirm that your server is hosting the data at http://localhost:3000/dogs, you should open up your index.html page in your browser. You can then begin to work with the index.js file to meet the deliverables.

Deliverables

  1. Import all dogs in the database so that they load into the page. The structure for each dog should look like this once it is loaded into the HTML:
    <div id='1'>
            <h2>Norma</h2>
            <p>Italian Greyhound</p>
            <img src='https://3.bp.blogspot.com/-uCd3eT8_AgA/XCZ-qnZIbXI/AAAAAAAATgQ/G8t6mwyZeIwb9OtUd2tEuasstpXsJgWlQCLcBGAs/s1600/IMG_3613l.JPG'></img>
            <p>Likes: 15</p>
            <p>Comments:</p>
            <ul>
                <li>God's perfect idiot</li>
                <li>Everyone loves her</li>
                <li>I'm literally going to steal this dog</li>
            </ul>
            <form>
                <label>Add Comment:</label>
                <input placeholder='text here' type='text' name='comment'></input>
                <input type='submit'></input>
            </form>
        </div>
  1. Allow site users to submit a comment that is persisted to the database and, once a successful response is received from the server, updates the DOM without a refresh needed

  2. Add functionality to the like button. You may handle this however you would like -- if you want to add a button for it, go for it! If you would prefer to have users click directly on the likes to increase them, that is acceptable. This should render optimistically, meaning that users can like the photo and see it on the DOM without waiting for a server response.

  3. Add functionality for a super like. For this, you should add a button that instantly adds 10 likes to that dog's database entry. You can choose if you want it to render optimistically or pessimistically.

  4. Add a form to the top of your html page which will allow users to add an entirely new dog to the database! For this particular deliverable, you are able to edit the HTML file directly in combination with adding event listeners and fetches into your javascript file handle the form submission.

dog-liker-js-practice's People

Contributors

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