Inspiration

Could physiological signals be context-aware?

I started with a much more ambitious vision: a privacy-first assistant that continuously unifies wearables + calendar + email to detect stress and coach you in real time. Very quickly I learnt that production-grade permissioning (OAuth scopes, SDK approvals, data-use reviews) would take longer than a weekend. So we pivoted to build a focused, working slice of that vision—proof that the core loop works end-to-end. This submission is a snapshot of what’s possible.

What it does

Watch the video. CalmCue listens to your heart-rate stream and pulls your calendar context. When it detects pre-event stress patterns, it triggers a lightweight coaching nudge or a joke, or just plain makes fun of you (e.g., paced-breathing cue), then logs whether your physiology settles down.

How we built it

  • Stack: Next.js (Vercel) dashboard + Supabase (Postgres) + Edge Functions (Deno) + Python workers + WebSockets.
  • Data sources:

    • Google Calendar → ingest-gcal Supabase Edge Function (handles recurring events, time zones).
    • Wearable HR (HRM Pro Plus) → local Python DB via sqlite3 → WebSocket → Supabase physio_measurements.
  • Storage model (layered):

    • Layer −1: sources (where data came from).
    • Layer 0: events, physio_measurements.
    • Layer 1: inferences (instant reasoning on rolling windows; multiday trend jobs).
    • Layer 2: features (e.g., pre-meeting HR slope, baseline deltas) feeding the UI.
  • Reasoning: Cohere-backed prompts combine current signals + recent trends + upcoming events to decide when to nudge.

  • UI: shadcn/Tailwind + Recharts for live graphs; Supabase Auth for session gating.

  • Ops: Cron-style Edge Function for slower multiday analysis; instant inference runs on insert triggers / websocket events.

Challenges we ran into

  • Our Supabase schema got too convoluted at first—hard to query and reason about. We simplified to the “Layer −1 → 2” pattern above.
  • Calendar data is messy: recurring events and far-future instances polluted tables; we added filters and cleanup.
  • WebSocket reliability + noisy HR required smoothing windows and reconnection handling.
  • Typical hackathon pain: OAuth scopes/rate limits and time-zone edge cases.

Accomplishments that we're proud of

  • A working end-to-end loop: ingest → infer → coach → observe effect.
  • Live HR streaming to the dashboard with event-aware triggers.
  • Clear, documented schema and jobs for both instant and multiday reasoning.
  • Privacy-first defaults and a demo that still feels useful.

What we learned

  • Start from the smallest valuable loop, then layer sophistication.
  • Good feature engineering (slopes, baselines, context flags) beats fragile heuristics.
  • Keep schemas boring; make the read path easy.
  • “Ambition vs. permissioning” is real—design for local-first demos while planning for compliant integrations later.

What’s next for CalmCue

  • Proper permissioned integrations (Garmin/HealthKit/Outlook/Gmail) and background agents for mobile.
  • More signals: HRV and accelerometer; better personalization of baselines.
  • A unified stress score + evaluation dataset to measure real impact.
  • Push notifications + voice guidance, and on-device processing for stronger privacy.
  • Production-grade schema (fewer tables, clearer contracts) and a public API so others can build on the core loop.

Built With

  • auth
  • bluetooth
  • cohere-api
  • google-calendar-api-(oauth-2.0)
  • next.js-(react)
  • python
  • recharts
  • shadcn/ui
  • storage)
  • supabase
  • supabase-(postgres
  • supabase-edge-functions-(deno)
  • tailwind-css
  • typescript
  • vercel
  • websockets
Share this project:

Updates