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
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".
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