Skip to content

HealthConnect is a full-stack wellness tracker for logging daily activities, sleep, water intake, and mood. Built with Java Spring Boot, React.js, and MySQL, it features secure authentication, goal setting, reminders, data export, and advanced visualizations. Designed for personal health management, HealthConnect offers a clean interface and action

Notifications You must be signed in to change notification settings

piyush932/HealthConnect---A-Personal-Health-Wellness-Tracker-

Repository files navigation

🩺 HealthConnect – A Personal Health & Wellness Tracker

πŸš€ Project Overview

HealthConnect is a full-stack personal health and wellness application designed to empower users to take control of their well-being. It enables users to track daily activities, sleep patterns, water intake, and mood. With a clean UI, insightful charts, and robust backend authentication, this project showcases the practical use of Java Spring Boot, React.js, and MySQL to solve real-world challenges involving data input, time-series data management, and data visualization.

✨ Features

πŸ” User Management & Authentication

  • JWT-based User Registration & Login
  • Protected API Routes and session-token validation
  • Token stored in localStorage, cleared upon logout
  • User Profile editing (name, age, height, weight)
  • Logout removes token and sensitive data from session

πŸƒ Activity Tracking

  • Track daily workouts: type, duration, steps, and calories burned
  • Full CRUD operations for each workout entry
  • View daily and weekly stats with step progress bar
  • Editable & deletable entries for today’s logs
  • Reminders via react-toastify if no activity is logged for today

πŸ›οΈ Sleep Logging

  • Input start & end time, with auto-calculated sleep hours
  • Rate sleep quality (1 to 5) and add notes
  • Validates end time must be after start time and duration must be positive
  • Visualize sleep history via Bar Chart + Average Line using Chart.js
  • Sleep History Component shows all entries with edit/delete for today

πŸ’§ Water Intake & 😊 Mood Tracker

  • Log daily water in liters or cups
  • Record mood via emoji scale (1–5) with optional notes
  • Multiple entries supported per day, aggregated by date
  • Bar charts for water & pie/line chart for mood trends
  • Supports CRUD with token-based authentication
  • Hourly hydration reminders using toast notifications

🎯 Goals & Progress Module

  • Set and track daily/weekly goals (steps, calories)
  • Weekly reset logic runs every Sunday
  • Visual tracking of target vs actual (calories, steps)
  • Pie charts for percentage completion using Recharts
  • In-app toast alerts if goals are incomplete by end of day

πŸ“Š Data Visualization & Insights

  • Track weekly/monthly insights:
    • Total steps walked
    • Average sleep per month
    • Water intake trends
    • Mood distribution
  • Uses Chart.js and Recharts across modules
  • Dynamic charts update based on token-authenticated API data

πŸ› οΈ Tech Stack

Layer Tech / Library Usage Description
Frontend React (Vite), Tailwind CSS Responsive UI with fast build system
Axios API communication with JWT token in headers
Chart.js / react-chartjs-2 Time-series visualizations: sleep and water intake trends
Recharts Goal progress and mood summaries with pie, bar, and line charts
react-toastify In-app reminders (side toasts)
react-hook-form Form control with validation
react-router-dom Routing/navigation
moment / dayjs Time formatting and calculations
rsuite UI components like modals/loaders
lucide-react / react-icons Iconography

πŸ“ App Structure

HealthConnect/
Backend/
    β”œβ”€β”€ .mvn/
        └── wrapper/
            └── maven-wrapper.properties
    β”œβ”€β”€ src/
        β”œβ”€β”€ main/
            β”œβ”€β”€ java/
                └── com/
                    └── incture/
                        β”œβ”€β”€ config/
                            β”œβ”€β”€ CorsConfig.java
                            └── SecurityConfig.java
                        β”œβ”€β”€ controller/
                            β”œβ”€β”€ AnalyticsController.java
                            β”œβ”€β”€ AuthController.java
                            β”œβ”€β”€ DailyActivityController.java
                            β”œβ”€β”€ DailyProgressController.java
                            β”œβ”€β”€ MoodEntryController.java
                            β”œβ”€β”€ SleepRecordController.java
                            β”œβ”€β”€ UserController.java
                            └── WaterIntakeController.java
                        β”œβ”€β”€ dto/
                            β”œβ”€β”€ AnalyticsResponse.java
                            β”œβ”€β”€ AuthResponse.java
                            β”œβ”€β”€ DailyActivityRequest.java
                            β”œβ”€β”€ DailyActivityResponse.java
                            β”œβ”€β”€ DailyProgressRequest.java
                            β”œβ”€β”€ LoginRequest.java
                            β”œβ”€β”€ MoodEntryRequest.java
                            β”œβ”€β”€ RegisterRequest.java
                            β”œβ”€β”€ SleepRecordRequest.java
                            β”œβ”€β”€ WaterIntakeRequest.java
                            └── WeeklyProgressResponse.java
                        β”œβ”€β”€ entity/
                            β”œβ”€β”€ DailyActivity.java
                            β”œβ”€β”€ DailyProgress.java
                            β”œβ”€β”€ MoodEntry.java
                            β”œβ”€β”€ SleepRecord.java
                            β”œβ”€β”€ User.java
                            └── WaterIntake.java
                        β”œβ”€β”€ repository/
                            β”œβ”€β”€ DailyActivityRepository.java
                            β”œβ”€β”€ DailyProgressRepository.java
                            β”œβ”€β”€ MoodEntryRepository.java
                            β”œβ”€β”€ SleepRecordRepository.java
                            β”œβ”€β”€ UserRepository.java
                            └── WaterIntakeRepository.java
                        β”œβ”€β”€ security/
                            └── JwtAuthFilter.java
                        β”œβ”€β”€ service/
                            β”œβ”€β”€ AnalyticsService.java
                            β”œβ”€β”€ CustomUserDetailsService.java
                            β”œβ”€β”€ DailyActivityService.java
                            β”œβ”€β”€ DailyProgressService.java
                            β”œβ”€β”€ MoodEntryService.java
                            β”œβ”€β”€ SleepRecordService.java
                            └── WaterIntakeService.java
                        β”œβ”€β”€ util/
                            └── JwtUtil.java
                        └── FullStackProjectApplication.java
            └── resources/
                └── application.properties
        └── test/
            └── java/
                └── com/
                    └── incture/
                        └── FullStackProjectApplicationTests.java
    β”œβ”€β”€ .gitattributes
    β”œβ”€β”€ .gitignore
    β”œβ”€β”€ mvnw
    β”œβ”€β”€ mvnw.cmd
    └── pom.xml
frontend/
    β”œβ”€β”€ public/
        └── vite.svg
    β”œβ”€β”€ src/
        β”œβ”€β”€ assets/
            β”œβ”€β”€ data-stats-around-person-doing-physical-activity.jpg
            β”œβ”€β”€ download.jpeg
            β”œβ”€β”€ fitness2.jpeg
            β”œβ”€β”€ fitness3.jpeg
            β”œβ”€β”€ front-view-man-tank-top-holding-weights-with-copy-space.jpg
            β”œβ”€β”€ img1.jpeg
            β”œβ”€β”€ physical-activity-stats-around-person.jpg
            β”œβ”€β”€ react.svg
            └── young-sportswomen-resting-dark-studio.jpg
        β”œβ”€β”€ components/
            β”œβ”€β”€ Dashboard/
                β”œβ”€β”€ GoalsProgress.jsx
                β”œβ”€β”€ MoodChart.jsx
                β”œβ”€β”€ PiChart.jsx
                β”œβ”€β”€ SleepTrackerChart.jsx
                β”œβ”€β”€ UserProfileCard.jsx
                └── WaterIntakeChart.jsx
            β”œβ”€β”€ Footer/
                └── Footer.jsx
            β”œβ”€β”€ Forms/
                β”œβ”€β”€ LoginForm.jsx
                └── SignUpFrom.jsx
            β”œβ”€β”€ Header/
                └── Header.jsx
            β”œβ”€β”€ HeroSection/
                └── HeroSection.jsx
            β”œβ”€β”€ Mood/
                β”œβ”€β”€ MoodForm.jsx
                └── MoodHistory.jsx
            β”œβ”€β”€ Sidebar/
                └── Sidebar.jsx
            β”œβ”€β”€ SleepTracker/
                β”œβ”€β”€ SleepForm.jsx
                └── SleepHistory.jsx
            β”œβ”€β”€ Water/
                β”œβ”€β”€ WaterHistory.jsx
                └── WaterIntakeForm.jsx
            β”œβ”€β”€ Workouts/
                β”œβ”€β”€ WorkoutForm.jsx
                └── WorkoutHistory.jsx
            β”œβ”€β”€ DailyGoals.jsx
            β”œβ”€β”€ Input.jsx
            β”œβ”€β”€ Loader.jsx
            └── UserProfileForm.jsx
        β”œβ”€β”€ pages/
            β”œβ”€β”€ Dashboard.jsx
            β”œβ”€β”€ History.jsx
            β”œβ”€β”€ Home.jsx
            β”œβ”€β”€ Layout.jsx
            β”œβ”€β”€ Login.jsx
            β”œβ”€β”€ Progress.jsx
            β”œβ”€β”€ SignUp.jsx
            β”œβ”€β”€ UserProfile.jsx
            └── Workouts.jsx
        β”œβ”€β”€ App.css
        β”œβ”€β”€ App.jsx
        β”œβ”€β”€ index.css
        └── main.jsx
    β”œβ”€β”€ .gitignore
    β”œβ”€β”€ eslint.config.js
    β”œβ”€β”€ index.html
    β”œβ”€β”€ package-lock.json
    β”œβ”€β”€ package.json
    β”œβ”€β”€ README.md
    └── vite.config.js

πŸ”— API Endpoints

πŸ‘€ User

Method Endpoint Description
POST /auth/register Register new user
POST /auth/login Login & receive JWT
GET /user/profile Get profile (JWT required)
PUT /user/profile Update user info

πŸƒ Activity

Method Endpoint Description
POST /activity Log new activity
GET /activity Get all activities
GET /activity/byDate Get by specific date
PUT /activity/{id} Edit entry
DELETE /activity/{id} Remove entry

πŸ’€ Sleep

Method Endpoint Description
POST /sleep Add sleep log
GET /sleep Get sleep history
PUT /sleep/{id} Update sleep entry
DELETE /sleep/{id} Delete sleep record

πŸ’§ Water Intake & 😊 Mood

Method Endpoint Description
POST /water Log water intake
GET /water Get water logs
PUT /water/{id} Edit water entry
DELETE /water/{id} Delete water entry
POST /mood Log mood
GET /mood Fetch mood entries
PUT /mood/{id} Edit mood log
DELETE /mood/{id} Delete mood

πŸ“ˆ Progress

Method Endpoint Description
GET /progress Get goals (daily/weekly)
PUT /progress Update goal progress manually

πŸ“€ Data Export

Method Endpoint Description
GET /export/all Export all user health data as CSV (JWT required)

πŸ”₯ Stretch Goals

Some of the stretch goals have been implemented:

  • Goal Setting: Users can set and track daily/weekly health goals.
  • Reminders: In-app and hourly reminders for activities , sleep , mood and hydration.
  • Data Export: Export all health data as CSV via the /export/all endpoint.
  • Advanced Visualizations: Enhanced charts and analytics for trends and progress.

πŸ§‘β€πŸ€β€πŸ§‘ Project Workflow & Collaboration

πŸ›  Agile Development

  • Weekly Sprint Planning
  • Kanban Board for task tracking
  • Clear deliverables for each module

πŸ”§ Git Strategy

  • Protected main branch
  • Feature branches for each module
  • PR reviews before merging

▢️ Getting Started (Dev Setup)

# Clone the repository
git clone https://github.com/piyush932/HealthConnect---A-Personal-Health-Wellness-Tracker-.git

# Backend Setup
cd backend
./mvnw spring-boot:run

# Frontend Setup
cd frontend
npm install
npm run dev

πŸ§ͺ Testing

You can test the HealthConnect project using the following tools and frameworks:

  • Backend: JUnit (for unit and integration testing) , Mockito (for mocking dependencies and service layers)
  • Frontend: Jest (for JavaScript/React component testing) , React Testing Library (for UI and interaction testing)

πŸ”— Deployment

The following options are available for when you are ready to deploy:

  • Containerize both backend and frontend for consistent deployment across environments.
  • Deployable via Netlify or Vercel for fast, scalable static hosting.
  • Deployable on Render, AWS, Google Cloud Platform (GCP), or Heroku for managed backend hosting.

πŸ’¬ Conclusion

HealthConnect is a modern, full-stack wellness app that blends clean design with functional depth. It provides the foundational blueprint for building real-world SaaS-like health tracking applications and is extensible with features like notifications, gamification, and advanced analytics.

Screen Shots

Module 1: User Management & Authentication

Screenshot 1
Β 
Screenshot 2
Β 
Screenshot 3
Β 
Screenshot 4
Β 
Screenshot 5
Β 
Screenshot 6
Β 

Module 2: Daily Activity Tracking

Screenshot 1
Β 
Screenshot 2
Β 
Screenshot 3
Β 

Module 3: Sleep Tracking

Screenshot 1
Β 
Screenshot 2
Β 
Screenshot 3
Β 

Module 4: Water Intake & Mood Logging

Screenshot 1
Β 
Screenshot 2
Β 
Screenshot 3
Β 
Screenshot 4
Β 

Module 5: Data Visualization & Trends

Screenshot 1
Β 
Screenshot 2
Β 
Screenshot 3
Β 

Stretch Goals:

Goal Setting

Screenshot 1
Β 
Screenshot 2
Β 
Screenshot 3
Β 

Reminders/Notifications:

Screenshot 1
Β 
Screenshot 2
Β 
Screenshot 3
Β 
Screenshot 4
Β 

Data Export:

Screenshot 1
Β 

About

HealthConnect is a full-stack wellness tracker for logging daily activities, sleep, water intake, and mood. Built with Java Spring Boot, React.js, and MySQL, it features secure authentication, goal setting, reminders, data export, and advanced visualizations. Designed for personal health management, HealthConnect offers a clean interface and action

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages