possible not only to obtain the data, but also to
manage the information and use it to make final
decisions about which foods to eat and what motor
tasks to perform.
In order to operationalize this system and allow it
to go into production, a frontend was developed,
represented by a Web application, specifically a
WebApp, supported by a responsive single-page
application (SPA). This feature allows access to both
a desktop computer and a laptop, as well as mobile
devices such as tablets and mobile phones. The
WebApp uses Ajax technology, combined with the
jQuery JavaScript library, the PHP programming
language, the SQL language, to query the database
and objects in JSON format, for interoperability
between the database and the HTML markup
language.
The system also includes a backend component,
for the corresponding management and
administration. The implementation of this
component was made using a proprietary framework,
supported by a Model-View-Controller (MVC)
pattern, which was assigned the name Agon and
where the entire system is parameterized. To support
the two components of the system, a MySQL
database was created where all foods were inserted,
as well as physical and sport activities, in the
respective data model tables, defined for this purpose.
Bearing in mind that the system is intended to
reach the largest number of users, it offers the
possibility to use both Portuguese and English
languages, depending on the user preference.
Currently, the system does not yet allow several
meals per multiple days to be saved. In the future it
will be necessary to create a feature to register users
and allow them to access their reserved areas. At this
point, we expect the users to be able to keep a record
of the energy supply, as well as the caloric
expenditure and therefore monitor the respective
evolution, during the intervals of time they consider
necessary. To make the system even more
international and global, more languages are expected
to be included further on.
2 METHODOLOGY
2.1 Variables
To calculate the caloric intake, the nutritional
information of each food was used, as defined in the
table of food composition, according to the EU,
Regulation N.º 1669/2011. For each 100 g or 100 ml,
this table characterizes food using, all together 40
constituent elements, including the energy value
expressed in terms of calories.
For the calculation of energy expenditure, we are
using the codes and metabolic units (MET) indicated
by Ainsworth, Haskell, Herrmann, Meckes, Bassett,
Tudor-Locke, et al (2011), as established for motor,
physical and sports activities. For a personalized
energy expenditure, the authors also refer the need to
take into account not only body mass (BM), but also
the total duration (TD) of the activity in minutes.
2.2 Processing of Food Data
Processing of food data. Through the WebApp
frontend component, each user can choose the foods
ingested or to be ingested, from a total of one
thousand and one hundred and forty-six (1146)
possible foods, previously saved in a MySQL
database.
For this, the user must press the button to add the
food and following that a form will appear, as a
modal. Then the user must enter in the search field at
least the two initial characters of the desired food.
When executing this operation, the system triggers
the well-known typeahead functionality, showing in
the next field of the form, a list, with all the food
options registered in the database that begins with the
characters typed or that are being typed. For this to
happen in real time, the WebApp uses Ajax
technology, combined with the jQuery JavaScript
library, the PHP programming language, the SQL
language, to query the database, and objects in JSON
format, to exchange the data between the database
and the HTML markup language. From the presented
list of foods, the user selects only one.
The following field is numerical and is intended
to be filled by the user with the amount consumed of
the previously selected food.
The final field must be filled with the type of
measurement unit used in the previous field. Here, the
user has the possibility to choose between grams,
kilograms, liters, deciliters and milliliters, by
selecting the corresponding radio button.
To register the data associated with the selected
food, the user must submit the form by pressing the
'add' button and thus sending the data to the database.
With this operation, a food is added to the database
table associated with the user.
After submitting the form, a data table is
presented on the same screen, with the associated
records of the submitted data and also with the energy
value of the chosen food, calculated accordingly to
the amount eaten and presented in the form of
calories.