raulfdm / Taco Api
Programming Languages
Labels
Projects that are alternatives of or similar to Taco Api
TACO API
Brazilian Table of Food Composition (TACO) consumer library
Project TACO
TACO is an initiative between Nucleus of Studies and Research in Food (NEPA) of UNICAMP with a funding from brazilian Ministry of Health (MS) and Ministry of Social Development and Fight against Hunger (MDS) to provide data of a large number of nutrients in national and regional foods obtained through representative sampling and analysis carried out by laboratories with analytical competence proven by interlaboratory studies, according to international criteria.
Getting started
Docker
If you use Docker, instead running this project locally you can simply run Taco API image:
docker pull raulfdm/taco-api
Then, run your container:
docker run -it --rm --name taco -p 4000:4000 raulfdm/taco-api
After that, you can check the API documentation at http://localhost:4000
.
Running locally
To run locally, clone this project:
git clone https://github.com/raulfdm/taco-api.git
Then, install all dependencies and run npm start:
cd taco-api
npm install
npm start
After that, you can check the API documentation at http://localhost:4000
.
If you want to use docker and run instead, you can use docker-compose:
docker-compose up
About this project
The main goal of this project was to take the data from original research and provide as API using modern development techniques.
Actually the original project have only 2 possible ways to consult the data:
- By PDF file. In that case, you have to find the food you want and be sure your looking the correct value;
- By tabulated xls. The researchers have created the XLS to be an database, however, they tabulated it and made nice to print, not to filter or to extract. Also there's 3 different sheet containing specific data for the same food.
The way they've chosen can work if you want to do a quick consult, however, if you want to build an application with this data, you have to format it to make it easy to use and that's this project about: better format.
Step-by-step
The following steps describe the whole workflow I did to build this project:
- Extract the original xls, cleaning unnecessary styles, columns and rows;
- Repeat the above step for each sheet;
- Merge all 3 sheets into one;
- Generate a CSV (Comma-separated values) and export it to a JSON format;
- Create another JSON file containing all
categories
and then create a relation between FOOD - Category; - Create 2 end-points
food
andcategory
to get this data
API Documentation
You can consult the API documentation at: https://taco-food-api.herokuapp.com
Official Research
In order to keep the original research as source of truth
of this project, I've saved all available files (got from NEPA website). You can consult them in references folder.
Stack
- NodeJS - as server side
- ExpressJS - as HTTP framework
- Heroku - as cloud platform
- apidocs - as API documentation generator
Want to say something?
If you have any question, suggestion or something, please feel free to open an issue. I'll be happy to answer it! :)
Legal Information
This is a non-profit project.
All data provided on this project was researched and produced by UNICAMP, therefore all copyright are reserved to them.