Giter Site home page Giter Site logo

food2fork-app's Introduction

Food2fork-app

This is a single page recipe application that provides over 1000000 recipes for multiple different foods within categories.The data/recipe are being fetch from food2fork public API. The user will then select the food he/she likes and the recipe view will be shown with much more details. The user will then be able to add the necessary ingredients to shopping cart.The app allows user to like the recipe and stores the like locally in the browser so he/she can later visit and find the liked recipe.

Screenshots

app1

app2

app3

Built With

  • Babel - The Javasript compiler used to execute/convert ES6 code to ES5 for browser support.
  • Webpack - JavaScript module bundler used to bundle javascript files and css files together.
  • Babel-polyfill - support browser for ES6 new features that were not present in previous specifications

Programming paradigm

Achitecture design

The project follows the MVC(Model-View-Controller ) design implemented through latest ECMA Script 6 modules features.

Library/module used

Axios -to make AJAX calls to the API by XHR request to fetch data in json,and parse the json data into javascript object.

Factional- used to generate perfect fraction no.

Uniqid- used to generate unique id/value.

ECMA script 6,7,8

The application has been programmed following the latest ES6,7,8 featurs and specifications like arrow functions, string template ,modules import/export, async-await,promises etc and thus require dependencies like babel ,webpack and babel polyfill for browser support.

Getting Started

To set up the project in your local enivironment ,first clone the repository and save it on your local environment/machine. once you've downloaded the project ,navigate to the src/js directory in the project and edit the config.js file.

To edit the config file you'll need to visit to food2fork site and register for their public API and paste your API key in the config.js

https://www.food2fork.com/about/api

NOTE -that the free account have a call limit of 50 calls/day , so depending on the no of key you're registering also edit the recipe.js and search.js file in src/js/model directory.

Edit this line by changing the index manually of ${key(2) in both search.jsand recipe.js, set it to 1,2,3,4 or more if you like as per your keys in config.js, this key function in string template gets you the API key from config.js

const res = await axios(`${proxy}http://food2fork.com/api/get?key=${key(2)}&rId=${this.rid}`);

Prerequisites

Now to build the project locally you'll need to install npm dependencies and prior to it node and npm if you don not already have it, download node from here:-

https://nodejs.org

after sucessfully installing node/npm ,navigate to the project directory and open/run terminal/bash/CLI there and execute:-

npm install

this would install all the development and built dependencies for your project and necessary npm library for this project,after sucessfull installation you would see a node_module directory in your project directory containing all the necessary module.

Now to run the app on your localhost execute:-

npm run start

This will run the app on your localhost and build the html and javascript files on the fly.(recommended).

To built the project in distribution directory execute:-

npm run dev

This would build the project in development mode, the javascript and css file would be bundled by webpack and mutated by babel to ES5 specification code.

npm run build

This would do the same thing as the prior step but the bundled file would be built in production mode and thus will have comprably small size and less irrelevant code.

Acknowledgments

food2fork-app's People

Contributors

shubhamgupta14cse avatar shubhamgupta117 avatar

Stargazers

 avatar

Watchers

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