alien4rmspace/glucofinity

TypeScript

0

49 commits

updated Aug 21, 2026

See the code

README

GlucoFinity

GlucoFinity is a polished landing page and interactive product prototype for an interdisciplinary university healthcare technology project. It explores how glucose readings could be viewed alongside meals, sleep, activity, medication, and other daily context to help users review personal patterns.

The current project is educational and informational. It is not a medical device, a source of medical advice, or a clinically validated product.

Technology stack

  • Next.js App Router with TypeScript
  • React 19
  • Tailwind CSS 4
  • Lucide React icons
  • Recharts data visualizations
  • Static export for GitHub Pages
  • Deterministic local mock data

No backend database, authentication, paid API, or hosted AI inference service is used. The optional voice workflow downloads a quantized LFM2.5 model from Hugging Face only after the user requests it, then runs inference locally in a WebGPU worker. A compact, bundled subset of USDA FoodData Central SR Legacy supports deterministic prototype nutrition estimates without a runtime nutrition API request.

Run locally

Requirements: Node.js 22.13 or newer and npm.

npm install
npm run dev

Open the local URL printed by Next.js.

Mobile app source

The current Expo/React Native application source is available separately in mobile-app/. It includes the iOS on-device voice modules, Apple Health and Android Health Connect integrations, local meal and medication logging, the bundled core nutrition catalog, product scanning, deterministic analysis services, and app tests.

To run the mobile project, follow mobile-app/README.md. Local environment files, downloaded language models, the optional full USDA branded catalog, dependencies, generated native projects, build output, and signing files are intentionally excluded from source control.

Validate and build

npm run lint
npx tsc --noEmit
npm run build
npm test

The production build is exported to out/. To preview that exact static output:

npm run preview

GitHub Pages deployment

The workflow in .github/workflows/deploy.yml builds and publishes the static export whenever changes are pushed to main.

In the GitHub repository settings, choose Settings > Pages > Build and deployment > GitHub Actions as the publishing source. The site will then be available at https://alien4rmspace.github.io/glucofinity/ after the workflow completes.

Project structure

app/                    App Router page, layout, metadata, and global styles
components/             Navigation, footer, shared UI, and page sections
components/charts/      Client-safe Recharts visualizations
components/dashboard/   Interactive dashboard preview
data/                   Deterministic fictional glucose and product data
types/                  Shared TypeScript data models
public/                 Static assets, including the social preview image
tests/                  Static-export smoke tests
mobile-app/             Expo/React Native application source and tests
.github/workflows/      GitHub Pages build and deployment workflow

Mock data

All glucose readings, meal details, sleep duration, exercise events, medication events, confidence values, and generated insights are fictional. The values are fixed in data/mock-data.ts, so charts render consistently on every visit and do not imply a connection to a real sensor or person.

The target range shown in charts is demonstration UI context, not a personalized recommendation.

Prototype features

The page demonstrates these concepts without claiming they are completed production capabilities:

  • A 24-hour glucose dashboard with target-range context
  • Meal-photo recognition estimates and editable carbohydrate values
  • Provider-neutral structured meal estimates with editable foods, calories, macros, and manual, AI-estimated, or user-corrected provenance
  • User-controlled recording with a live provisional transcript and final whole-clip local Distil-Whisper transcription, plus a typed-description fallback
  • User-triggered LFM2.5-1.2B-Instruct Q4 browser inference through Transformers.js and WebGPU, constrained to transcript-grounded meal names, foods, and stated portions
  • Deterministic local estimates for calories, carbohydrates, protein, fat, and fiber using a compact USDA FoodData Central SR Legacy reference subset
  • Visible assumed portions, partial-match coverage, per-food estimates, source IDs, and editable review before nutrition reaches the meal form
  • Editable review before a voice-generated draft reaches the session-only meal form
  • A post-meal glucose response view
  • A meal-centered response window with baseline, peak, rise, timing, 1-hour and 2-hour values, incremental area, return-near-baseline timing, and explicit data-quality states
  • Stable mock-source provenance and visible gaps when surrounding readings are incomplete
  • Deterministic, versioned feature previews that leave unavailable context missing
  • Explicit fictional training eligibility based on meal-response coverage
  • Evidence-backed pattern summaries with sample sizes and cautious correlation language
  • Separate model responsibilities for meal vision, XGBoost-style tabular prediction, continuous time-series forecasting, deterministic statistics, and explanation
  • Planned CGM and Apple Health integrations
  • Planned time-series, XGBoost-style, vision-language, and local language-model responsibilities
  • Privacy-focused product principles

The site does not currently connect to CGM hardware, Apple Health, a live nutrition database, medication systems, paid AI services, or trained glucose-prediction models. It does not predict real glucose responses or persist personal health information. The optional LFM2.5 workflow performs local text extraction only; deterministic nutrition math is handled separately from bundled reference values, and neither component provides medical reasoning.

Browser voice and local model

The interactive Meals demo can use a browser's local-only Web Speech API when the browser exposes that guarantee. It never silently falls back to remote speech recognition. Unsupported browsers retain typed meal entry. LFM2.5 requires WebGPU and an initial model download of approximately 850 MB; supported browsers can reuse their cached model files. Transcripts remain in page memory for the open session and are not sent to a GlucoFinity server.

After LFM2.5 extracts transcript-grounded food and portion phrases, the browser matches them against 27 common-food records bundled from USDA FoodData Central SR Legacy. Stated amounts are scaled using gram weights; missing amounts use clearly labeled reference portions. Unmatched foods remain unresolved and are excluded from totals. The subset is not a live or comprehensive USDA integration, so every estimate stays editable and is labeled as prototype nutrition.

The model is LiquidAI/LFM2.5-1.2B-Instruct-ONNX in Q4 format and is distributed under the LFM 1.0 License. Transformers.js provides the browser inference runtime. The model registry, chronological evaluation, and XGBoost training concepts shown in the demo are architecture/readiness states rather than performance claims.

Future development

  1. Conduct user research with patients and licensed healthcare professionals.
  2. Define consent, data minimization, access, retention, and deletion requirements.
  3. Prototype secure, permission-based CGM and Apple Health import flows.
  4. Add authenticated user accounts and encrypted storage only after a privacy and threat-model review.
  5. Evaluate meal-estimation and pattern-analysis models against representative datasets.
  6. Perform accessibility, usability, clinical-safety, privacy, and security validation.
  7. Determine regulatory obligations before positioning any version for healthcare decision support.

Safety

GlucoFinity is not a substitute for a licensed healthcare professional. AI-generated summaries may be incomplete or inaccurate, and nutrition values and glucose predictions are estimates. Users should not change medication or insulin decisions solely from information shown by this prototype.

License

This repository is licensed under the GNU General Public License v3.0. See LICENSE for the full terms.

Contributors

alien4rmspace

49 commits

alien4rmspace/glucofinity

TypeScript

0

49 commits

updated Aug 21, 2026

See the code

README

GlucoFinity

GlucoFinity is a polished landing page and interactive product prototype for an interdisciplinary university healthcare technology project. It explores how glucose readings could be viewed alongside meals, sleep, activity, medication, and other daily context to help users review personal patterns.

The current project is educational and informational. It is not a medical device, a source of medical advice, or a clinically validated product.

Technology stack

  • Next.js App Router with TypeScript
  • React 19
  • Tailwind CSS 4
  • Lucide React icons
  • Recharts data visualizations
  • Static export for GitHub Pages
  • Deterministic local mock data

No backend database, authentication, paid API, or hosted AI inference service is used. The optional voice workflow downloads a quantized LFM2.5 model from Hugging Face only after the user requests it, then runs inference locally in a WebGPU worker. A compact, bundled subset of USDA FoodData Central SR Legacy supports deterministic prototype nutrition estimates without a runtime nutrition API request.

Run locally

Requirements: Node.js 22.13 or newer and npm.

npm install
npm run dev

Open the local URL printed by Next.js.

Mobile app source

The current Expo/React Native application source is available separately in mobile-app/. It includes the iOS on-device voice modules, Apple Health and Android Health Connect integrations, local meal and medication logging, the bundled core nutrition catalog, product scanning, deterministic analysis services, and app tests.

To run the mobile project, follow mobile-app/README.md. Local environment files, downloaded language models, the optional full USDA branded catalog, dependencies, generated native projects, build output, and signing files are intentionally excluded from source control.

Validate and build

npm run lint
npx tsc --noEmit
npm run build
npm test

The production build is exported to out/. To preview that exact static output:

npm run preview

GitHub Pages deployment

The workflow in .github/workflows/deploy.yml builds and publishes the static export whenever changes are pushed to main.

In the GitHub repository settings, choose Settings > Pages > Build and deployment > GitHub Actions as the publishing source. The site will then be available at https://alien4rmspace.github.io/glucofinity/ after the workflow completes.

Project structure

app/                    App Router page, layout, metadata, and global styles
components/             Navigation, footer, shared UI, and page sections
components/charts/      Client-safe Recharts visualizations
components/dashboard/   Interactive dashboard preview
data/                   Deterministic fictional glucose and product data
types/                  Shared TypeScript data models
public/                 Static assets, including the social preview image
tests/                  Static-export smoke tests
mobile-app/             Expo/React Native application source and tests
.github/workflows/      GitHub Pages build and deployment workflow

Mock data

All glucose readings, meal details, sleep duration, exercise events, medication events, confidence values, and generated insights are fictional. The values are fixed in data/mock-data.ts, so charts render consistently on every visit and do not imply a connection to a real sensor or person.

The target range shown in charts is demonstration UI context, not a personalized recommendation.

Prototype features

The page demonstrates these concepts without claiming they are completed production capabilities:

  • A 24-hour glucose dashboard with target-range context
  • Meal-photo recognition estimates and editable carbohydrate values
  • Provider-neutral structured meal estimates with editable foods, calories, macros, and manual, AI-estimated, or user-corrected provenance
  • User-controlled recording with a live provisional transcript and final whole-clip local Distil-Whisper transcription, plus a typed-description fallback
  • User-triggered LFM2.5-1.2B-Instruct Q4 browser inference through Transformers.js and WebGPU, constrained to transcript-grounded meal names, foods, and stated portions
  • Deterministic local estimates for calories, carbohydrates, protein, fat, and fiber using a compact USDA FoodData Central SR Legacy reference subset
  • Visible assumed portions, partial-match coverage, per-food estimates, source IDs, and editable review before nutrition reaches the meal form
  • Editable review before a voice-generated draft reaches the session-only meal form
  • A post-meal glucose response view
  • A meal-centered response window with baseline, peak, rise, timing, 1-hour and 2-hour values, incremental area, return-near-baseline timing, and explicit data-quality states
  • Stable mock-source provenance and visible gaps when surrounding readings are incomplete
  • Deterministic, versioned feature previews that leave unavailable context missing
  • Explicit fictional training eligibility based on meal-response coverage
  • Evidence-backed pattern summaries with sample sizes and cautious correlation language
  • Separate model responsibilities for meal vision, XGBoost-style tabular prediction, continuous time-series forecasting, deterministic statistics, and explanation
  • Planned CGM and Apple Health integrations
  • Planned time-series, XGBoost-style, vision-language, and local language-model responsibilities
  • Privacy-focused product principles

The site does not currently connect to CGM hardware, Apple Health, a live nutrition database, medication systems, paid AI services, or trained glucose-prediction models. It does not predict real glucose responses or persist personal health information. The optional LFM2.5 workflow performs local text extraction only; deterministic nutrition math is handled separately from bundled reference values, and neither component provides medical reasoning.

Browser voice and local model

The interactive Meals demo can use a browser's local-only Web Speech API when the browser exposes that guarantee. It never silently falls back to remote speech recognition. Unsupported browsers retain typed meal entry. LFM2.5 requires WebGPU and an initial model download of approximately 850 MB; supported browsers can reuse their cached model files. Transcripts remain in page memory for the open session and are not sent to a GlucoFinity server.

After LFM2.5 extracts transcript-grounded food and portion phrases, the browser matches them against 27 common-food records bundled from USDA FoodData Central SR Legacy. Stated amounts are scaled using gram weights; missing amounts use clearly labeled reference portions. Unmatched foods remain unresolved and are excluded from totals. The subset is not a live or comprehensive USDA integration, so every estimate stays editable and is labeled as prototype nutrition.

The model is LiquidAI/LFM2.5-1.2B-Instruct-ONNX in Q4 format and is distributed under the LFM 1.0 License. Transformers.js provides the browser inference runtime. The model registry, chronological evaluation, and XGBoost training concepts shown in the demo are architecture/readiness states rather than performance claims.

Future development

  1. Conduct user research with patients and licensed healthcare professionals.
  2. Define consent, data minimization, access, retention, and deletion requirements.
  3. Prototype secure, permission-based CGM and Apple Health import flows.
  4. Add authenticated user accounts and encrypted storage only after a privacy and threat-model review.
  5. Evaluate meal-estimation and pattern-analysis models against representative datasets.
  6. Perform accessibility, usability, clinical-safety, privacy, and security validation.
  7. Determine regulatory obligations before positioning any version for healthcare decision support.

Safety

GlucoFinity is not a substitute for a licensed healthcare professional. AI-generated summaries may be incomplete or inaccurate, and nutrition values and glucose predictions are estimates. Users should not change medication or insulin decisions solely from information shown by this prototype.

License

This repository is licensed under the GNU General Public License v3.0. See LICENSE for the full terms.

Contributors

alien4rmspace

49 commits

Languages

TypeScript

95.9%

Swift

1.4%

Python

1.3%