DEV Community

Rohit Kumar Chandoliya
Rohit Kumar Chandoliya

Posted on

CalmPulse — Breathe With Your Own Rhythm

Presage SmartSpectra SDK Challenge Submission

This is a submission for the Presage SmartSpectra SDK Challenge

What I Built

CalmPulse — a breathing & relaxation companion that listens before it leads.

Most breathing apps impose the same fixed pace on everyone. CalmPulse first measures your own breathing with the SmartSpectra SDK, then guides a breathing exercise at a pace adapted to you — about 15% slower than your natural rhythm. It shows your live pulse, breathing rate, HRV, and breathing waveform while you settle in, and it is consent-first by design: nothing touches the camera until you have read exactly how your data is handled and ticked the consent box.

I am entering it for Best Thoughtful Real-World Use: a small, real need (a calmer few minutes, on demand) with usability, consent, and responsible data handling as the headline features.

Demo

Demo video: https://youtu.be/Nzn-BaWdH3w (2:16 — the live flow on a real webcam: consent screen → Start → live pulse/breathing → guided breathing circle)

Try it without a camera: run the app and choose demo mode on the consent screen — the full experience runs on simulated signals, with a permanent "DEMO MODE" banner so it can never be mistaken for a measurement.

Code

  • Repository: https://github.com/rohitkrchandoliya/calmpulse
  • Setup: Node ≥ 20 → free API key from physiology.presagetech.com → npm install → copy .env.example to .env with the key → npm start → open http://localhost:4173. Full instructions in the repo README.

How It Responds to Human Signals

  • Package: @smartspectra/node-sdk (official Node.js SDK, v3.5.0), running in headless Node mode — the SDK captures in a local server process via useCamera.
  • Requested metrics: breathingMetrics (chest breathing, abdomen breathing, breathing rate) + cardioMetrics (pulse rate, arterial pressure trace, HRV).
  • Live signals used: metrics.breathing.rate, metrics.breathing.upperTrace/lowerTrace (waveform), metrics.cardio.pulseRate, metrics.cardio.hrv.rmssd.
  • Guidance loop: validationStatus hints are surfaced in the UI ("move closer", lighting, etc.) so users can fix their setup.
  • Adaptation: median breathing rate over ~20 s → guide pace = 85% of baseline, clamped to 4.5–9 br/min.
  • Deliberately NOT used: requestInsight() / AI Insights (no vitals leave the device for analysis); SDK telemetry is disabled (see below).

Architecture in one line: the Node server owns the SDK session and streams decoded metric values to a browser UI over Server-Sent Events — the browser never sees video or the API key.

Prize Categories

Best Thoughtful Real-World Use — CalmPulse addresses a small, real need (a calmer few minutes, on demand) for anyone who wants to slow down and breathe, designed around usability, explicit consent, and responsible data handling.

Consent and Data Handling

  • Consent gate. The app's first screen explains everything below and requires an explicit checkbox consent per session before the camera can be started. A clearly labelled demo mode (simulated signals, no camera) is offered as an alternative on the same screen.
  • Capture. On Start, the local CalmPulse server process opens the webcam and the SmartSpectra SDK processes frames on the user's own device to estimate pulse, breathing, and HRV.
  • No recording or storage. CalmPulse does not record, save, or upload video; frames exist only in memory during measurement. Readings are displayed live and are not stored anywhere by CalmPulse. Pressing "Stop camera" or closing the tab ends the session and releases the camera.
  • Network contact. The SDK contacts Presage servers only to authenticate the API key / validate the subscription and fetch processing models.
  • SDK telemetry: OFF. CalmPulse sets enableTelemetry: false. (Presage documents telemetry as aggregate session summaries that may contain free text, paths, and platform context, correlatable with an account/device; no raw frames or measured vitals are included. We opt out regardless.)
  • Optional AI services: none. The SDK's LLM Insights feature is never invoked.
  • API key handling. The key lives in a server-side .env file (git-ignored), is read only by the local server process, and is never sent to the browser or logged.
  • Scope. CalmPulse is a wellness and relaxation aid. It is not a medical device, makes no diagnosis or treatment claims, and is never used for monitoring anyone other than the consenting user in front of the camera.

What I Learned / What's Next

  • SmartSpectra's JavaScript story is a Node FFI binding, not a browser SDK — designing around that (server-owned session + SSE) kept the web UX intact and, honestly, improved the privacy story: video never leaves the machine the user is sitting at.
  • Next: an optional end-of-session summary the user can choose to save locally, and a "follow-along score" comparing the user's live rate to the guide pace during the exercise.

Built with the Presage SmartSpectra SDK. Wellness estimates only — not for medical diagnosis or treatment.

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.