Skip to content

LifeGuard is a comprehensive wearable health and environmental monitoring system that combines advanced motion detection, physiological tracking, and environmental sensing to provide real-time alerts and insights for personal safety and well-being.

License

Notifications You must be signed in to change notification settings

AWESOME04/LifeGuard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LifeGuard: Wearable Health & Environmental Monitoring System

Build Status Version Stars Forks Code Coverage Documentation DOI


LifeGuard Logo

Accessible health and environmental monitoring for everyone, everywhere.

View Demo Β· Report Bug Β· Request Feature

πŸ“‹ Table of Contents

🌟 Overview

LifeGuard is an innovative wearable system that bridges critical gaps in personal safety, accessibility, and preventive healthcare. By integrating advanced sensors with machine learning algorithms, it delivers real-time insights on health metrics and environmental parameters, making safety monitoring accessible and affordable for all.

Our solution stands out as a cost-effective and comprehensive alternative to premium devices, enabling equitable access for underserved populations, including the elderly and industrial workers in developing regions.

60%
Cheaper than Apple Watch
72h
Battery Life
9
Integrated Sensors
IP67
Water Resistance

✨ Key Features

  • πŸ“Š Comprehensive Health Monitoring

    • Real-time vitals tracking
    • Fall detection with 95% accuracy
    • Activity recognition (walking, running, cycling)
    • Custom health thresholds
  • 🌑️ Environmental Sensing

    • Air quality analysis (VOCs, CO2)
    • Temperature and humidity monitoring
    • Barometric pressure tracking
    • Pollution mapping with MapBox integration
  • ⚠️ Smart Alert System

    • Emergency contact notifications
    • Geolocation sharing
    • Customizable thresholds
    • Automated emergency response
  • πŸ’Ό Multi-Platform Support

    • Web dashboard with real-time analytics
    • Mobile app (iOS/Android) with dark/light themes
    • Data synchronization across devices
    • Offline functionality

πŸ› οΈ Technical Specifications

Hardware Components

Core Board Arduino Nicla Sense ME
Power 3.7V LiPo Battery (400mAh)
Battery Life 72 hours with optimized power management
Durability IP67 water and dust resistance
Weight Approximately 45g (including enclosure)
Connectivity BLE 5.0, WiFi (via companion device)
Sensors β€’ Accelerometer & Gyroscope (motion detection)
β€’ Temperature & Humidity sensors
β€’ Barometric pressure sensor
β€’ Magnetometer
β€’ Gas sensors (VOCs, CO2)

Software Architecture

Frontend Backend Mobile ML & Analytics
β€’ React 18
β€’ TypeScript
β€’ Tailwind CSS
β€’ Redux Toolkit
β€’ MapBox API
β€’ .NET 8.0
β€’ PostgreSQL
β€’ JWT Auth
β€’ SendGrid
β€’ Firebase
β€’ Flutter 3.19
β€’ Provider State
β€’ Material 3
β€’ Offline Mode
β€’ SharedPreferences
β€’ LSTM Networks
β€’ TinyML Models
β€’ Edge Inference
β€’ Time-series Analysis
β€’ Sensor Fusion

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • .NET SDK 8.0
  • Flutter SDK 3.19+
  • PostgreSQL 15+
  • Arduino IDE (for firmware development)

Quick Start Guide

  1. Clone the repository
git clone https://github.com/AWESOME04/LifeGuard.git
cd LifeGuard
  1. Set up environment files
cp backend/.env.example backend/.env
cp node-server/.env.example node-server/.env
cp web/.env.example web/.env
cp mobile/.env.example mobile/.env
  1. Start the backend server
cd backend
dotnet restore
dotnet run
  1. Launch the web dashboard
cd web
npm install
npm start
  1. Run the mobile application
cd mobile
flutter pub get
flutter run

Docker Setup

docker-compose up -d

This will start the web dashboard, API, and database services in containers.

πŸ—οΈ Project Structure

lifeguard/
β”œβ”€β”€ .github/                    # GitHub actions and templates
β”œβ”€β”€ firmware/                   # Arduino code and sketches
β”‚   β”œβ”€β”€ test-sketches/          # Sketches to test Nicla Sense ME
β”‚   └── we-dashboard/           # Web dashboard for reading sensor data
β”œβ”€β”€ web/                        # React dashboard
β”‚   β”œβ”€β”€ public/                 # Static assets
β”‚   β”œβ”€β”€ src/                    # React components
β”‚   β”‚   β”œβ”€β”€ components/         # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ pages/              # Main application views
β”‚   β”‚   β”œβ”€β”€ services/           # API integrations
β”‚   β”‚   └── store/              # Redux state management
β”œβ”€β”€ mobile/                     # Flutter mobile app
β”‚   β”œβ”€β”€ lib/                    # Dart code
β”‚   β”‚   β”œβ”€β”€ models/             # Data models
β”‚   β”‚   β”œβ”€β”€ screens/            # UI screens
β”‚   β”‚   β”œβ”€β”€ services/           # Business logic
β”‚   β”‚   └── widgets/            # Reusable components
β”œβ”€β”€ backend/                    # .NET Core API
β”‚   β”œβ”€β”€ Controllers/            # API endpoints
β”‚   β”œβ”€β”€ Models/                 # Data structures
β”‚   β”œβ”€β”€ Services/               # Business logic
β”‚   └── Middleware/             # Request processing
β”œβ”€β”€ node-server/                # Node.js backend service
β”‚   β”œβ”€β”€ controllers/            # Route controllers
β”‚   β”œβ”€β”€ models/                 # Database schemas
β”‚   β”œβ”€β”€ routes/                 # API routes
β”‚   β”œβ”€β”€ services/               # Business logic
β”‚   β”œβ”€β”€ middleware/             # Express middleware
β”‚   └── utils/                  # Helper functions
β”œβ”€β”€ docs/                       # Documentation
β”‚   β”œβ”€β”€ api/                    # API reference
β”‚   β”œβ”€β”€ images/                 # Project images
β”‚   └── tutorials/              # User guides
└── .devcontainer/              # Development container config

🧩 System Architecture

System Architecture

System Overview

System Architecture

Data Flow

  1. Data Collection:

    • Sensors gather health and environmental data
    • Edge processing for initial analysis
  2. Data Processing:

    • TinyML models analyze patterns on-device
    • Critical events trigger immediate alerts
  3. Data Storage & Analysis:

    • Cloud storage with HIPAA-compliant encryption
    • Advanced analytics for long-term trends
  4. User Interface:

    • Real-time dashboard visualization
    • Mobile alerts and insights

πŸ“š API Documentation

Below is an overview of the core endpoints for the LifeGuard API.

Main Service Endpoints

These endpoints are served from the .NET-Server (hosted at https://lifeguard-hiij.onrender.com):

Auth Endpoints

Method Endpoint Description
GET / Health check or base endpoint
POST /api/Account/login Authenticate a user using email and password
POST /api/Account/register Register a new user account
POST /api/Account/forgot-password Initiate the password recovery process
POST /api/Account/ResendOTP Resend OTP to the user
POST /api/Account/VerifyOTP Verify the OTP provided by the user
POST /api/Account/ResetPassword Reset the user's password using a token
POST /api/Account/CompleteProfile Submit additional profile details
GET /api/Account/{id} Retrieve basic account information by ID
GET /api/Account/GetProfile/{id} Retrieve detailed user profile information
GET /api/Account/google-login Initiate Google OAuth authentication
GET /api/Account/signin-google Handle the Google OAuth callback
DELETE /api/Account/{id} Delete user profile information by ID

Photo Endpoints

Method Endpoint Description
POST /{id}/photo Upload a photo for the user with the specified ID
DELETE /{id}/photo Delete the user's photo identified by the given ID
GET /{id}/photo Retrieve the photo for the user with the specified ID

Node-Server Endpoints

These endpoints are served from the Node-Server (hosted at https://lifeguard-node.onrender.com):

Memo Endpoints

Method Endpoint Description
GET /api/memos Retrieve user memos
POST /api/memos Create a new memo
GET /api/memos/undone/count Retrieve the count of undone memos

Emergency Contact Endpoints

Method Endpoint Description
GET /api/emergency-contacts Retrieve user's emergency contacts
POST /api/emergency-contacts Add a new emergency contact
POST /api/emergency-contacts/alert Send emergency alert to contacts
GET /api/emergency-contacts/test-alert/{id} Send test alert to specific contact
GET /api/emergency-contacts/verify Verify emergency contact with token
GET /api/emergency-contacts/alerts Get history of sent emergency alerts

Health Metrics Endpoints

Method Endpoint Description
GET /api/health-metrics/latest Get the latest health metrics for user
POST /api/health-metrics/save Save new health metrics for user
GET /api/health-metrics/history Get health metrics history (last 10 entries)

Exercise Endpoints

Method Endpoint Description
GET /api/exercise/stats Retrieve user's exercise statistics and streaks
POST /api/exercise/complete Record a completed workout session
POST /api/exercise/goals Set or update user's workout goals
GET /api/exercise/workout-history Retrieve user's workout history
GET /api/exercise/calories-history Retrieve user's calories burned history
GET /api/exercise/streak-history Retrieve user's exercise streak history

Medication Endpoints

Method Endpoint Description
GET /api/medications Get all medications for current user
POST /api/medications/add Add a new medication
PUT /api/medications/:id Update medication by ID
DELETE /api/medications/:id Delete medication by ID
POST /api/medications/track Track medication dose (taken or skipped)
GET /api/medications/compliance Get medication compliance rate

Sound & Wellness Endpoints

Method Endpoint Description
POST /api/freesound/audio-proxy Proxy for streaming audio files from Freesound
GET /api/favorite-sounds Get all favorite sounds
GET /api/favorite-sounds/{userId} Get user's favorite sounds
DELETE /api/favorite-sounds/{userId}/{soundId} Remove a sound from favorites

RAG System Routes

Method Endpoint Description
POST /api/rag/initialize Initialize the RAG system (admin only)
POST /api/rag/query Query the RAG system (authenticated users)
POST /api/rag/process/health Process health data (authenticated users)
POST /api/rag/process/environmental Process environmental data (authenticated users)
POST /api/rag/process/medical Process medical knowledge (admin only)
POST /api/rag/process/profiles Process user profiles (authenticated users)

User Notification Preferences Endpoints

Method Endpoint Description
GET /api/user-preferences/notifications Get user notification preferences
POST /api/user-preferences/notifications Update user notification preferences
POST /api/user-preferences/send-test-email Send a test notification email to the user

Complete API documentation would be posted soon...

πŸ‘₯ Team

Core Developers

Evans Acheampong
Evans Acheampong

Frontend & Hardware
Michael Adu-Gyamfi
Michael Adu-Gyamfi

Backend & ML

Academic Advisors


Dr. Percy Okae
Project Supervisor

Chiratidzo Matowe
Advisor

Marvin Rotermund
Ambassador, Embedded Learning Challenge

πŸ“· Screenshots

Appendix: Screenshots

Dashboard

Admin Dashboard

Analytics Panel

Analytics Panel

Sticky Notes

User Management

Health Report

Device Monitoring

Pollution Map

Pollution Map

Health Tips

Device Monitoring

Emergency Contacts

Pollution Map

Help

Device Monitoring

Profile

Pollution Map

Exercise Routines

Device Monitoring

Wellness Hub (Breathing)

Pollution Map

Wellness Hub (Meditation)

Device Monitoring

Wellness Hub (Zen Sounds)

Pollution Map

Health Metrics Calculator

Device Monitoring

πŸ’¬ Support & Contact

Frontend:
https://lifeguard-vert.vercel.app
Backend:
https://lifeguard-hiij.onrender.com/api
Node Server:
https://lifeguard-node.onrender.com
Email Support:
[email protected]
[email protected]

Happy coding!

About

LifeGuard is a comprehensive wearable health and environmental monitoring system that combines advanced motion detection, physiological tracking, and environmental sensing to provide real-time alerts and insights for personal safety and well-being.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published