HOMEClinic OS / Māvanta
Shipped Production Platform · mavanta.in

Unifying specialized clinical practices in one cohesive system.

Pediatric occupational therapy, speech pathology, and neurodevelopmental clinics were losing hours daily to physical paper binders, WhatsApp chaos, and GST billing discrepancies. I designed and engineered Māvanta (Clinic OS)—a multi-tenant, role-isolated practice operations platform purpose-built for Indian regulatory and mobile reality.

Role

Product Designer & Systems Builder

Scale of Code

2,120 Commits · 88k LOC

Architecture

Next.js 16 · Supabase · Zustand

Production URL

mavanta.in
Visual ThesisFrom Fragmented Channels to 1 Unified Clinic Hub
From Fragmented Channels to 1 Unified Clinic Hub
INSPECT FULL SCALE ⤢
Replacing disconnected whiteboards, WhatsApp chats, Word docs, and Excel sheets with a role-isolated operational cockpit.

82%

Faster session notes

8.5 min → <90s via voice + split UI

87%

Faster initial render

6.2s → 780ms tiered hydration

₹0.08

Voice AI scribing / note

Groq LPU Whisper Large V3 Turbo

100%

Statutory GST compliance

Automated SAC 999312 BOS vs INV

01 · The Problem Space

The Market Paradox: Why acute-care EHRs fail longitudinal therapy clinics

Field inquiry across multidisciplinary pediatric and rehabilitation clinics revealed a commercial paradox. Clinic owners spend heavily on customer acquisition (often allocating $2,000–$5,000+ monthly on Meta and Google Ads) to acquire families whose lifetime care extends over 6 to 24 months. Yet on the operational floor, staff execute daily care on physical whiteboards, Word files, unencrypted WhatsApp threads, and non-compliant Excel bills.

DimensionGeneric Acute-Care EHR (Epic/Practo)Specialized Therapy RealityMāvanta (Clinic OS) Solution
Care ParadigmEpisodic single-visit (Doctor → Rx → Discharge).Longitudinal, multi-month care with evolving SMART goals.Universal Clinical Program Builder: Milestone-contingent roadmaps.
Assessment ModelStatic text fields or ICD-10 diagnostic checklists.Standardized developmental batteries (Sensory Profile, Vanderbilt ADHD).Dynamic Assessment Engine: 69 validated schemas with radar charts & automated score bands.
Tax & Retail MixPure hospital pharmacy or standard commercial billing.Hybrid mix of tax-exempt therapy sessions and taxable sensory tools.Dual-Stream GST Engine: Segregates SAC 999312 Bills of Supply from Tax Invoices.
Device AccessTethered desktop monitors in consultation rooms.Therapists moving across sensory mats, swings, and gyms.Conversational Mobile Core: 6,040-line React omni-core + <5ms vector PDFs.

02 · Information Architecture

Four role-isolated cockpits behind one authentication router

Our research proved that universal forms paralyze staff. Forcing a receptionist to parse clinical milestone graphs—or asking an occupational therapist to balance GST ledgers—spikes error rates. Māvanta isolates roles into four dedicated workspaces with strict cryptographic boundaries:

Platform Governance

Super Admin Control Tower (/superadmin)

Global multi-tenant health telemetry, subscription tier overrides, digitally signed B2B MSAs with IP audit logs, and nuclear purge protection safeguards.

Business Operations

Clinic Owner Executive Suite (/dashboard)

Executive KPIs (MRR, retention, session yield), Polymorphic White-Labeling Studio, Dual-Mode Store (POS Mode vs Margin Audit Mode), and full JSON/CSV backups.

Clinical Care

Specialist & Therapist Cockpit

Longitudinal client dossiers, Asymmetric Split-Column Note Engine, 69 standardized diagnostic instruments with radar charts, and documentation backlog tracking.

Front Office

Front Desk Coordination Hub

Conflict-free multi-room calendar scheduler, automated GST SAC 999312 BOS vs INV billing split, duplicate-guarded intake, and Triple-Lock QR shift logs.

Design LogicUniversal Clinical Program Builder & Assessment Pipeline
Universal Clinical Program Builder & Assessment Pipeline
INSPECT FULL SCALE ⤢
Protocols clone cleanly per clinic while preserving standardized scoring algorithms (sum, percentage, Vanderbilt ADHD thresholds).
Operational GuardrailsFinancial Clarity & Dual-Mode Inventory Studio
Financial Clarity & Dual-Mode Inventory Studio
INSPECT FULL SCALE ⤢
Front-desk POS hides supplier cost margins while giving clinic owners complete margin transparency and tax audit trails.

03 · Design Builder Interactive Systems

Interact with the actual production logic

Instead of presenting static Figma frames, test the live coded replicas of Māvanta’s four foundational operational engines below:

LIVE CODED ARCHITECTURE · INTERACTIVE SPECIMENS

Four Core Operational Engines

Problem Solved: Eliminating 8.5-min modal forms between back-to-back therapy sessions.82% Faster Documentation
Phase 2 · Speech-LanguageSession #14 of 24
Aarav K. (5y 2m)

Active SMART Goal: Spontaneous 2-word requests using tactile cue cards without echo prompting.

Objective Goal Mastery75% Criteria
Baseline (20%)Target (80%)Mastery (100%)
Session Regulation & Mood Trend
Clinical Documentation Sheet
Saved 0ms ago · Local-FirstMood: Positive · Goal: 75% ✓
WHITE-LABEL CLINIC BRANDING ENGINE // BRANDINGUTILS.TS

Clinic Color Presets & Guarded Geometry

MAVANTA.IN
Clinic Brand Palette (From 18 Production Presets + Custom Hex):
Sanitized Radius Guard (Rejects extreme 28px–448px values):
M

Ārogyam Child Development Centre

SAC 999312 · DPDP Mumbai ap-south-1

Active Clinic Token

Pediatric OT & Speech Documentation Workspace

Custom palette hydrates clinic portals, parent progress PDFs, and GST Bills of Supply without breaking WCAG contrast.

--theme-primary: #002F1F--theme-fg: #B2F0D1DEFAULT_RADIUS: 4px

04 · Mobile Pivot & Vector Report Engine

Replacing 200 mobile menus with a conversational core & <5ms Vector PDFs

Shrinking a dense desktop ERP onto a 6-inch phone screen between active therapy sessions failed in contextual observation. Practitioners refused to navigate multi-level navigation trees. We pivoted to a 6,040-line conversational React state machine (`useChatbotLogic.ts`), paired with a mathematical in-memory vector jsPDF engine immune to mobile dark-mode bugs.

jsPDF <5msLive In-Memory Vector Assessment Output
Live In-Memory Vector Assessment Output
INSPECT FULL SCALE ⤢
Programmatically rendered with multi-axis radar maps, QR verification seal, and mathematical page-break pagination.
Dual Mode OutputClinical Care Roadmap in Parent Presentation Mode
Clinical Care Roadmap in Parent Presentation Mode
INSPECT FULL SCALE ⤢
Switches dynamically between clinical audit rigor and parent-reassuring milestone graphics with one click.
Parent ExperienceParent-Facing Visual Progress Infographic Pack
Parent-Facing Visual Progress Infographic Pack
INSPECT FULL SCALE ⤢
Milestone trends and therapy achievements formatted specifically for mobile messaging and parent consultations.

05 · Real-World Engineering Hurdles

Six production failures that shaped the UX & Architecture

Building a production platform handling minors' clinical records and financial transactions revealed friction that no Figma mockups could predict. Here is how we engineered solutions for each:

Hurdle 01Resolved in Production ✓

Deprecating WebAuthn for Triple-Lock GPS + QR

Failure: Biometric WebAuthn (TouchID/FaceID) failed on older Android tablets in regional clinics and broke during custom domain preview deployments due to strict top-level HTTPS requirements.

Resolution: Replaced biometrics with a custom 3-layer lock: 15-second rotating JWT QR code + 15m Haversine GPS spatial verification + authenticated session signature. Achieved 100% device compatibility with zero hardware costs.

Hurdle 02Resolved in Production ✓

Eliminating html2canvas Blank Dark-Mode PDFs

Failure: Capturing off-screen DOM nodes (left: -9999px) on mobile viewports produced 0×0 blank pages, and system dark mode photographed dark backgrounds onto printed sheets, wasting expensive toner.

Resolution: Rewrote document generation into an in-memory vector jsPDF engine (<5ms) using pure math coordinates. Integrated navigator.share() for one-tap WhatsApp Web Share dispatch.

Hurdle 03Resolved in Production ✓

16-Table Hydration Freeze (6.2s) → Tiered Local Sync

Failure: Loading all 16 relational tables on clinic login downloaded 14.2 MB of JSON, causing a 6.2-second browser freeze on regional broadband.

Resolution: Separated core tenant config (<120 KB) from on-demand paginated appointment queries. Paired Zustand persist with delta timestamps, cutting initial render to 780ms and bandwidth by 78%.

Hurdle 04Resolved in Production ✓

Shared iPad Cross-Tenant State Leaks

Failure: Practitioners sharing front-desk iPads risked bleeding Clinic A's financial KPIs and patient lists into Clinic B's session due to lingering localStorage cache.

Resolution: Architected an atomic memory-wipe protocol on logout that replaces state with defaults and purges localStorage keys before navigating to login.

Hurdle 05Resolved in Production ✓

RLS Type Collisions: The stripPrefix() Saga

Failure: Client IDs used formatted prefixes (CLINIC-9b1d) while Supabase columns used raw UUIDs. PostgreSQL RLS policies silently returned empty arrays without throwing errors, making records vanish.

Resolution: Deployed SQL migrations explicitly casting tenant parameters (clinic_id::text = auth.jwt()->>'clinic_id') and enforced stripPrefix() normalization across all client query builders.

Hurdle 06Resolved in Production ✓

Indian Data Sovereignty Migration (DPDP 2023)

Failure: Under India's Digital Personal Data Protection Act of 2023, developmental data of minors cannot be stored offshore. Our initial Supabase instance was in US East.

Resolution: Migrated the entire database cluster, 78 migration scripts, and storage buckets to Supabase Mumbai (ap-south-1), cutting clinical query latency from ~280ms to <35ms.

Security ArchitecturePrivacy Protection, Multi-Tenant RLS & Data Sovereignty
Privacy Protection, Multi-Tenant RLS & Data Sovereignty
INSPECT FULL SCALE ⤢
Strict PostgreSQL Row-Level Security, atomic tenant isolation, and Mumbai ap-south-1 data hosting ensuring complete statutory compliance.

06 · Quantitative Impact

Measurable operational relief across clinical practices

Metric IndicatorBaseline (Pre-Māvanta)With Māvanta ERPMeasurable Impact
Documentation Latency8.5 min / session (paper binders & Word)<90 seconds (voice dictation + split note UI)82% faster notes
Therapist Admin Time SavedLost 2.5–3 hours daily on paperworkSaved 65+ hours per clinic monthly~15 billable hrs reclaimed / therapist
Voice AI Scribing Cost$40–$100/mo medical scribes₹0.08–₹0.24 per note via Groq LPU98% cost reduction
Initial Dashboard Load6.2s (14.2 MB full burst fetch)780ms (Tiered hydration + Zustand persist)87% faster render
Statutory GST DiscrepanciesFrequent tax audits from mixed invoicing0% billing rejections via automated BOS vs INV100% tax compliance
Network Egress Volume14.2 MB per clinic login<1.8 MB with on-demand lazy querying78% bandwidth savings

07 · Design Builder Principles

What building end-to-end taught me as a systems designer

1. Contextual Interfaces Beat Universal Forms

In enterprise software, designing one "master view" for all roles ensures a mediocre experience for everyone. Isolating the receptionist's billing cockpit from the clinician's therapy sheet cut onboarding friction by over 40%.

2. Mobile: Conversational State Beats Nested Trees

Shrinking 200 desktop features into mobile menus frustrates users. A conversational omni-core transformed the phone from a compromised viewer into a fast operational remote control.

3. Optimistic UI Paired with Pessimistic Database Rules

In clinical settings with intermittent Wi-Fi, the UI must react instantly. Updating local Zustand stores optimistically keeps the specialist moving, while enforcing strict PostgreSQL RLS policies guarantees zero data loss.

4. AI as an Architectural Co-Pilot

Integrating AI models (Perplexity, Claude, Google) was never about trivial auto-completion—it was about stress-testing schema boundaries, modeling tax regulations, and verifying data residency before writing production code.

Regulatory & Architectural Deep Dive Appendix

01 · DPDP 2023 Data Sovereignty & CBIC GST SAC 999312 Mapping

Migrated all database tables from US East to Mumbai (ap-south-1), reducing clinical query latency from ~280ms to <35ms while satisfying India's Digital Personal Data Protection Act of 2023 for minors' records.

Engineered automated segregation between tax-exempt clinical therapy sessions (SAC 999312 Bills of Supply) and taxable retail tools (Tax Invoices), generating frozen JSON audit metadata snapshots on finalization.

02 · Multi-Tenant PostgreSQL RLS & 78 Schema Migrations

Eliminated silent UUID-vs-TEXT RLS mismatches using universal type-casting policies (`USING (clinic_id::text = auth.jwt()->'clinic_id')`) paired with a global stripPrefix() ID normalization utility across 19+ core tables.

03 · AI Co-Architect Workflow (Perplexity → Claude Opus 4.6 → Stitch → Groq)

Employed Perplexity for regulatory edge-case discovery, Claude Opus 4.6 and Google models for relational schema synthesis before writing JSX, Stitch for role-split prototype validation, and Groq LPU Whisper Large V3 Turbo for sub-second clinical voice dictation.