Spec to Shipped Android Build in 48 Hours — With 309 Tests and a Build-Failing 7:1 Contrast Gate

Fast doesn't mean sloppy. Inside building Ivy v1 in two days: pure-cents insurance math, Expo SDK 57 upload fixes, memory-only healthcare privacy, and strict accessibility CI gates.

Most "built an app in 48 hours" posts share one flaw: they celebrate speed by skipping types, ignoring edge cases, leaving accessibility broken, and calling a fragile demo "done." When we built v1 of Ivy (Raga AI's healthcare cost assistant), I went from a product spec and ten screen mockups to a working Android APK wired to the real API in two days — with 309 automated tests passing and a strict rule baked in from the very first commit: if any text contrast pair drops below 7:1, the build fails.

Speed doesn't come from cutting engineering corners. It comes from encoding non-negotiables into executable tests before you move fast — especially in healthcare software where patients sit in bright waiting rooms trying to understand what an allergy visit will actually cost before they book.

Lo-fi storyboard of Ivy across three screens: scan your insurance card, choose a visit reason in plain language, and inspect an itemized cost estimate
The core three-part patient flow (lo-fi storyboard; production clinic screens stay confidential).

Patients don't speak CPT billing codes or diagnosis codes. They hold up an insurance card and type 'I need allergy testing' — and they need an honest dollar range they can verify line by line.

The core product constraint behind Ivy

01 · INVARIANT TESTS BEFORE POLISH

Why the Very First Test in the Repo Checked 7:1 Color Contrast

When you iterate fast on a UI, visual regressions sneak in silently: a subtle gray label looks fine on a dark desktop monitor, then washes out completely on a patient's phone under fluorescent clinic lights. Instead of auditing colors manually before release, the first test suite in Ivy enforced WCAG AAA 7:1 minimum text contrast across Light, Dark, and High-Contrast themes (8:1 in high contrast), alongside 17pt body sizing, 48pt touch targets, and 56pt primary buttons.

Whenever a screen mockup used a lighter teal that failed contrast, the automated suite caught it immediately — readability won every time. A pure theme-pair check takes under forty lines of TypeScript and runs in milliseconds in Jest:

theme-contrast.test.tstypescript
function channelLuminance(c8: number): number {
  const srgb = c8 / 255;
  return srgb <= 0.03928 ? srgb / 12.92 : ((srgb + 0.055) / 1.055) ** 2.4;
}

function relativeLuminance(hex: string): number {
  const clean = hex.replace("#", "");
  const r = channelLuminance(parseInt(clean.slice(0, 2), 16));
  const g = channelLuminance(parseInt(clean.slice(2, 4), 16));
  const b = channelLuminance(parseInt(clean.slice(4, 6), 16));
  return 0.2126 * r + 0.7152 * g + 0.0722 * b;
}

export function contrastRatio(fgHex: string, bgHex: string): number {
  const l1 = relativeLuminance(fgHex);
  const l2 = relativeLuminance(bgHex);
  const [bright, dark] = l1 > l2 ? [l1, l2] : [l2, l1];
  return (bright + 0.05) / (dark + 0.05);
}

// Fail CI before shipping washed-out patient text in light, dark, or high-contrast themes
for (const [themeName, pairs] of Object.entries(themeTokenPairs)) {
  for (const { label, fg, bg, minRatio = 7 } of pairs) {
    const ratio = contrastRatio(fg, bg);
    if (ratio < minRatio) {
      throw new Error(`[${themeName}] ${label} contrast ${ratio.toFixed(2)}:1 < ${minRatio}:1`);
    }
  }
}

02 · PURE TYPESCRIPT MATH VS SPEC BUGS

Separating the Insurance Estimate Engine from React Found Three Spec Bugs

Putting insurance cost logic inside UI components slows down every test and hides rounding bugs. Instead, Ivy's estimate engine lived in pure TypeScript with zero React imports, operating strictly in integer cents and applying a shared single deductible across lines, per-line out-of-pocket caps, per-plan copay rules, and low/high unit ranges. That made running dozens of adversarial financial scenarios instantaneous — and immediately surfaced places where the original spec's own worked numbers didn't add up:

Real edge cases caught by testing the pure-TypeScript estimate engine against the spec
Edge CaseSpec AssumptionProduction Engine RuleGuardrail Built
Worked sample mathSample total showed $107.58 with $679 deductible leftApplying $679 remaining deductible gives $377.90; $107.58 only holds if deductible isn't appliedDocumented both paths explicitly in tests + spec questions
Copay vs deductible orderingPseudo-code deducted from remaining deductible before checking copayCopay-only visits must not burn deductible dollars the patient never paidConfigurable per-plan copay precedence rule
Allergy shots courseBundled mentally like a single visitStarting allergy shots spans 26 build-up visits, not one visitLabeled full course estimate with per-visit copays
Patient-facing wordingRisk of CPT / diagnosis codes bleeding into copy9 plain-language reasons map via Zod-validated JSON bundlesAutomated test fails if a billing code ever hits UI strings

03 · SHIPPING IN 48 HOURS AGAINST A LIVE BACKEND

Hybrid API Endpoints, Memory-Only Privacy & an Expo SDK 57 Upload Gotcha

The backend APIs for card reading, coverage checks, and clinic pricing were being built in parallel during those same two days. Waiting for every endpoint to stabilize before wiring the app would have burned half the sprint.

Four-step patient journey in Ivy: photograph insurance card, confirm plain-language visit reason, compare nearby clinics, inspect breakdown
Background coverage checks begin the moment a card finishes uploading, saving patients idle wait time.
Transport

Per-Endpoint Hybrid Mode

Mock twin + Zod response contracts

Each endpoint toggled independently between mock data and the live backend. Card reading switched live first; pricing followed the same afternoon.

  • Every API payload parsed cleanly with Zod
  • Patient PII stays in POST bodies, never query URLs
Expo SDK 57 Trap

The False 'Offline' Upload Bug

expo-file-system over legacy file objects

Expo SDK 57's fetch rejected older React Native file objects locally before hitting the network, surfacing a misleading offline message.

  • Reading photo bytes via expo-file-system solved it cleanly
  • Card photos delete from device storage right after upload
Healthcare Trust

Private by Default

Memory-only Zustand + screenshot blocks

Patient data never touches AsyncStorage, clears after 10 idle minutes (with a 1-minute warning), and strips member ID & DOB from shares.

  • Android screenshots blocked; iOS blurred in app switcher
  • Zero third-party analytics SDKs inside the app

04 · TEAM EXECUTION OVER EGO

What Happened When Two Builds Appeared on the Same Evening

Here is the part most solo speed-build stories leave out: the same evening v1 hit the live backend, a parallel build by a teammate that stayed closer to the visual mockups became the UI the team chose to carry forward. Instead of digging in to defend two competing codebases, I immediately ported my four-clinic side-by-side comparison, location search, and cross-platform screenshot protection cleanly onto the team's app — keeping one unified iOS, Android, and web codebase.

01

Put executable tests where regressions hurt worst

Accessibility, copy leaks, & pure math

Encode contrast thresholds (7:1), billing-code string bans, Zod schema checks, and cents-based arithmetic tests on hour one — before writing UI polish.

  • 309 passing Jest tests caught bugs faster than manual QA
02

Decouple endpoints with a typed hybrid client

Ship slice by slice

Never block the mobile UI waiting for all backend routes at once. Flip individual endpoints live behind strict response validation.

  • Zero 'mock rewrite' throwaway work
03

Detach ego from which UI branch wins

One cohesive product beats two stalled versions

Port high-leverage modules (shared-scale clinic comparison, privacy shields, coordinate search) cleanly when the team aligns around another shell.

  • Fast builds matter most when they accelerate the whole team

You can explore the complete Ivy – Healthcare Cost Assistant case study, read Stop Giving Experienced Engineers 4 Random Whiteboard Questions, check out Why Next.js 16 revalidateTag('max') Serves Stale Sitemaps, or get in touch.

Sachin Kumar Kamat

Sachin Kumar Kamat

UI/UX Lead (Engineering & Design)

UI/UX Lead designing and engineering AI agent platforms, LLM evaluation suites, and enterprise React applications. Recognized as MVP (Q1 2026) and Employee of the Month at Raga AI.