Wellness Wise is a comprehensive Health and Wellness Tracker that allows users to track their physical activities, diet, sleep, mood, and goals. The project showcases user-centric application development, integrating various types of data into a cohesive and useful tool.
- Tracking Physical Activities: Log your workouts, track durations, and monitor progress.
- Diet Tracking: Record your daily food intake with calories and meal types.
- Sleep Tracking: Track your sleep patterns, including hours slept, start time, and end time.
- Mood Tracking: Record daily moods.
- Mood Analysis and Insights: Use sentiment analysis to provide insights into users' mood patterns and suggest ways to improve mental well-being.
- Dashboard for Mood Trends: Visualize sentiment trends over time in a chart, showing how the user's mood has changed.
- Goals Tracking: Set and monitor your health and wellness goals.
- Personalized Recommendations: Leverage machine learning algorithms to provide personalized recommendations for workouts, dietary changes, and sleep improvements.
- User Authentication: Secure user authentication using JWT (JSON Web Token).
- Frontend: Angular
- Backend: Node.js, Express.js
- Database: PostgreSQL
- Machine Learning: Python for sentiment analysis and recommendations
- Charting Library: Chart.js for visualizing mood trends.
- Deployment: Vercel for frontend, Fly.io for backend, Supabase for database.
Before you start, ensure you have the following software installed:
- Node.js: Download Node.js
- PostgreSQL: Download PostgreSQL
- Angular CLI: Install via npm:
npm install -g @angular/cli
- Python: Download Python
git clone https://github.com/chrispsang/Wellness-Wise.git
cd Wellness-Wise
Navigate to the backend directory:
cd health-tracker-backend
2.1 Install Dependencies
npm install
2.2 Set Up Environment Variables
Create the .env
file:
touch .env
Add the following configuration to the .env file:
DB_HOST=localhost
DB_USER=new_user
DB_PASSWORD=new_password
DB_NAME=health_wellness
DB_PORT=5432
PORT=3000
ACCESS_TOKEN_SECRET=your_jwt_secret
2.3 Set Up PostgreSQL Database
Before running the schema script, follow these steps to create a new PostgreSQL user and set up the health_wellness database:
-
Create a New PostgreSQL User:
-
Open your terminal and connect to the PostgreSQL server using the default postgres superuser:
psql -U postgres -d postgres
-
Create a new user:
CREATE USER new_user WITH PASSWORD 'new_password';
-
Grant the new user the privilege to create databases:
ALTER USER new_user CREATEDB;
-
Exit psql:
\q
-
-
Create the health_wellness Database:
-
Connect to PostgreSQL as the new user:
psql -U new_user -d postgres
-
Create the database:
CREATE DATABASE health_wellness;
-
Exit psql:
\q
-
-
Run the Schema Script:
Now that the health_wellness database has been created, run the schema script:
psql -U new_user -d health_wellness -f ./schema.sql
2.4 Run the Backend
node src/server.js
Open your browser and go to http://localhost:3000 to access the backend.
Navigate to the frontend directory:
cd health-tracker-frontend
4.1 Install Dependencies
npm install
4.2 Run the Frontend
ng serve
Open your browser and go to http://localhost:4200 to access Wellness Wise.
The application is deployed and accessible via the following links:
- Frontend: Deployed on Vercel at https://wellness-wise.vercel.app
- Backend: Deployed on Fly.io at https://health-tracker-backend.fly.dev
- Database: Managed by Supabase