Skip to content

Single Page for Applications (SPA) + REST API for Fruit Nutrition

License

Notifications You must be signed in to change notification settings

Taner940706/FruityNutrition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FruityNutrition

Single Page for Applications (SPA) + RESTful API for Fruit Nutrition. It supports the following operations:

  • List all fruit: fruit/all
  • View single fruit (by id): /details/:id
  • Search by fruit name: fruit/:keyword
  • Search by fruit genus fruit/genus/:keyword
  • Search by fruit family: fruit/family/:keyword
  • Search by fruit order: fruit/order/:keyword
  • Search by fruit Add a new fruit: /create

App Details

The app is based on Node.js + lit-HTML + Page.js + CSS + Bootstrap. Note: To fix CORS issue please visit https://cors-anywhere.herokuapp.com and click button ,,Request temporary access to the demo server".

RESTful API

The app use two APIs:

https://www.fruityvice.com - get all information about fruit details and nutritions:

  • GET /api/fruit/:name - Get Fruits available in the database in a list form.
  • GET /api/fruit/all - Get all Fruits available in the database in a list form.
  • GET /api/fruit/family/:family - Get all Fruits available in the database in a list form which belong to a given family.
  • GET /api/fruit/genus/:genus - Get all Fruits available in the database in a list form which belong to a given genus.
  • GET /api/fruit/order/:order - Get all Fruits available in the database in a list form which belong to a given order.
  • PUT /api/fruit - {"genus": "Fragaria","name": "Strawberry","family": "Rosaceae","order": "Rosales","nutritions": {"carbohydrates": 5.5,"protein": 0,"fat": 0.4,"calories": 29,"sugar": 5.4}}

https://imsea.herokuapp.com/api/1?q= - get picture for searched fruit

  • GET /api/1?q=:keyword

Screenshots

  • Main menu main_menu
  • Create fruit create
  • Create fruit issue ,,All field are required!" create_issue
  • Search all fruit search_main_all
  • Search by name search_by_name
  • Search by order search_by_order
  • Search by family search_by_family
  • Search by genus: search_by_genus
  • Details details
  • About about

About

Single Page for Applications (SPA) + REST API for Fruit Nutrition

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published