DEV Community

Inbi
Inbi

Posted on

Bree — Here to Breathe With You

Presage SmartSpectra SDK Challenge Submission

This is a submission for the Presage SmartSpectra SDK Challenge

What I Built

Breathe With Me is a desktop app that reads your breathing and pulse through a normal webcam and shows them back to you, live, while a small, friendly robot called Bree guides you through a calm few minutes.

Here's what it lets you do:

Meet Bree, the guide

Breathe With Me is a pretty normal app: a dashboard, a few screens, some charts. I wanted something different, so I came up with Bree. She's there from the first screen to the last, part guide and part friend. She explains each step, says why she needs the camera, tells you when the signal is weak, and walks you through your summary with a few tips.

Demo

https://drive.google.com/file/d/1KH8ydSy_VW4MRZlqOUwhG7O380ZUtFb6/view?usp=sharing

The tools behind it

Layer What I used Why
Live signals Presage SmartSpectra SDK Breathing rate, breathing trace and pulse from the camera
Desktop app Electron Safe camera access in a real desktop app
Interface React + Vite Fast to build, easy to animate
Charts and Bree Hand-made SVG + CSS No chart library; Bree is drawn in SVG
Fonts Manrope and Fraunces A calm, friendly look
Keys and settings dotenv I never paste keys again
Voice (optional) ElevenLabs A natural voice for Bree
Voice fallback Browser speech synthesis Uses an English voice already on the computer
Saved results Electron local storage Numbers only, on your computer
Building it with Claude Integrating the AI features and improving the visuals

Code

Repository: github.com/Inbi-Nav/breathe-with-me

To run it:

git clone https://github.com/Inbi-Nav/breathe-with-me
cd breathe-with-me
npm install
cp .env.example .env     # on Windows: copy .env.example .env
npm start
Enter fullscreen mode Exit fullscreen mode

How It Responds to Human Signals

project structure

electron/main.js Creates the window, controls camera permission, handles the secure messages
electron/preload.js The small "bridge" (window.bwm) between the screen and the rest of the app
electron/config.js Loads the .env file
electron/insights.js Asks the optional AI for a note (numbers only)
electron/tts.js Gets Bree's natural voice and saves each sentence so it's only requested once
src/services/smartSpectra.js Connects to the Presage SDK
src/hooks/ useSmartSpectra, useBreathingLevel, useVoice, useAiInsight, useConfig
src/lib/ Session analysis, advice rules, dashboard stats, Bree's script, local storage, CSV export
src/components/ Dashboard, Start, Live, Summary, History, Bree, charts

How It Responds to Human Signals

Breathe With Me uses three live signals from Presage SmartSpectra: breathing rate, the live breathing trace (the up-and-down of each breath) and pulse rate. I don't use HRV or expressions.

Connecting the SDK was simpler than I expected: I ask for the breathing and cardio metrics and listen to what comes back.

const sdk = new SmartSpectraSDK({
  apiKey,
  requestedMetrics: [...breathingMetrics, ...cardioMetrics],
  enableTelemetry: false,
  enableAccumulatedOutput: false
});

sdk.on('metrics', (buffer) => {
  const metrics = decodeMetrics(buffer);   // rate, pulse, trace
});
Enter fullscreen mode Exit fullscreen mode

Here is what happens to each signal:

In real time, a small hook turns the breathing trace into a level from 0 (breathed out) to 1 (breathed in), smoothed so it moves gently. That one number drives everything on screen: the circles scale with it, Bree breathes along, and a "Breathing in / Breathing out" label follows. There's no timer or fixed pattern. If you breathe faster, slower or pause, the animation follows you.

After the session, the readings become the summary. The steadiness score is my own simple measure: the share of 30-second windows where your breathing rate stayed steady. It's not a clinical metric. Breathing is counted as deep (9 breaths a minute or fewer), calm (10 to 14) or active (more than 14). Bree's plan comes from those results:

  • If everything looks typical, she suggests an easy walk, some slow breathing, a glass of water and a regular routine.
  • If a reading falls outside the usual resting range, she suggests resting and measuring again, and mentions talking to a doctor if it keeps happening.

Prize Categories

Best Thoughtful Real-World Use

Many people would enjoy a quiet minute of breathing, but most health apps feel complicated. I built this one to be easy for everyone, including older adults.

  • Easy to start. One page, one choice, and your session begins.
  • A friendly guide. Bree explains each step in plain words and can read it all aloud.
  • Gentle advice. It's a wellness tool, not a doctor. If a reading looks unusual, Bree just says to rest and try again.

After each session, Bree gives you four short tip cards that change with your results:

Card Example
Move a little An easy 15 minute walk
Breathing practice In for 4, out for 6
Daily habits A glass of water in the morning
Keep going A kind word and a small goal for next time

I haven't tested it with older users yet. That's my next step.

Consent and Data Handling

It's designed with privacy and user consent in mind. The app does not record or store camera footage, and breathing and pulse results are saved locally only when “Save my results” is enabled.

Users can store up to 60 sessions and delete their saved results at any time. The Presage API key is used for authentication. Sessions only run with the user's permission, and SDK telemetry is disabled.

In general wellness tool, not a medical device. Measurements may vary depending on lighting and movement.

Agent Session

I used Claude to help integrate the optional AI features and to improve the visuals. The idea, the design and the decisions are mine.

Thanks for reading!

Top comments (1)

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