Giter Club home page Giter Club logo

pieofthedayfinder's Introduction

Pie of the Day Finder


Author

Marielle Louise Cruz

About the Application

This Pie of the Day Finder is a simple web application built using React, and other tools and technologies which will be further described in this README. The application retrieves the following information from the two API endpoints, https://pie.now.sh/pies and https://pie.now.sh/stores:

  • name of the pie
  • price of the pie
  • quantity
  • store name
  • address
  • rating
  • contact number

Only the information regarding Pies of the Day (i.e. "isPieOfTheDay": true) are retrieved from the APIs and displayed on the web application.

(When the application is loaded for the first time, it may take a while for the API data to be retrieved.)

Home View

Features

  • Retrieves and consolidates pie and store information from two API endpoints
  • Displays Pie of the Day information via expandable and collapsible UI cards
  • Paginates the filtered pies list using pagination controls, based on a 5 pies per page limit
  • Enables non-case sensitive searching of pie names via a dynamic search bar

Technology Stack

  • React for building the UI and managing the presentation logic of the application
  • Create React App for providing a modern build setup for React
  • Axios for making HTTP GET requests to the API
  • Material UI for implementing Google's Material Design on some application components
  • Babel for compiling ES2015+ down to ES5 compatible code
  • WebPack for bundling code down to a single file and enabling hot module reloading
  • Jest + Enzyme for testing
  • Heroku for running a live version of the application in the cloud
  • Git for tracking changes in the source code
  • VSCode, code editor used to build the application

Searching and Pagination

The entire searching logic was done within the application itself, as the base API, https://pie.now.sh, does not support searching. An alternative approach to this is to create a db.json file, use a JSON server, and immediately filter search results using an AJAX call to the server.

Similarly, pagination logic was also completely done within the application, without the help of an API. The base API (https://pie.now.sh/pies?_page=1&_limit=5) supports pagination; however, the API's pagination functionality does not work with this application's requirement —which is to only include items where "isPieOfTheDay" is true.

Testing

A few simple tests were created for two of the components within the React application. Jest was used for running tests, and Enzyme was used for providing testing utility functions (e.g. shallow) for components. Further tests may likewise be designed for other components.

Further Improvements

In terms of application functionality, a sorting feature may be added in order to enable the sorting of pie prices in ascending or descending order.

Regarding the structure of the application itself, Redux may be used to manage state more effectively. React Hooks may also be utilised if function-based components —as opposed to class-based components —are desired.

View the Live Site

(Best viewed on desktop via Google Chrome)


Site Images

Home View

Default List

Pagination

Search Results


Available Scripts

If you want to run this application locally, you may use the following:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

npm test

Launches the test runner in the interactive watch mode.

pieofthedayfinder's People

Contributors

marielleloui avatar

Watchers

James Cloos 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.