A web application for Purdue Students that seamlessly combines exercise and nutrition tracking while offering intelligent, personalized suggestions to guide users' health and fitness journeys 🍎🏋️.
Specialized dining court integration features are included for students @ Purdue.
If you are interested in contributing, reach out to This project has currently been paused. If you are interested in extending it, you will need to:[email protected]
.
- Fork the repo
- Set up your own MongoDB Atlas database instance
- Fill in the required fields in the
./backend/.env
file (see ./backend/.env.example for the required fields).
To clone the repository onto your local machine, run git clone https://github.com/youngbryanyu/titan-health-app.git
in the directory you want the repository to be cloned into.
We used yarn as the package manager for our application. Install yarn by running npm install yarn
. We will be managing the versions of node modules separately for front and backend. Next, navigate to both the /backend
and /frontend
directories run yarn
in both to install all the necessary node module dependencies. If you accidentally ran yarn
in the root directory instead of in the /backend
and /frontend
directories, delete the /node_modules
directory and yarn.lock
files and make sure to run yarn
in the proper directories.
The environment variables for the backend server will need to be configured before running the application. See the Environment Variables for the Backend Server section for steps on setting up the .env
file for environment variables.
Navigate to the /backend
directory. Before starting the server, run yarn
to update existing node modules or install any missing node module dependencies. Then run yarn start
to start the backend server.
Navigate to the /frontend
directory. Before starting the server, run yarn
to update existing node modules or install any missing node module dependencies. Then run yarn start
to start the backend server. The default IP address and port number set by the application is http://localhost:3000/
.
For more details on how to use yarn as a package manager, see the yarn CLI documentation.
To install a new dependency required, navigate to either the frontend or backend directory, then run yarn add <module_name>
to install the new module in its desired location. Use the --dev
flag to add a dev dependency instead of a dependency. Make sure to not install dependencies in the project root directory, but rather in either the /frontend
or /backend
directories. If you accidentally ran installed a dependency in the root directory instead of in the /backend
and /frontend
directories, delete the /node_modules
directory and yarn.lock files and make sure to run yarn add ...
in the proper directory.
Before pushing any changes and making a pull request, run the following:
git config --global push.default current
: This will allow you to automatically push changes on your local branch to a remote branch of the same name usinggit push
orgit push -u
. See this stack overflow post for more details if interested. Just make sure that if you are using this feature instead of specifying the remote branch, that there isn't already a remote branch with the same name or else there could be unintended conflicts.git config --global pull.rebase true
: This will set git to default rebase when pulling.
Next, just run the following:
git pull
to pull in any changes before committing. If the pull pull and rebase fails due to conflicting local changes rungit stash
, thengit pull
, thengit stash pop
. Fix any conflicts and commit when finished.git commit -m <message>
to commit your changes.git push
to push the changes to the remote branch that will be created by default based on the config set above.- Navigate to Pull requests to create the pull request onto the
main
branch. Get the necessary approvals then merge and delete the branch.
Make sure not to push anything from node_modules
when committing and pushing changes. We don't want tons of dependencies stored in our repository.
The follow requirements must be met before pushing changes onto the main
branch:
- Must be an invited contributor to the repository
- Must have 1 approval from another contributor
- Must have 1 approval from the repository owner (youngbryanyu)
You may need to set up a personal access token for authentication due to GitHub's newer security guidelines. See this documentation for how to do so (create a classic token), or follow the steps below:
- Go to the Tokens (classic) in Developer settings.
- Click on Generate new token, then Generate new token (classic).
- Give the token a name, set the desired expiration, and check every check box for maximum permission access, then at the bottom click Generate token.
- Save the access token somewhere safe and local since you will need it to authenticate.
Next time if you are prompted for your username and password when pushing, use your access token as the password. If you don't want to retype your credentials every time, run git config credential.helper store
before you run git push
, and once you enter your credentials, they will be stored locally (unencrypted) so you don't have to re-enter them repeatedly.
We have set up a MongoDB cluster though MongoDB Atlas, hosted on AWS. Follow the below steps to make sure you are setup for development. The necessary credentials are contained in the credentials document which is private (must request access).
⚠️ See /backend/.env.example for the required environment variables that you will need to setup to run your own instance of the backend. You will need to create your own MongoDB instance and make up your own encryption key. You will need to set up your own MongoDB atlas instance and configure the steps below.
- Navigate to cloud.mongodb.com and log into the Titan Health App account using the credentials in the credentials document. Select the Titan Health App organization and project.
- Under the
SECURITY
section on the left, go toQuickstart
, and scroll down toAdd entries to your IP Access List
. Simply clickAdd My Current IP Address
, and your device's IP will be granted access to the Database cluster (you may need to repeat this step if you're IP address is dynamically assigned and changes, or you're on a different network). You can also add your IP in to the access list in theNetwork Access
section but it's easier to do it throughQuickstart
.
Note: currently we have enabled allowing all IP addresses to access the database cluster.
There already exists two users that each assume 1 default role. They're set up to be authenticated simply through credentials which are contained in the credentials document.
- ReadWriteUser - has read and write access to the database cluster. (Stick with this user for development)
- AdminUser - has full administrator access to the database cluster.
The URI and credentials to connect to the database cluster are contained in the credentials document. For ease of visualizing the data while working with it, we recommend downloading MongoDB Compass and connecting through Compass to visualize the databases and collections during development.
The collections of data relevant to the application will all be stored under the TitanHealthApp
database within the database cluster.
Like mentioned earlier in the section about how to run the application locally, the environment variables will need to be set up in the .env
file. The file .env.example
under /backend
is provided as a template for the .env
environment variables file. .env
will need to be populated with necessary keys and credentials, and is kept empty on the repository because it contains confidential keys and credentials. See this document for the .env file we are using to run and test our application locally (file is private and must request access).
Do not push changes in .env
to any remote branch. If you add a new environment variable simply add it to the .env.example
template file with a temporary value. To prevent accidental pushes of the .env
file, I recommend running git update-index --assume-unchanged **/backend/.env
, which tells git to ignore changes in . More about this is in this stackoverflow post.
- Health trackers have some issues when rendering the graphs and entering new entries.
- Improve UI and visual experience for users.
- Create more comprehensive recommendation system
- Create more useful health and fitness features, as most features are skewed towards nutrition currently.
- Improve robustness and user input validation of application on some pages.
Below are screenshots of some of the pages within our site as a preview! Note that many of the pages in the site our not shown (such as the fitness and health tracker related pages), and these are just a showcase of some of the UI.
![Meal Tracker Page](https://private-user-images.githubusercontent.com/32204448/287885768-36d84a49-e2f5-46e2-8335-d17a3368ae4a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU0MTc4NTYsIm5iZiI6MTcyNTQxNzU1NiwicGF0aCI6Ii8zMjIwNDQ0OC8yODc4ODU3NjgtMzZkODRhNDktZTJmNS00NmUyLTgzMzUtZDE3YTMzNjhhZTRhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA0VDAyMzkxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNjMWZiNDRkYWRhNDUxMjkxYTU5ZGNkNmVhOGIxNGViNGUyYmFlZjA2NmZjMDZlZDkyODVjMzkyNWNlMTkzNmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Z1rTJzpD6hg86S8aOfraKcCycw578Djxw0XCe52uvw0)
![Dining Court Menu Page](https://private-user-images.githubusercontent.com/32204448/286769344-74240620-74b1-4fcd-adc4-c5a19600cabb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU0MTc4NTYsIm5iZiI6MTcyNTQxNzU1NiwicGF0aCI6Ii8zMjIwNDQ0OC8yODY3NjkzNDQtNzQyNDA2MjAtNzRiMS00ZmNkLWFkYzQtYzVhMTk2MDBjYWJiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA0VDAyMzkxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBhOTEyZmZlOTNlNjJiZmU3OWM0OTIxNjhlZTk4YjBlYTY5N2Y5NmY1YTlhZmU1ZTcwZWQzZmQwZDY4NDY4YzMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.c0iyAqjIyA_rD2a0VAKJ4i0QpZ14fcgYKrVQg6EKraE)
![Dining Court Menu Item Page](https://private-user-images.githubusercontent.com/32204448/286769621-db37c535-321d-45ad-9184-a826891c2ad0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU0MTc4NTYsIm5iZiI6MTcyNTQxNzU1NiwicGF0aCI6Ii8zMjIwNDQ0OC8yODY3Njk2MjEtZGIzN2M1MzUtMzIxZC00NWFkLTkxODQtYTgyNjg5MWMyYWQwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA0VDAyMzkxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY0ZDA0ZWM2MzNlNTJkMjZmYjM0N2U2YmY0NjFlOGQ2ZDQ4ZmNjOTBlYzlhYmY2YTU0M2E0MWFhOGY5YTllYzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.FQ30A2OK0q6YkGub67JHy2jAUG_b9x3KYU5A1s00Uc4)
![Dietary Preferences Page](https://private-user-images.githubusercontent.com/32204448/286769752-eb6b4734-ea34-439f-a916-22af63b3c6f9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU0MTc4NTYsIm5iZiI6MTcyNTQxNzU1NiwicGF0aCI6Ii8zMjIwNDQ0OC8y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U2lnbmF0dXJlPTQ5YWZlMGMzYzA1YjFmNTc5M2I2NTIzMzJmNThiNzg3YjI1MDlhYjliOWU3MTJiMWI1ZTQyNWI5OGEwMmFjYzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.TKTrc4qUfad1YXq55j7Fbq-3sP_4CWLQjI6d03tal_Q)
![Recommended Menu Items Page](https://private-user-images.githubusercontent.com/32204448/287886409-a8a60670-9556-4f23-b542-3ed41d047baa.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU0MTc4NTYsIm5iZiI6MTcyNTQxNzU1NiwicGF0aCI6Ii8zMjIwNDQ0OC8yODc4ODY0MDktYThhNjA2NzAtOTU1Ni00ZjIzLWI1NDItM2VkNDFkMDQ3YmFhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA0VDAyMzkxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE5NzAxNjU0YzVlN2FjMjVkMzA4NjBmNjkzYTFiZDNkMDVkYzhjYzg2ZTk1MzUxZWE4MmUxMDQ1ZWZhZDk0M2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.XnXehk53H2YIq08ta6YiLcDiLoAZK8SI6Tp46iUmrkc)
![Other Health Tracker Page - Weight](https://private-user-images.githubusercontent.com/32204448/289312085-c4bd551b-801e-42b8-b57b-4ef44df178a6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU0MTc4NTYsIm5iZiI6MTcyNTQxNzU1NiwicGF0aCI6Ii8zMjIwNDQ0OC8yODkzMTIwODUtYzRiZDU1MWItODAxZS00MmI4LWI1N2ItNGVmNDRkZjE3OGE2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA0VDAyMzkxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI2NTA4NTViNzRmMjVjMThlMTEyOGE0OWU2ODUyZjJmOTZkZGMwYTEyYjhlMmUwNGVjYTFmOWJiODNkNWM2ZTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.PYD0eyan427srHkJ9gSxIAmSGx4gtxrBuGsWbCd8u4I)