Giter VIP home page Giter VIP logo

recipe-search-app's Introduction

The Frontend Challenge: Add features to a Recipe Search App

To get you started we have the basic structure for a recipe catalog web app already completed for you to build upon.

After setting up your environment, use yarn start to build and run the projects, and open localhost:4200 in your browser. You should see a page with a list of recipes!

What the recipe search app looks like

About this repository

This repository was bootstrapped using Nx (a typescript monorepo framework). It's not critical that you are familiar with Nx, but it wouldn't hurt to spend a few minutes reading the getting started intro to familiarize yourself with the toolset.

The frontend uses React, typescript, and has the Material-UI library already integrated. The Edamam Recipe API (v2) is connected and supports all of the additional features that we need.

The challenge

Your challenge is to complete both new features listed below.

Add the ability to search by a phrase and another facet of your choice

Allow the user to enter a search phrase, and use that string to filter the results from the API. This should just be a standard text input, nothing too fancy. The API supports a q parameter to implement this filter. We've hard-coded the phrase "kale salad" to get you started.

The API supports a variety of other filters, like dishType and calories. Allow the user to specify a filter value and use their selection to filter the results from the API. Most of these are enums or numerical ranges, so be creative about how you present this to the user. There are multiple ways to implement this from a UX perspective... a list of checkboxes, or a multi-select box, or even tags if you're feeling ambitious!

Add the ability to navigate between pages of results

Allow the user to navigate between multiple pages of results. Right now we are only fetching the first page of results from the API. The API returns a limited number of items per page and includes a _links.next.href property in the response to help fetch subsequent pages of results. You could use discrete buttons for previous and next, or you could try something more complicated like pagination.

Some tasks to get you started

  • Add an input to accept a search term
  • Connect the input to component state
  • Implement a side-effect that fetches api results when state changes
  • Add an input to accept another facet
  • Connect the input to component state
  • Refactor the side-effect to include the new facet in the api call
  • Debounce the inputs
  • Add next page buttons
  • Connect the buttons to callbacks that replace the api url with self.href or next.hef from the api response
  • Make a list of tasks that we need to do to improve architecture and code quality

Bonus tasks

  • Add previous page buttons
  • Implement skeleton for loading status (assets/sk.png)
  • Implement UI like (assets/demo.gif) (assets/another.gif) (assets/sug.png)

When you finish

  • Ensure all changes are commited
  • Push your branch up to github
  • Open a pull request
  • Let us know you've finished

Setting up your environment

This app requires NodeJS 16.13.10 (not the latest version). If you don't already have node installed, or need to pin to a specific version, we recommend using nvm.

NVM Install on Windows (using powershell)

# Install the scoop package manager
iwr -useb get.scoop.sh | iex
scoop install git 7zip # Scoop requires git and 7zip to update itself and extract packages

# Install and use NVM
scoop install nodejs nvm
nvm install 16.13.0
nvm use 16.13.0

NVM Install on MacOS

brew install nvm
nvm install 16.13.0
nvm use 16.13.0

It can also be helpful to have the Nx cli tools installed globally via npm install -g nx

  • Clone this repo
  • Create a branch for your changes
  • Run yarn to initialize the project
  • Run yarn nx test to ensure the existing test suite passes
  • Run yarn nx serve recipe-search to see the web app in action
  • Start adding features!

recipe-search-app's People

Contributors

spostad7 avatar abramsimon 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.