๐Ÿ’ก Inspiration

Every year, consumers spend hundreds of dollars on skincare products based purely on influencer marketing, subjective testimonials, or pseudo-scientific claims. When starting a new serum or moisturizer, people are left wondering: Is this actually improving my skin, or am I just imagining it?

Natural biological variations, lighting shifts, and camera inconsistencies make it nearly impossible to evaluate real product efficacy with the naked eye. We wanted to eliminate the guesswork.

Our vision for Kora was clear: turn skincare into an objective, evidence-based science. By combining YouCam Skin AI clinical-grade facial diagnostic technology with a statistical experiment engine and an autonomous AI agent, Kora empowers users to track their skin's evolution week after week and receive definitive verdicts on whether their products genuinely work.


โœจ What it does

Kora is an offline-first, weekly skin-tracking and cosmetic verdict application:

  • ๐Ÿ”ฌ Weekly Clinical Skin Analysis: Utilizing the YouCam Skin AI API, Kora analyzes 16 clinical skin dimensions (texture, pores, wrinkles, spots, redness, radiance, firmness, oiliness, moisture, dark circles, etc.) from a single selfie. It rejects artificial score inflation, providing trustworthy, unmanipulated raw scores.
  • ๐Ÿงช Cosmetic Experiment Tracker & Verdict Engine: Users can isolate a new skincare product in an active 4 to 8-week trial. Kora compares baseline scans against weekly progress, filtering out biological noise using statistical thresholds: $$\Delta_{\text{score}} = \text{Score}{\text{current}} - \text{Score}{\text{baseline}}$$ If $|\Delta_{\text{score}}| > \theta_{\text{noise}}$, Kora delivers an objective verdict: Clear Improvement, Decline, Pure Noise, or Inconclusive.
  • ๐Ÿค– Autonomous AI Skincare Coach: Powered by our dedicated AI agent (kora-skin-coach), the coach provides personalized, context-aware skincare guidance, understanding the user's specific skin profile, active experiments, and ingredient sensitivities.
  • ๐Ÿ“… Daily Routine & Idempotent Streak Engine: Tracks daily AM/PM regimens with an empathetic design: one automatic monthly "Joker" prevents motivation burnout if a day is missed.
  • ๐Ÿ“ถ Offline-First Resilience: Reads and writes instantly to a local SQLite database (via Drift) with automatic outbox synchronization when an internet connection is restored.

โš™๏ธ How we built it

Kora is engineered following strict Clean Architecture principles across a resilient multi-tier stack:

๐Ÿ“ฑ Client (Mobile App)

  • Framework: Flutter 3.x (Dart) compiling natively for iOS and Android.
  • State Management: flutter_bloc with Equatable for immutable, predictable unidirectional data flows.
  • Local Persistence: Drift (SQLite) for sub-millisecond local reads, offline persistence, and transactional outbox queues.
  • On-Device Vision: Google MLKit for real-time capture quality gates (lighting, angle, and distance verification before capture).
  • Subscriptions: RevenueCat SDK for entitlement management and premium features.

โ˜๏ธ Cloud & Edge Infrastructure

  • Supabase Edge Functions (Deno / TypeScript): Acts as a zero-trust serverless backend gateway.
  • YouCam Skin AI Integration: API keys are securely guarded on the server side. Edge Functions orchestrate image uploads to private storage buckets, trigger YouCam analysis tasks, poll job statuses, and extract clinical raw scores.
  • Bi-Directional Sync: A FIFO Outbox synchronization engine guarantees that offline edits automatically resolve with "Outbox Wins" conflict resolution.

๐Ÿง  Autonomous AI Agent Backend (kora-skin-coach)

  • Dedicated AI Agent Microservice: Developed in TypeScript using the Mastra framework and hosted on Render.
  • Cryptographic Token Verification: All client-to-agent communications are authenticated via Authorization: Bearer <MASTRA_API_SECRET> alongside the caller's validated Supabase JWT (x-user-jwt) and User ID.
  • Deterministic Safety Gate: Before reaching the language model, an automated red-flag detector intercepts and blocks medical diagnosis requests, redirecting users to healthcare professionals while focusing purely on cosmetic ingredient education.

๐Ÿง— Challenges we ran into

  1. Filtering Biological & Capture Noise: A user's skin score can fluctuate due to lighting changes, room humidity, or temporary sleep deprivation. We built a real-time MLKit capture validator to standardize lighting and distance, combined with a statistical noise-threshold algorithm ($\theta_{\text{noise}}$) so normal day-to-day fluctuations aren't misattributed to cosmetic products.
  2. Absolute Zero-Secret Client Architecture: Ensuring that no YouCam API secrets, AI agent secrets, or master tokens ever leak into the client binary. We designed a serverless proxy layer via Supabase Edge Functions where every sensitive operation is signed and verified on the backend.
  3. True Offline-First Data Sync: Synchronizing relational skin scans, daily routine logs, and experiment states without race conditions. We built an atomic Drift SQLite outbox that queues mutations locally and drains sequentially over an authenticated sync engine.
  4. Safety & Medical Guardrails: Ensuring the AI coach remains strictly within wellness and cosmetic advice. We implemented a dual-layer safety system: a deterministic regex/keyword gate on incoming messages followed by system-prompt guardrails in the Mastra agent.

๐Ÿ† Accomplishments that we're proud of

  • 100% Test Coverage & Reliability: The codebase is protected by 486 automated tests (unit, repository mocks, BLoC tests, and widget tests) passing with 0 analyzer warnings.
  • Seamless YouCam API Integration: Successfully mapped and interpreted 16 complex clinical parameters into accessible, intuitive UI visualizations (rings, deltas, and progress charts).
  • High-Performance Architecture: Cold start in under 2 seconds, instant offline navigation from local Drift SQLite, and real-time streaming AI coach responses via Server-Sent Events (SSE).
  • Ethical UX Philosophy: Complete absence of dark patterns, guilt-tripping notifications, or inflated "vanity" scores.

๐Ÿ“š What we learned

  • How to harness the full analytical power of the YouCam Skin AI API to provide meaningful, clinical-grade skin metrics on mobile devices.
  • Designing and deploying a standalone autonomous AI agent microservice with Mastra, securing it with signed Bearer secret authentication and streaming responses directly to Flutter.
  • Structuring complex offline-first Flutter architectures where local SQLite databases seamlessly synchronize with cloud backends.

๐Ÿ”ฎ What's next for Kora

  • eCommerce Virtual Try-On (VTO): Integrating YouCam's eCommerce VTO APIs to allow users to virtually preview product finishes, tinted moisturizers, and cosmetic textures directly aligned with their skin analysis.
  • Instant Barcode & Formula Scanner: Leveraging our MLKit pipeline to scan cosmetic barcodes in stores, automatically retrieving full INCI formulas and checking ingredient compatibility before starting an experiment.
  • Comprehensive Skin Progress Report Export: Generating beautifully formatted, encrypted PDF reports that summarize 8-week clinical skin score evolutions and experiment verdicts for personal tracking or aesthetician consultations.

Built With

Share this project:

Updates

Submission history