{"id":46099183,"url":"https://github.com/and3rn3t/health","last_synced_at":"2026-03-01T19:22:29.220Z","repository":{"id":313575633,"uuid":"1047636691","full_name":"and3rn3t/health","owner":"and3rn3t","description":"Tinkering with Apple HealthKit and the LiDAR sensors in Apple iPhones.","archived":false,"fork":false,"pushed_at":"2026-03-01T10:54:44.000Z","size":31359,"stargazers_count":4,"open_issues_count":46,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-01T14:49:11.486Z","etag":null,"topics":["ai","gait-analysis","health","healthkit","lidar","ml","walking","wellness"],"latest_commit_sha":null,"homepage":"https://health.andernet.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/and3rn3t.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-30T21:38:34.000Z","updated_at":"2026-02-22T20:20:17.000Z","dependencies_parsed_at":"2025-09-07T02:42:49.941Z","dependency_job_id":"fb760d1c-4356-4f98-b1a1-87ec2e54563d","html_url":"https://github.com/and3rn3t/health","commit_stats":null,"previous_names":["and3rn3t/health"],"tags_count":30,"template":false,"template_full_name":"github/spark-template","purl":"pkg:github/and3rn3t/health","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/and3rn3t%2Fhealth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/and3rn3t%2Fhealth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/and3rn3t%2Fhealth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/and3rn3t%2Fhealth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/and3rn3t","download_url":"https://codeload.github.com/and3rn3t/health/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/and3rn3t%2Fhealth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29981395,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T16:35:47.903Z","status":"ssl_error","status_checked_at":"2026-03-01T16:35:44.899Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","gait-analysis","health","healthkit","lidar","ml","walking","wellness"],"created_at":"2026-03-01T19:22:28.353Z","updated_at":"2026-03-01T19:22:29.206Z","avatar_url":"https://github.com/and3rn3t.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🏥 VitalSense - Apple Health Insights \u0026 Fall Risk Monitor\n\n\u003e **A comprehensive health data analysis platform that transforms Apple Health data into actionable insights while providing proactive fall risk monitoring, real-time gait analysis, and emergency response capabilities.**\n\n**🚀 Now Live:** [https://health.andernet.dev](https://health.andernet.dev)\n\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-blue.svg)](https://www.typescriptlang.org/)\n[![React](https://img.shields.io/badge/React-19-blue.svg)](https://reactjs.org/)\n[![Cloudflare Workers](https://img.shields.io/badge/Cloudflare-Workers-orange.svg)](https://workers.cloudflare.com/)\n[![iOS](https://img.shields.io/badge/iOS-16+-black.svg)](https://developer.apple.com/ios/)\n[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n[![Production](https://img.shields.io/badge/Status-Live-brightgreen.svg)](https://health.andernet.dev)\n[![Branding Audit](https://github.com/and3rn3t/health/actions/workflows/branding-audit.yml/badge.svg)](.github/workflows/branding-audit.yml)\n[![iOS Tests](https://github.com/and3rn3t/health/actions/workflows/ios-tests.yml/badge.svg)](https://github.com/and3rn3t/health/actions/workflows/ios-tests.yml)\n[![Core CI](https://github.com/and3rn3t/health/actions/workflows/ci-core.yml/badge.svg)](https://github.com/and3rn3t/health/actions/workflows/ci-core.yml)\n[![Security \u0026 Quality](https://github.com/and3rn3t/health/actions/workflows/security-quality.yml/badge.svg)](https://github.com/and3rn3t/health/actions/workflows/security-quality.yml)\n[![Optimized Pipeline](https://github.com/and3rn3t/health/actions/workflows/optimized-pipeline.yml/badge.svg)](https://github.com/and3rn3t/health/actions/workflows/optimized-pipeline.yml)\n[![Smoke Tests](https://github.com/and3rn3t/health/actions/workflows/smoke.yml/badge.svg)](https://github.com/and3rn3t/health/actions/workflows/smoke.yml)\n\n\u003c!-- Dynamic CI Badges (generated on main by baseline_metrics job) --\u003e\n\u003cp\u003e\n  \u003cimg alt=\"Coverage\" src=\"./ci-baselines/badges/coverage.svg\" /\u003e\n  \u003cimg alt=\"ESLint Errors\" src=\"./ci-baselines/badges/eslint-errors.svg\" /\u003e\n  \u003cimg alt=\"ESLint Warnings\" src=\"./ci-baselines/badges/eslint-warnings.svg\" /\u003e\n  \u003cimg alt=\"Latency\" src=\"./ci-baselines/badges/perf-latency.svg\" /\u003e\n  \u003cimg alt=\"Main Bundle Size\" src=\"./ci-baselines/badges/bundle-main.svg\" /\u003e\n\u003c/p\u003e\n\n\u003e Badges above are lightweight SVGs committed by CI (no external shield calls) keeping repo self-contained \u0026 offline-view friendly.\n\n## 🚀 Quick Start\n\n### Web Application (5 minutes)\n\n```bash\n# Install dependencies\nnpm install\n\n# Start development servers\nnpm run dev          # React app on http://localhost:5173\nnpm run cf:dev       # Cloudflare Worker on http://localhost:8787\nnpm run ws:dev       # WebSocket server on ws://localhost:3001\n```\n\n### 🐳 Docker (Worker + WebSocket)\n\n```bash\n# Build and start both services\ndocker compose up --build -d\n\n# Access\n# - Worker (API + static): http://localhost:8789\n# - WebSocket server: ws://localhost:3001\n\n# View logs\ndocker compose logs -f worker\ndocker compose logs -f websocket\n\n# Stop\ndocker compose down\n```\n\nSee also: docs/DOCKER.md for full usage and environment details.\n\n#### Docker Dev Workflow (VS Code Tasks)\n\n- Bring up everything and run health checks:\n  - Tasks → \"🐳 Docker: Dev Workflow (no logs)\"\n- Tail logs:\n  - \"🐳 Docker: Logs (worker)\" and \"🐳 Docker: Logs (websocket)\"\n- Quick probes:\n  - Worker: \"probe-health-8789-curl\" → \u003chttp://127.0.0.1:8789/health\u003e\n  - WebSocket: \"🐳 Docker: Health (websocket)\" → \u003chttp://127.0.0.1:3001/api/health\u003e\n\nEndpoints:\n\n- API + static: \u003chttp://127.0.0.1:8789\u003e\n- WebSocket REST health: \u003chttp://127.0.0.1:3001/api/health\u003e\n\n### iOS Application (15 minutes on Mac)\n\n1. **Open Xcode** and create new iOS project\n2. **Add HealthKit capability** in project settings\n3. **Copy Swift files** from `ios/HealthKitBridge/` to your project\n4. **Configure Info.plist** with HealthKit permissions\n5. **Build and run** on physical device (HealthKit requires real device)\n\n📖 **[Complete Setup Guide →](docs/SETUP_GUIDE.md)**\n\n## 🏗️ Architecture\n\n```text\n┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐\n│   iOS App       │    │  React Web App   │    │  Caregiver      │\n│   (HealthKit)   │◄──►│  (Dashboard)     │◄──►│  Dashboard      │\n└─────────────────┘    └──────────────────┘    └─────────────────┘\n         │                       │                       │\n         ▼                       ▼                       ▼\n┌─────────────────────────────────────────────────────────────────┐\n│              Cloudflare Workers (API + Static)                  │\n│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────────┐ │\n│  │   Health    │  │   Auth \u0026    │  │    Emergency Alert      │ │\n│  │  Analytics  │  │   Privacy   │  │      System             │ │\n│  └─────────────┘  └─────────────┘  └─────────────────────────┘ │\n└─────────────────────────────────────────────────────────────────┘\n         │                       │                       │\n         ▼                       ▼                       ▼\n┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐\n│  Cloudflare KV  │    │   Cloudflare R2  │    │   WebSocket     │\n│  (Health Data)  │    │  (File Storage)  │    │   (Real-time)   │\n└─────────────────┘    └──────────────────┘    └─────────────────┘\n```\n\n## ✨ Key Features\n\n### 🏥 Health Analytics\n\n- **Comprehensive Data Analysis**: Import and analyze all Apple Health metrics\n- **Advanced Insights**: Correlation analysis and trend detection beyond Apple Health\n- **Personalized Recommendations**: AI-driven health insights and interventions\n- **Clinical Integration**: HIPAA-compliant health record management\n\n### ⚠️ Fall Risk Monitoring\n\n- **Proactive Assessment**: Real-time gait and balance analysis\n- **Predictive Modeling**: Machine learning for fall risk prediction\n- **Personalized Alerts**: Custom risk thresholds and notifications\n- **Intervention Tracking**: Monitor effectiveness of prevention strategies\n\n### 🚨 Emergency Response\n\n- **Automatic Fall Detection**: Real-time monitoring with immediate alerts\n- **Emergency Contacts**: Instant notification system for caregivers\n- **Location Sharing**: GPS coordinates for emergency responders\n- **Incident Documentation**: Comprehensive fall tracking and reporting\n\n### 👨‍⚕️ Caregiver Dashboard\n\n- **Real-time Monitoring**: Live health metrics and status updates\n- **Collaborative Care**: Multi-stakeholder communication platform\n- **Clinical Documentation**: Professional reporting and record keeping\n- **Privacy Controls**: Granular consent and access management\n\n## 🛠️ Technology Stack\n\n### Frontend\n\n- **React 19** with TypeScript for type-safe UI development\n- **Vite** for fast development and optimized builds\n- **Tailwind CSS v4** with semantic design tokens\n- **Radix UI** for accessible component primitives\n- **TanStack Query** for server state management\n\n### Backend\n\n- **Cloudflare Workers** for serverless edge computing\n- **Hono** for lightweight API framework\n- **Cloudflare KV/R2** for data storage and file handling\n- **WebSocket** bridge for real-time communications\n\n### Mobile\n\n- **Swift** with SwiftUI for native iOS experience\n- **HealthKit** for secure health data access\n- **Core Motion** for advanced sensor data analysis\n- **Network** framework for reliable data transmission\n\n### Security \u0026 Privacy\n\n- **End-to-end encryption** for all health data\n- **Zero-knowledge architecture** - server cannot read personal data\n- **HIPAA compliance** with comprehensive audit trails\n\n### Performance \u0026 Optimization\n\n- **Production Bundle**: ~187KB optimized with aggressive code splitting\n- **React Performance**: Lazy loading, memoization, and Suspense boundaries\n- **Edge Computing**: Cloudflare Workers for sub-100ms global response times\n- **Real-time Updates**: WebSocket connections with automatic reconnection\n- **Incremental Loading**: Component-level code splitting for faster initial loads\n\n_Latest optimization: December 2024 - See `docs/_archive/optimizations/OPTIMIZATION_DEPLOYMENT_COMPLETE.md`_\n\n#### Performance \u0026 SLO Monitoring\n\nA new synthetic + config-driven performance layer enforces budgets:\n\nFiles:\n\n- `slo.config.json` – central thresholds (JS/CSS gzip budgets, import latency, WebSocket connect time)\n- `scripts/node/analysis/perf-slo-sampler.js` – synthetic sampler (writes `reports/perf-sample.json`)\n- `scripts/ci/performance-slo-probe.mjs` – existing bundle/import latency probe (writes `reports/perf-slo.json`)\n\nUsage:\n\n```bash\npnpm run perf:sample           # Generate synthetic perf sample\npnpm run ci:perf-slo           # CI SLO probe (bundle + import latency)\npnpm run pre:release:gate      # Includes perf sample + SLO probe (soft-fail unless --strict)\n```\n\nOutputs:\n\n- `reports/perf-sample.json` / `perf-sample-history.json`\n- `reports/perf-slo.json` / `perf-slo-history.json`\n\nStatuses: `ok`, `degraded` (budget exceeded), `soft-missing-dist` (dist absent but tolerated), or `error`.\n\nExtend later: real-user metrics (LCP, CLS) + daily trend aggregator.\n\n- **JWT authentication** with secure token management\n\n## 📊 Project Status\n\n### ✅ Completed\n\n- ✅ React web application with health dashboard\n- ✅ Cloudflare Workers API with secure endpoints\n- ✅ iOS HealthKit bridge with real-time sync\n- ✅ WebSocket server for live data streaming\n- ✅ End-to-end encryption and JWT authentication\n- ✅ Automated deployment pipelines\n- ✅ Comprehensive documentation and troubleshooting guides\n- ✅ Automated branding \u0026 rebrand residue audit (HTML markers + legacy term scan)\n\n### 🚧 In Progress\n\n- 🔄 Advanced fall detection algorithms\n- 🔄 Enhanced caregiver dashboard features\n- 🔄 Apple Watch companion application\n\n### 📋 Planned\n\n- 📅 Production deployment optimization\n- 📅 Clinical integration partnerships\n- 📅 Advanced analytics and ML features\n- 📅 Healthcare provider portal\n\n## 🧾 Branding \u0026 Rebrand Integrity\n\nWe enforce VitalSense branding consistency in CI:\n\n- Combined audit script: `node scripts/node/branding/branding-audit.js`\n- Runs in smoke + deploy workflows (HTML marker verification + legacy \"HealthGuard\" residue scan)\n- Outputs markdown report: `reports/branding-audit-summary.md` (uploaded as artifact)\n\nLocal development quick checks:\n\n```bash\nnpm run branding:audit:local      # Against local Worker (port 8787)\nnpm run verify:branding:local     # Simple HTML marker pass\nnpm run verify:rebrand            # Residual term scan only\n```\n\nBranding gates fail if required VitalSense markers are missing or any legacy brand strings remain. A dedicated workflow (`branding-audit.yml`) runs in two modes (matrix):\n\n| Mode       | Target                        | Purpose                                         |\n| ---------- | ----------------------------- | ----------------------------------------------- |\n| local      | \u003chttp://127.0.0.1:8787\u003e       | Verifies dev Worker build branding consistency  |\n| production | \u003chttps://health.andernet.dev\u003e | Ensures deployed site remains correctly branded |\n\n## ✅ Pre-Release Gate (Unified Quality Check)\n\nRun a consolidated set of validations before any production (or critical) deployment:\n\n```bash\npnpm run pre:release:gate            # Quick tests, standard mode\npnpm run pre:release:gate -- --full  # Full test suite\npnpm run pre:release:gate -- --strict # Treat soft-fail steps as hard failures\n```\n\nWhat it runs (in order):\n\n1. Config validator\n2. Lint (TypeScript quick; strict with `--strict`)\n3. Test suite (quick or full)\n4. Production build + bundle size thresholds (JS \u003c400KB gzip, CSS \u003c60KB gzip)\n5. Branding + rebrand residue audit (soft-fail unless `--strict`)\n6. WebSocket schema drift guard (soft-fail unless `--strict`)\n7. Performance SLO probe (if present, soft-fail)\n8. Analytics version mismatch snapshot (soft-fail)\n9. Privacy / log guard (hard-fail)\n\nOutputs:\n\n- `reports/pre-release-gate.json` structured machine-readable summary\n- `reports/pre-release-gate.md` markdown table for CI artifact / PR comment\n\nFlags:\n`--skip-build` `--skip-tests` `--skip-branding` `--skip-ws` `--skip-perf` `--json`\n\nIntegrate this as a mandatory CI job prior to deploy to enforce performance, branding, and protocol integrity.\n\n## 📖 Documentation\n\n### 🚀 Getting Started\n\n### CSS Strategy\n\nWe follow a consolidation‑first CSS approach: one primary hashed CSS bundle from Tailwind (`src/main.css`), with optional code‑split CSS only for large, lazy‑loaded features. Rationale, guardrails, and workflow live in `docs/development/CSS_STRATEGY.md`.\n\n### 📱 iOS Development\n\n- **[iOS Setup Guide](docs/IOS_DEPLOYMENT_GUIDE.md)** - Complete iOS build and deployment\n- **[Windows Development](docs/IOS_DEVELOPMENT_WINDOWS.md)** - iOS development on Windows\n- **[Build Troubleshooting](docs/BUILD_TROUBLESHOOTING.md)** - Common issues and solutions\n\n### 🏗️ Architecture \u0026 API\n\n- **[Architecture Overview](docs/ARCHITECTURE.md)** - System design and technical decisions\n- **[API Documentation](docs/API.md)** - REST endpoints and data schemas\n- **[WebSocket Guide](docs/WEBSOCKETS.md)** - Real-time communication patterns\n\n### 🔧 Advanced Topics\n\n- **[Security Baseline](docs/SECURITY_BASELINE.md)** - Security implementation details\n- **[Problem Solutions Database](docs/PROBLEM_SOLUTIONS_DATABASE.md)** - Comprehensive troubleshooting\n- **[Lessons Learned](docs/LESSONS_LEARNED.md)** - Project insights and best practices\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details on:\n\n- Development setup and workflow\n- Code style and quality standards\n- Testing requirements and strategies\n- Security and privacy considerations\n- Documentation expectations\n\n### Development Environment\n\n```bash\n# Prerequisites\nnode \u003e= 18.0.0\nnpm \u003e= 9.0.0\n# For iOS development\nXcode \u003e= 15.0 (macOS only)\n```\n\n### Code Quality\n\n- **TypeScript** strict mode enabled\n- **ESLint** for code quality\n- **Prettier** for consistent formatting\n- **Zod** for runtime validation\n- **React Testing Library** for component tests\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🆘 Support\n\n- **Documentation**: Complete guides in [`/docs`](docs/) folder\n- **Issues**: [GitHub Issues](https://github.com/and3rn3t/health/issues) for bugs and feature requests\n- **Security**: Report security issues via [SECURITY.md](SECURITY.md)\n- **Discussions**: [GitHub Discussions](https://github.com/and3rn3t/health/discussions) for questions and ideas\n\n## 🏥 About VitalSense\n\nVitalSense represents the next generation of proactive health monitoring, combining the power of Apple's HealthKit with advanced analytics and machine learning to provide unprecedented insights into health trends and fall risk assessment. Built with privacy-first principles and clinical-grade security, it empowers individuals and their care teams to make informed decisions about health and safety.\n\n**Key Principles:**\n\n- **Privacy First**: Your health data stays private with end-to-end encryption\n- **Proactive Care**: Early detection and intervention prevent health crises\n- **Collaborative**: Seamless communication between patients, families, and providers\n- **Evidence-Based**: Decisions backed by comprehensive data analysis\n\n---\n\nBuilt with ❤️ for better health outcomes and peace of mind.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fand3rn3t%2Fhealth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fand3rn3t%2Fhealth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fand3rn3t%2Fhealth/lists"}