This is a repo for NewHacks 2021 Devpost
Our team has chosen the theme "health" among three.
Aiming to help people keep track of their diet, specifically their calorie intake, we created a calorie tracker mobile app where users can input the ingredients in their meal, and the app calculates the total calorie intake.
For the nutrition values of different foods and ingredients, we used this database from canada.ca, titled Canadian Nutrient File (CNF), published in 2015. We extracted data and imported it to our database. All data is credited to the Canadian Nutrient File Team and Health Canada.
We chose to develop the app with a Python (django-rest-framework) backend, an SQLite3 database, a React-Native frontend, and deploy the app with Expo. We have chosen this approach as it is cross-platform, such the app can support both iOS and Android.
The backend made use of the django-rest-framework. It also made use of the drf-yasg package to generate a Swagger and ReDoc API documentation.
The backend is currently not hosted on any platform, as it is not by any means sophisticated. However, it will be hosted on [fill in url] during the judging period of NewHacks 2021.
There are currently 2 accounts in the database. Below are the credentials:
/ | user | administration |
---|---|---|
username | gl | admin |
password | g12345 | admin |
We chose to use React Native for the front end as it has a large community, and that it integrates well. It is also cross-platform which is a huge plus for us.
We used Expo for showing a live application while developing.
To continue developing the application, some tools are to be installed.
A developer would need some tools that are available for free on Windows, MacOS and Linus.
- Download npm and node.js
- Install and add nodejs/node_modules/npm/bin to PATH (this can be omitted)
- Clone repository and change directories to front-end
- Run
npm install -g expo-cli
to install expo build services to emulate and test the application on your mobile device or emulator - Run
npm install
to install all project dependencies - Run
expo start
to commence app deployment on localhost network - Download Expo app on your mobile device and scan the QR code to open the app on your mobile device, or run it on your emulator by choosing the corresponding option given
- Download and install Python (versions 3.7 or after)
- Change directories to nutritionCalculator-DjangoHappinessApp-Django
- Run
pip install -r requirements.txt
to install all packages used in the project - Run
python manage.py makemigrations
andpython manage.py migrate
if this is the first time running the code - Run
python manage.py runserver
to run the Django server on your local network localhost
Due to the nature of a hackathon, we were not able to implement all the features we envisioned. There are a few things that can be added in the future to further develop the application.
While most ingredients are included, there are a lot of different varients of the same ingredient. To facilitate an easier and smoother experience for users, autocompletion of the search bar is to be implemented should there are further developments to the application.
There is such functionality implemented in the backend Django API, however due to time constraint, and being unfamiliar with JavaScript, we were not able to finish implementing a front-end for such functionality. It is to be implemented if there is further development.
During the hackathon, there were bugs that were found and that we did not have sufficient time to fix, where we resorted to quick fixes for judging and demo pruposes. These bugs are to be fixed first thing if we started further developing of the app.