Git Product home page Git Product logo

fruit-api-7's Introduction

Fruits API

This repository is meant to be a practice assessment for Mod 3 BE.

Skills:

  • API Consumption
  • Feature testing for API data using Webmock and fixture data (and/or VCR)
  • Refactoring into facade/service patterns, and optional PORO

Setup

Requires Ruby 3.2.2 and Rails 7.1.2

  1. Fork/clone this repository. Set up the repo as normal
  2. Run the usual setup steps (bundle install, rails db:create)

Challenge

  1. Review the FruityVice API - this is a free service with no API Key requirement.
    1. Make some test calls in Postman and/or your browser to get a feel for how it works.
  2. When ready, complete the user story below.

NOTE: This application comes with a pre-built form at the "welcome#index" action and view. Do not change the path for this form, rather make the pre-existing form work alongside the user story below.

User Story 1 - Basic Search

As a user,
When I visit the root path ("/"),
I see a form with a search box for fruit and a button.
When I enter the name of a fruit and click "Search"
I am taken to the "/foods" page
And I see information about that fruit, including
 - name
 - family
 - order
 - genus
 - nutrition value, organized as:
   "Calories: x
   Fat: x
   Sugar: x
   Carbohydrates: x
   Protein: x
   "

User Story 2 - Nutritional Value

As a user,
When I am on a search result page "/fruits"
after making a successful search,
I see a link that says "Find Similar Fruits by Nutrition Value"
When I click this link
I am taken to a "/fruits/nutritional" page
Where I see the names of fruits that have a similar nutritional value

# Hint: choose a specific nutritional key (e.g. "calories" or "fat" or "sugar"), and use the min/max API endpoints

User Story 3 - Clickable Names

As a user,
When I use the Nutritional Value search
and I see the names of fruits that have similar nutritional value,
I can click on the names of each fruit
and I am taken to the "/fruits" page
where I see that specific fruit's information similar to the original search:
 - name
 - family
 - order
 - genus
 - nutrition value, organized as:
   "Calories: x
   Fat: x
   Sugar: x
   Carbohydrates: x
   Protein: x
   "

fruit-api-7's People

Contributors

cjsim89 avatar garrettgregor 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.