Web/Guru
  • Digital health
  • Flutter app · iOS & Android
  • Admin dashboard
  • AI health coach
  • Wearables

DiaRehab case study: a Flutter diabetes rehabilitation app with an AI health coach and an admin dashboard

DiaRehab splash screen on an iPhone: the D logo and the tagline Intelligent Rehabilitation Tracking on the app's green

A diabetes rehabilitation platform that combines personalized care plans, lifestyle guidance, glucose management, and continuous progress tracking to support healthier daily routines.

Overview

DiaRehab is a digital diabetes management solution designed to help users improve their health through structured rehabilitation, personalized guidance, and ongoing monitoring. It brings daily habits, health progress, and diabetes-focused support into one simple experience.

Webguru designed and built the whole platform: the Flutter app for iOS and Android, a Next.js admin dashboard for the care and research team, and the TypeScript API and AI layer behind both.

Project

Industry /
Healthcare & Wellness
Category /
Diabetes management mobile app + admin dashboard
Platform /
iOS & Android (Flutter) + web dashboard (Next.js)
Location /
Global / Remote
Year /
2026
02

The Story

  1. Goal

    Create a simple, supportive way for people with diabetes to manage daily routines, fasting, and health progress in one app.

  2. Problem

    Diabetes management can feel complex and inconsistent, with users struggling to track habits, understand progress, and follow the right daily guidance.

  3. Solution

    DiaRehab combines personalized fasting guidance, AI coaching, and progress tracking to help users build healthier routines and manage diabetes more confidently.

03

UX Approach

Unified Health Overview

Users get a clear snapshot of HbA1c, weight, activity, fasting, and weekly progress from one personalized dashboard.

  • The profile keeps body measurements, clinical details and medications in one place, and new weight, HbA1c and HOMA-IR readings are logged from the same screen.
  • BMI is worked out from weight and height, and each tile carries a plain-language status, so the numbers explain themselves.

04Mobile experience

A Flutter diabetes app for fasting, training and AI coaching

The DiaRehab app turns a rehabilitation programme into daily routines: a fasting timer that runs from the moment a fast starts, guided workouts with demo videos, and an AI health coach that reads the user's own data before it answers.

Guided Fasting & Training

Structured fasting timers and tailored workouts help users follow their programme and track adherence. The screens below use demo data and are not medical advice: DiaRehab runs under clinical supervision.

  • Your fastLive timer for a 16:8 fast · demo data
  • DiaRehab training screen: 5 of 5 weekly sessions done and a list of beginner and intermediate exercises
    Training planWeekly goal and exercise library
  • DiaRehab exercise screen for the glute bridge with a demo video, step-by-step instructions and a low blood sugar safety note
    Exercise guideDemo video, instructions, safety note
  • DiaRehab training history screen with a training duration bar chart and a sessions trend line
    Training historyDuration, sessions trend, status

AI Health Coaching

An AI coach turns health data and activity into personalized guidance, progress insights, and everyday support for diabetes management.

  • Reads the user's fasting, training, wearable and trend data through tools before it replies
  • Streams its answer as it is written, with suggested prompts to start
  • Keeps every conversation, so users can return to past chats

Demo conversation with demo data, not medical advice. The coach explains the user's own numbers; it does not diagnose or suggest medication changes.

05Features

Six features inside the DiaRehab app

Each feature is a module of the Flutter app with its own screens, data and history, connected to the same backend and the admin dashboard.

  1. Patient Profile

    Keep essential health information organized in one place, including personal details, clinical data, and diabetes-related metrics.

    Weight, BMI, HbA1c and height sit beside the clinical details a care team needs. Each reading can be logged from the profile and has its own history screen.

    • Complete Profile
    • Clinical Details
    • Health Metrics
    • DiaRehab profile screen with weight, BMI, HbA1c and height tiles and the clinical details list
  2. Intermittent Fasting

    Support structured fasting routines with clear timers, adherence tracking, and progress history.

    Users choose a 12:12, 14:10, 16:8 or 5:2 plan, or a Ramadan schedule. Ending a fast early asks for a reason, such as low blood sugar, so a missed fast becomes data rather than a failure. Screens show demo data, not medical advice.

    • Fasting Timer
    • Adherence Tracking
    • Fasting History
    • DiaRehab active fast screen with a circular timer, start and goal times, elapsed time and progress
    • DiaRehab fasting history list with completed, skipped and in-progress fasts
    • DiaRehab fasting history graphs: fast duration bars, adherence trend line and status breakdown
  3. Resistance Training

    Guide users through diabetes-friendly exercise routines with workout instructions and measurable progress.

    An exercise library filtered by muscle group, demo videos for each movement, and a workout logger for sets, reps, weight and effort (RPE), with weekly session goals and strength progress.

    • Exercise Videos
    • Sets & Reps
    • Progress Tracking
    • DiaRehab training screen with the weekly session goal and the exercise list
    • DiaRehab exercise detail for the glute bridge with a demo video and instructions
    • DiaRehab training history with duration bars and a sessions trend
  4. Wearable Integration

    Bring daily activity and wellness data together through connected wearable devices for better monitoring.

    Steps, heart rate, resting heart rate and sleep sync from Apple Health on iPhone and Health Connect on Android. Access is read-only, nothing is written back, and manual entry covers days without a device.

    • Daily Steps
    • Heart Rate
    • Sleep Tracking
    • DiaRehab Steps and Vitals screen with the Connect Health Connect button and today's steps, heart rate and sleep tiles
    • DiaRehab weekly steps chart with average resting heart rate, average sleep and a daily history list
    • DiaRehab steps history list with daily step counts synced from a fitness tracker
  5. AI Health Coach

    Provide conversational support based on the user’s health activity, fasting progress, and ongoing diabetes routine.

    The coach looks up the user's own data before it answers and streams the reply as it is written. A separate rule engine raises health alerts, such as a drop in adherence or short sleep, for the user and the care team. The conversation shown is demo data, not medical advice.

    • AI Chat
    • Personalized Guidance
    • Health Alerts
  6. Progress Dashboard

    Turn health data into a simple visual overview of HbA1c, weight, fasting, activity, and overall progress.

    HbA1c and weight trends, this week's fasting and exercise adherence, and steps against a daily goal, with an AI summary of the week at the top.

    • HbA1c Trends
    • Weight Trends
    • AI Insights
    • DiaRehab home dashboard greeting Noor with HbA1c, weight, steps and fasting tiles and an AI coach summary
    • DiaRehab dashboard trend charts for HbA1c and weight
    • DiaRehab dashboard weekly fasting and exercise adherence meters and a steps chart

Admin and clinician dashboard

Next.js admin dashboard for a diabetes app: Triage first, numbers second

A Next.js dashboard for the care and research team. It opens on who needs attention today, then lets staff open any patient's history, curate the exercise library, compare cohort outcomes and re-theme the app without a store release.

  1. Built for a quick scan before rounds: who is flagged for adherence risk (no activity in five days, or adherence down 40% on their own previous week), how many patients engaged this week, 14-day fasting and training trends, and the cohort's self-reported HbA1c.

  2. Search every patient, filter by account status and sort by name or join date. Each row shows the age band (flagged outside the study's 30 to 65 range), data completeness, last login and latest activity, with status actions one click away.

  3. One page per patient: session counts, BMI, HOMA-IR, quality-of-life (WHOQOL-BREF) and self-management (DSMQ) scores, then tabbed history for fasting, training, weight, HbA1c, the six-minute walk test and questionnaires, as a table or a chart over any date range.

  4. Staff curate the resistance-training moves the app offers: muscle group, equipment, level, instructions and a YouTube demo for each. Filters match the values the API validates, and exercises are retired and re-activated rather than deleted.

  5. Cohort averages for HbA1c, HOMA-IR, WHOQOL-BREF, DSMQ and the six-minute walk, a pre/post comparison over custom baseline and follow-up windows, and CSV or Excel export of the whole cohort or only the rows you tick.

  6. Colour themes for the Flutter app are edited here token by token (brand, status, light mode and dark mode) with live phone previews. The app loads the live theme from the API, so a rebrand doesn't need an app store release.

Clinical overview · Screens rebuilt from the dashboard's code. All names and numbers are demo data.Next.js 16React 19RechartsTailwind CSS v4jose (JWT)Playwright

Architecture

One platform: app, dashboard and API

The Flutter app and the Next.js dashboard talk to one TypeScript API. Every request is validated, authenticated, checked for role and ownership, then handled by a single feature module, so a new feature means a new folder, not a rewrite.

documented API paths
52
backend feature modules
15
user roles, patient to admin
6
automated backend tests
113
first commit to release
5 wks

Counted from the repositories (OpenAPI document, src/modules, Vitest suites, git history: 19 Aug to 23 Sep 2026).

How the DiaRehab platform fits together. The Flutter app reads steps, heart rate and sleep from Apple Health or Health Connect and talks to the TypeScript API. The Next.js admin dashboard uses the same API. Behind it sit MongoDB with encrypted identifiers, the AI coach with read-only tools, scheduled jobs, and Firebase push notifications.

Security and privacy by design

Direct identifiers such as patient names are encrypted field by field with AES-256-GCM. Passwords are hashed with argon2id, access tokens are short-lived JWTs with single-use refresh tokens (a reused token revokes the whole session), and every staff role can enrol in TOTP two-factor sign-in.

  • AES-256-GCM field encryption
  • argon2id passwords
  • Rotating refresh tokens
  • TOTP MFA for staff
  • Per-route rate limits
  • Admin audit log

An AI coach with guardrails

The coach answers through nine read-only tools over the patient's own record and must call one before quoting any number. It never suggests medication or insulin changes, never diagnoses, and switches to an emergency script for symptoms like severe hypoglycaemia or chest pain. Risk alerts come from fixed rules, not the model.

  • 9 read-only data tools
  • No numbers without a tool call
  • No dosing, no diagnosis
  • Emergency script
  • 30 messages a minute

Background jobs and notifications

Jobs run in the study's timezone: fasting reminders at 09:00, training reminders at 17:00 and a risk check every 30 minutes for adherence drops, missing wearable data, rising HbA1c, a high resting heart rate or short sleep. Alerts reach the phone through Firebase Cloud Messaging, and dead device tokens are pruned.

  • Fasting and training reminders
  • Risk check every 30 min
  • Firebase push
  • Email delivery

Tested and documented

Zod schemas validate every request and generate the OpenAPI document served with Swagger UI. Vitest covers the business rules plus auth, fasting and research integration tests on an in-memory MongoDB, and Playwright smoke scripts check the dashboard's numbers against the live API.

  • 113 Vitest cases
  • Supertest + in-memory MongoDB
  • Playwright smoke tests
  • OpenAPI from Zod
  • Flutter
  • Riverpod
  • Node.js
  • TypeScript
  • Express 5
  • MongoDB
  • Mongoose
  • Zod
  • OpenAPI
  • Firebase Cloud Messaging
  • HealthKit
  • Health Connect
  • Vitest

DiaRehab is a research tool used under clinical supervision. It doesn't diagnose and doesn't replace a doctor, and the app says so to every patient.

Design System

The Figma board sets the brand type and colour. The Flutter app turns them into one palette of 18 colour tokens that the admin dashboard can change live, without a new app release.

DiaRehab brings HbA1c, weight, fasting, training and steps into one calm overview, so people living with diabetes see their whole programme on a single screen and clinicians see the same numbers.

Stack Sans Headline

32px – 24pxHeadings

Guided fasting windows, resistance training sessions with video, steps and heart rate from Apple Health and Health Connect, and an AI health coach that reads the patient’s own logged data before it answers.

Google Sans Flex

16px – 12pxBody · UI

What the app renders

In Flutter the type comes from google_fonts: Manrope for headlines and titles, Inter for body text and fields. Controls are 38px high with an 8px radius, cards a 16px radius.

  1. Hello, NoorManrope Bold 24
  2. This weekManrope SemiBold 20
  3. Fasting & exercise adherenceManrope SemiBold 16
  4. Here is how your program is going.Inter Regular 14
  5. e.g. 78.5Inter Regular 12 · fields
  • Primary

    White

    #FFFFFF

    Cards, app bar, bottom navigation, and the text on green buttons

  • Secondary

    Green

    #2FA561

    Splash, buttons, active tab, progress

    The board’s swatch reads #10B981; the app and the board’s own “Aa” use #2FA561, so that is what ships.

Supporting tokens

Runtime theming

Recolour the app from the admin panel

The Flutter app does not hard-code its brand colour. On launch it paints with the shipped palette, then reads the active theme from GET /v1/meta/theme and repaints. In the admin dashboard’s Appearance page an admin edits the 18 tokens against a phone preview, makes a theme live, and every change is written to the audit log.

Try a primary colour

Clinical Clarity is the shipped theme. The other three are examples of what an admin could set.

White text on it: 3.15:1AA large

Contrast was measured, not assumed. #2FA561 is 3.15:1 on white: fine for buttons with large labels, icons and progress bars, but too light for small green text. On this page green text uses #1F7A46 (5.34:1, AA). Warning #F4A522 is 2.05:1 on white, so it is used as a fill or chip, never as text on white.

FAQ

Health app development questions: Building a health app with Webguru

What founders, clinics and research teams usually ask before we start a digital health product.

Ask us anything
  • It depends on scope: which platforms, how many roles, whether you need a staff dashboard, wearables or AI, and what your data rules require. DiaRehab covered a Flutter app, a Next.js dashboard and a TypeScript API in about five weeks. We quote after a short call, once we understand your users and your data, and we can start with a focused MVP.

  • For most health products we recommend Flutter: one codebase for iOS and Android, native performance, and mature packages for HealthKit, Health Connect, secure storage and push notifications. We go native when a product leans on platform features Flutter can't reach well, such as some medical device SDKs. DiaRehab is Flutter on both platforms.

  • Yes. DiaRehab reads steps, heart rate, resting heart rate and sleep from Apple Health on iOS and Health Connect on Android, falls back to the phone's own step sensor, and lets patients type values in by hand. Each reading is tagged by source, so when a watch and a phone both count steps the sync prefers the worn device instead of adding them up.

  • Yes, and we design it around the job rather than the database. DiaRehab's Next.js dashboard opens on who needs attention, then gives staff patient histories, an exercise library, cohort research views with CSV and Excel export, and theme control for the app.

  • We keep the model on a short leash. DiaRehab's coach can only read the patient's own data through typed tools, must use a tool before quoting a number, never suggests medication changes or diagnoses, and follows a fixed emergency script. Anything safety-critical, like risk alerts, runs as plain, tested code instead of AI.

  • We build HIPAA- and GDPR-aware from day one: encrypted identifiers, strong password hashing, two-factor sign-in for staff, role and ownership checks on every request, and research exports that use pseudonymous codes instead of names. Formal compliance also depends on hosting, contracts and your own processes, so we work alongside your compliance or legal advisor rather than promising a certificate.

  • DiaRehab is positioned as a research tool used under clinical supervision, not as a diagnostic product, and the app tells every patient that the coach doesn't diagnose or replace their doctor. Whether a product counts as a medical device is a regulatory decision for the client and their advisors; we plan for it with them, and the architecture keeps the safety rules separate and testable.

  • Yes. We prepare signed builds, store listings and the privacy and health-data declarations both stores ask for, and handle review feedback until the app is live. For research pilots we can also ship test builds first.

  • We stay on for maintenance: OS and SDK updates, store policy changes, monitoring, fixes and new features. DiaRehab's theme editor already lets the team restyle the app without a release, and everything else goes through a normal update cycle with us.

Don’t miss a new work

Two hands holding up a tablet that opens the DiaRehab app: the green D splash screen, then the patient dashboard with HbA1c, weight, steps and fasting
Webguru.pk

Building a health app?

Let’s do a project together!

A patient app, a clinician dashboard, wearable sync and an AI layer with clear limits: we design and engineer the whole platform, the way we built DiaRehab.