Git Product home page Git Product logo

pursuit-core-web-react-routing-lab-tested's Introduction

Pursuit-Core-Web-React-Routing-Lab

Pursuit Logo

Today, we are creating a full-fledged app to fulfill all of your pet-image-searching desires: both cats and dogs.

  • Use the Cat API for your cat-fetching needs. ๐Ÿฑ
  • Use the Dog API for your dog-fetching needs. ๐Ÿถ
Tips: Using the APIs

Cat API

  • You may see some instructions in the docs about getting an API key. You don't need it to do this lab. You can ignore that.
  • Check the Quickstart to find the URL to use to load one random cat image.
  • The documentation here says to add ?limit=3 to the URL to show 3 random images.

Dog API

  • The documentation here shows you how to request a random dog picture or a specific number of random dog images.
  • Scroll down this page to see how to request a random image of a specific dog breed.
  • Notice that the Dog API responses have a different structure than the Cat API responses!

This app will have routes.

Getting Started

  • Fork this repo
  • Clone the forked repository
  • cd to the directory where you cloned it
  • npm install to install dependencies
  • npm start to start your React application
  • npm run cypress (in a separate terminal window) to open the cypress testing window

Note: Remember to git add, git commit and git push regularly

Route Structure and How This App Is Different

For the most part we have been centralizing state (usually in App) and passing it down to child components via props. That's good! However, this app is a little different.

We are making the conscious decision that we don't want to centralize state. Instead of one big app, our app is going to be more like a collection of smaller apps inside different routes.

These apps (components) will be:

  • Random dog image /dog/random: Load a random dog image. Include a button that loads a new random image when clicked.
  • Multiple random dogs /dog/random/:num: This will render the number of random dog images requested for in the num URL parameter using a single API call to the dog API. No button required.
  • Random dog by breed /dog/:breed: This will render a dog image of the specified breed. No button required.
  • Random cat image /cat/random. Load a random cat image. Include a button that loads a new random image when clicked.
  • Multiple random cats /cat/random/:num: This will render the number of random cat images requested for in the num URL parameter using a single API call to the cat API. No button required.

Bonus

  • Random amounts of both cats and dogs /all/random. Load a random number between 1 and 10 for both cats AND dogs (e.g 4 cats and 7 dogs), and uses one API call for each of the two APIs to load that many images.

Routing lab demo

Submission Guidelines

  • When finished, commit and push your work.
  • Make a pull request on github.
  • Submit the link to your pull request on Canvas.

pursuit-core-web-react-routing-lab-tested's People

Contributors

mikeboyle avatar bedonjonathan avatar joshuakgoldberg 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.