EECS3311
Fall 2023
Project Description
General Functionality
“Nutrifit: Eat, Run, Smile!”
You are developing an application that helps the user to keep a journal of their diet and exercise. The user will log what they eat every day, in terms of food items and the application will determine nutrient and calory intake as well as food groups represented in the meals, based on the Canadian Nutrient File (CNF). The application aims at helping the user to break down their calory intake in food groups and monitor how well the align with the Canada Food Guide. Using the logged exercise data, the application will calculate the Basal Metabolic Rate (BMR), based on which the application can calculate the calories burnt based on various levels of exercise. Based on this, the user can find out how much weight they can lose based on their diet and exercise. The user can visualize different data over different time periods for better understanding.
Pre-development steps
1. Load a database.
The data is provided to you in several CSV files that comprise a big database. The CNF user guide contains the structure of the database. It is recommended to create a database and load the files at the start of your application. To begin with, you can use a simple MySQL database (https://www.vogella.com/tutorials/MySQLJava/article.html), but in principle your application should work with any database or even files as the backend.
2. Use JFreeChart for plotting the data
JFreeChart (https://www.jfree.org/index.html) is free Java chart library that will help you plot data. You can integrate it in your own project and not have to deal with the specifics of rendering the plots. The library supports a variety of graphs and charts including line and pie charts, bar plots, and scatter plots. In your application, you should provide the user with as many data representations (including textual and visual) as it allows for the application to remain usable. Simply, this means do not provide only a table with one visualization, if a second visualization will add something for the user. Conversely, do not show one hundred visualizations at the same time so that they are not visible to the user.
3. Food related resources
BMR Calculator: https://www.calculator.io/bmr-calculator/
BMR Calculator (code): https://github.com/pub-calculator-io/bmr-calculator
Activity Level factors: https://www.healthline.com/health/fitness-exercise/how-many-calories-do-i-burn-a-day#calorie-calculator
Total Daily Energy Expenditure (TDEE): https://www.verywellfit.com/what-is-energy-expenditure-3496103
Most of the resources you’ll need concerning diet and exercise are provided in the project section of eClass. You are encouraged to search the web for resources about losing weight, calory intake, metabolic rates and so on. It is imperative that you cite any external resources you used for information in the Software Design Document.
4. Use the Java Swing framework for the graphical user interface.
Your application needs to show multiple pieces of information at once to the user. Therefore, you may need a complex or, to put it better, modular GUI. Consider the GUI of your IDE (multiple panels with a main window at the center). Alternatively, you can split the GUI in four panels. Consider using interesting UI blocks, like tabs or collapsible panels, to improve the user experience.
Use cases
1. As a user I want to be able to create a profile in the application.
The profile should contain basic and necessary information about the user such as sex, date of birth, height, weight. It should also contain some basic settings for the application, such as units of measurement (metric vs imperial). When the application starts, I should be able to choose my profile from the splash screen. From the main UI, I should have the option to edit my profile or my settings. ATTENTION: As your data grows, the user logs may become extensive, and it will be inefficient to store profile data in files. Consider adding this information to the database. ATTENTION2: If I edit profile data or settings, while other data is present in the UI, this data should be updated accordingly. Consider using loading bars if this update takes time.
2. As a user I want to be able to log my diet data in the application.
I should be presented with a structured, but flexible UI to enter my data. I need to provide the date of the meal, whether it was breakfast, lunch, dinner, or snack. I can have as many snacks I want, but only one of each of the other meals. I need to be able to provide basic ingredients (e.g., tomatoes, bread, eggs, beef etc.) and quantities (approximate) of cooked ingredients per meal. The application should then extract the nutrient information from the database and calculate the meal’s nutritional value in terms of calories, proteins, carbs, vitamins, and others. In the journal view, only calories per meal need to appear, but I should be able to view the breakdown of all nutrients if I select a meal.
3. As a user I want to be able to log my exercise in the application.
I should be presented with a similar UI as the diet, where I can input the date and time of my exercise, the type (walking, running, biking, swimming, and others), the duration and the intensity (low, medium, high, very high). The application will then calculate the calories burnt for every exercise based on the duration, intensity, and BMR (as calculated by the profile data).
4. As a user I want to be able to visualize my calory intake and my exercise over time.
I want to select a specific time period (start date to end date) and plot my daily calory intake and my total daily energy expenditure over this period.
5. As a user I want to be able to visualize my daily nutrient intake.
In this case, I want to select a time period again, but this time I want to know the average daily portions of specific nutrients I took over this period. What percentage was proteins? What percentage was carbohydrates? I want to see the top 5 or 10 visualized and the rest labelled as “Other nutrients”. I want to see a notification or a similar visualization to inform how close I am to the recommended daily portions.
6. As a user I want to see how much weight in fat I will lose under my current diet and exercise pattern.
1kg of fat=7,700kcal
Given my exercise log and my calory intake, I want to select a date in the future and see how much fat I will lose by that date.
7. As a user I want to know how well my diet aligns with the Canada Food Guide.
CFG2007: https://publications.gc.ca/collections/Collection/H164-38-1-2007E.pdf
CFG2019: https://food-guide.canada.ca/en/
The Canada Food Guide recommends specific portions from specific food groups. The CFG from 2007 is more detailed, but it was revised in 2019 to be simpler. As a user, I want to be able to visualize my average plate (in terms of percentages of food groups represented) and see how close I am to the CFG recommendations. This can be done with a visualization of the recommended dish by the CFG.