BetweenUs is a real-time speech-to-text companion built for people living with difficulty speaking clearly from medical conditions such as Motor Neurone Disease (MND). Spoken words are transcribed on-device and shown as large flippable text blocks so conversation partners can keep up with face-to-face chats.
Phase 4 status (Training Logic & Data Flow)
✅ MediaRecorder-powered audio capture with live timer feedback
✅ Recordings stored per phrase in IndexedDB (webm → wav on export)
✅ Clear + export actions available from the home dashboard
✅ ZIP export bundling manifest, transcripts, keywords, and audio
✅ README + landing page refreshed with recording/export tests
- Framework: Next.js 16 (App Router, React 19)
- Language: TypeScript
- Styling: Tailwind CSS v4, custom theming
- Tooling: ESLint (flat config), npm scripts
- Target platform: Firefox on Android (primary), deploy via Vercel
Roadmap phases are tracked from the PRD and organised into GitHub issues/PRs. Each phase completes with a “Test Now” checklist you can run on your device.
- Install dependencies
npm install
- Copy the environment template and fill in secrets
Required values:
cp .env.local.example .env.local
DEEPGRAM_API_KEY– create in the Deepgram dashboard (Nova-3 Streaming, AU English)NEXT_PUBLIC_APP_ENV– set tolocal,preview, orproduction
- Run the dev server
npm run dev
- Open the forwarded preview link (or
http://localhost:3000if running locally) and confirm the Phase 4 overview with storage + training summaries renders.
- Look for the install prompt (Android Firefox uses "Add to Home screen"). Relaunch to confirm standalone mode.
- Toggle the "Message size preview" slider — the percentage and preview text should persist on refresh.
- Enter a suburb/region in the vocabulary hint box; reload to confirm it remains saved.
- Visit
/training, press Record then Stop; confirm the timer stops, the phrase is marked complete, and Next phrase unlocks. Move forward, reload, and check the progress persists. - Trigger Clear counter on the home card; verify recordings reset and counters return to zero.
- Use Export training data and confirm a ZIP downloads with manifest, keywords, transcripts, and audio assets.
- Switch the device/DevTools to offline mode; the landing page and stored preferences should still be available.
| Script | Description |
|---|---|
npm run dev |
Start the Next.js development server |
npm run build |
Create a production build |
npm run start |
Run the built app in production mode |
npm run lint |
Lint the project with the shared ESLint config |
- Create a new Vercel project and link it to this repository.
- Set required environment variables under “Settings → Environment Variables”:
DEEPGRAM_API_KEYNEXT_PUBLIC_APP_ENV(previewfor Preview,productionfor Production)RELAY_SHARED_SECRET(must match the Render relay)RELAY_WS_URL(the Render relay WebSocket URL)
- Enable the “Installable” preview by ensuring the generated
manifest.webmanifestappears under “Settings → Functions → Headers”. - Protect secrets by storing the Deepgram key only in Vercel (do not commit).
- Trigger a deployment by pushing to
main(Vercel auto-builds every commit).
Tip: invite collaborators through Vercel to allow access to logs and environment edits.
Live streaming requires a lightweight relay that keeps the Deepgram API key server-side. Deploy it on Render and point the frontend at its WebSocket endpoint.
- Create a Render Web Service and link it to this repository.
- Set Root Directory to
relay. - Build Command:
npm install - Start Command:
npm start - Plan: Free “Starter” is sufficient.
- Set Root Directory to
- Environment variables on Render
DEEPGRAM_API_KEYDEEPGRAM_LANGUAGE(optional, defaults toen-AU)RELAY_MODEL(optional, defaults tonova-3; set tonova-2or legacy IDs if nova-3 isn’t available)RELAY_TIER(optional, only needed for legacy models that still require a tier parameter)RELAY_ENCODING(defaults tolinear16for PCM streaming)RELAY_SAMPLE_RATE(defaults to16000; must match the PCM stream)RELAY_AUDIO_DUMP_DIR(optional, local path for writing full WAV captures while debugging)RELAY_SHARED_SECRET(generate a strong random string; reuse the same value on Vercel/local).
- Grab the relay URL once Render deploys (e.g.
wss://betweenus-relay.onrender.com/stream) and set it asRELAY_WS_URLin.env.localand Vercel. - The Next.js client now requests signed URLs from
/api/relay-token, connects to the Render relay, and the relay forwards audio to Deepgram with the required headers.
The development plan is structured as 14 MVP phases. Each phase follows the same loop:
- Before starting – share goals and tasks in plain language.
- During – work in small commits and pause with a “Test Now — [Phase]” message.
- After – provide a changelog and short test checklist, wait for sign-off.
| Phase | Focus |
|---|---|
| 2 | ✅ Done — PWA shell, storage scaffolding |
| 3 | ✅ Done — Training UI base elements |
| 4 | ✅ Done — Recording pipeline, IndexedDB + ZIP export |
| 5–8 | Conversation surface, Deepgram streaming, flip UX |
| 9–11 | Orientation logic, dotted separators, notifications |
Each phase will raise/close GitHub issues and PRs so the full history stays transparent.
app/ # Next.js App Router routes, layouts, and styles
app/components/ # Client components shared across routes
app/hooks/ # React client hooks (PWA/storage integration)
docs/ # Product requirements, decisions, and user-facing notes
lib/storage/ # IndexedDB + preference utilities and export helpers
lib/training/ # Static phrase decks and future training helpers
public/ # Static assets (icons, manifest, service worker)
.env.local.example # Template for local environment variables
Additional folders (e.g., app/(training) or packages/speech) will be introduced as the roadmap progresses.
Current manual checklist:
- Landing page renders without console errors in Firefox (Android/Desktop).
npm run lintandnpm run buildsucceed.- PWA installation succeeds and launches in standalone mode (Add to Home screen on Android).
- Offline mode still displays the cached shell with stored preferences.
- Training workspace records audio, shows timers, and stores progress after reload.
- Region hint persists in preferences and feeds export metadata.
- Export ZIP includes manifest, keywords, transcripts, and audio assets.
Upcoming phases will layer automated tests around transcription flows, device orientation behaviour, and data export integrity.
- GitHub: brianwreaves/BetweenUs
- Related project: Waggie (MND Support Platform)
- Feedback/issues: please open a GitHub issue with logs, device info, and reproduction steps.
Together we’ll iterate through each phase, keeping the build deployable and ready for real MND-user feedback at every milestone.