Skip to content

Repository files navigation

Stride — Apple Health-Inspired Mobile Health & AI Platform

Stride Banner

A state-of-the-art Flutter health platform with real-time biomechanics, Groq AI sports science insights, executive clinical PDF export, and direct WhatsApp sharing.

Flutter Dart Groq AI Firebase License


🌟 Key Features

1. 📊 Real-Time Biomechanics & Hardware Sensor Engine

  • Independent Hardware Pedometer Integration: Native step tracking that runs directly on the device's pedometer chip. Tracks steps continuously while the phone is locked and asleep with almost zero battery drain.
  • Offline High-Water Mark Logic: Accurately catches step deltas when the app is resumed, perfectly merging offline background steps into the SQLite database.
  • Zero-Flicker Background Sync: Architecture designed to completely wait for offline data and Health Connect data to merge silently in the background before rendering a seamless UI update.
  • Dynamic Cadence & Pace Math: Real-time walking speed calculated from physical stride length and cadence ($\text{Distance} / \text{Duration}$).
  • ACSM MET Caloric Formula: Accurate metabolic equivalent calculations tailored to user weight, speed, and height.
  • Multi-Timeframe Visualizations: Apple Health-style interactive bar charts and range charts for Day, Week, Month, and Year with scrubbing tooltips.

2. 🧠 Groq LLM Clinical Health Assistant

  • Powered by llama-3.3-70b-versatile with ultra-low latency.
  • Context-Aware: Evaluates exact real-time vitals, step goals, and user biometrics.
  • Dynamic User Sync: Instantly personalizes advice to user profile changes and goal adjustments.
  • Smart Offline Fallback: Local heuristic insights when offline or rate-limited.

3. 📄 Executive Clinical PDF Report Generator

  • Apple Health aesthetic with vector hourly bar charts and vitals summary cards.
  • Comprehensive 24-hour chronological timeline table for medical and personal reviews.
  • Formatted with patient biometrics, generation timestamp, and medical disclaimer.

4. 💬 Direct WhatsApp Report Sharing & Contact Book

  • Native Android Contact Picker: Import phone contacts with full pre-save name and number editing.
  • Up to 3 Recipients: Categorized by relationship (Doctor, Family, Trainer, Other).
  • Direct WhatsApp Attachment: Generates the PDF and loads it into WhatsApp with a pre-filled, formatted clinical summary caption ready to send.

5. 👤 Profile, Custom Goals & Multi-Account Isolation

  • Multi-Account Partitioning: Switch between Google accounts with fully isolated local database records.
  • Firestore Cloud Sync: Automatic real-time backup and restore of daily records across devices.
  • Customizable Goals: Interactive steppers for Steps, Active Energy, and Exercise Minutes.

🏗️ Architecture & Tech Stack

lib/
├── core/
│   ├── routing/           # GoRouter configuration & route guards
│   ├── services/          # SensorMathEngine biomechanics calculations
│   ├── theme/             # Apple Health glassmorphic design system
│   └── widgets/           # TactilePressable, StaggerEntrance, FlAppleRangeChart
├── data/
│   ├── local/             # HealthDatabase with per-user partitioning
│   └── repositories/      # LiveHealthRepository with sensor stream
├── domain/
│   └── models/            # HealthMetric, MetricDataPoint, TimeRange
├── features/
│   ├── ai_insights/       # GroqInsightService, InsightCacheManager, ChatNotifier
│   ├── browse/            # Categorized metrics directory
│   ├── onboarding/        # Streamlined Google Auth & Sensor Permissions (No Health Connect gate)
│   ├── profile/           # UserProfile, GoalsEditor, EditProfileSheet, AuthRepository
│   ├── sharing/           # HealthPdfReportService, AddContactSheet, ContactCard
│   ├── shell/             # AppShell & FrostedNavBar
│   └── summary/           # Bento grid dashboard & Activity Rings
└── main.dart              # App entrypoint & Riverpod ProviderScope

🚀 Getting Started

Prerequisites

  • Flutter SDK (3.24.0 or newer)
  • Android Studio / VS Code with Flutter extension
  • Physical Android device with Step Counter sensor (recommended) or Emulator

1. Clone the Repository

git clone https://github.com/shakeelscribes/Stride.git
cd Stride

2. Environment Configuration

Create a .env file in the root directory:

GROQ_API_KEY=your_groq_api_key_here

3. Firebase Setup

Add your Firebase configuration:

  1. Place your google-services.json in android/app/.
  2. Generate lib/firebase_options.dart using the FlutterFire CLI:
    flutterfire configure

4. Install Dependencies & Run

flutter pub get
flutter run --dart-define-from-file=.env

🧪 Testing & Code Quality

Run the complete test suite:

flutter test

Run static analysis:

flutter analyze

📱 Build for Release

Build Android APK:

flutter build apk --release --dart-define-from-file=.env

Build Google Play App Bundle:

flutter build appbundle --release --dart-define-from-file=.env

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

An Apple Health-inspired Flutter tracking app featuring real-time biomechanics, Groq AI clinical insights, 24-hour vector charts, and direct WhatsApp PDF report sharing.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages