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
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.
| Dimension | Generic Acute-Care EHR (Epic/Practo) | Specialized Therapy Reality | Māvanta (Clinic OS) Solution |
|---|---|---|---|
| Care Paradigm | Episodic single-visit (Doctor → Rx → Discharge). | Longitudinal, multi-month care with evolving SMART goals. | Universal Clinical Program Builder: Milestone-contingent roadmaps. |
| Assessment Model | Static 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 Mix | Pure 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 Access | Tethered 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:
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.
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.
Specialist & Therapist Cockpit
Longitudinal client dossiers, Asymmetric Split-Column Note Engine, 69 standardized diagnostic instruments with radar charts, and documentation backlog tracking.
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.


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:
Four Core Operational Engines
Aarav K. (5y 2m)
Active SMART Goal: Spontaneous 2-word requests using tactile cue cards without echo prompting.
Clinic Color Presets & Guarded Geometry
Ārogyam Child Development Centre
SAC 999312 · DPDP Mumbai ap-south-1
Pediatric OT & Speech Documentation Workspace
Custom palette hydrates clinic portals, parent progress PDFs, and GST Bills of Supply without breaking WCAG contrast.
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.



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:
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.
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.
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%.
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.
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.
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.

06 · Quantitative Impact
Measurable operational relief across clinical practices
| Metric Indicator | Baseline (Pre-Māvanta) | With Māvanta ERP | Measurable Impact |
|---|---|---|---|
| Documentation Latency | 8.5 min / session (paper binders & Word) | <90 seconds (voice dictation + split note UI) | 82% faster notes |
| Therapist Admin Time Saved | Lost 2.5–3 hours daily on paperwork | Saved 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 LPU | 98% cost reduction |
| Initial Dashboard Load | 6.2s (14.2 MB full burst fetch) | 780ms (Tiered hydration + Zustand persist) | 87% faster render |
| Statutory GST Discrepancies | Frequent tax audits from mixed invoicing | 0% billing rejections via automated BOS vs INV | 100% tax compliance |
| Network Egress Volume | 14.2 MB per clinic login | <1.8 MB with on-demand lazy querying | 78% 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.