Skip to content

lostfleetdev/stresso

Repository files navigation

Stresso

Stresso is a multi-part emergency response prototype with four working pieces:

  1. An ESP32 + nRF24L01 "Link" device
  2. A Flutter mobile app
  3. A Node.js + SQLite backend API
  4. A React admin dashboard

The goal is simple: raise an SOS from the device or phone, relay nearby RF SOS events, and surface active incidents in a dashboard.

Repository layout

  • hardware/stresso-hardware/stresso-hardware.ino - ESP32 firmware (BLE + RF logic)
  • mobileapp/ - Flutter app for auth, pairing, SOS, and contacts
  • backend/ - Express API with SQLite persistence
  • admin-frontend/ - React dashboard for active SOS events
  • DOCUMENTATION.md and specs/ - design and planning docs

Current implementation status

Area Status Notes
Hardware firmware Working prototype 5-second hold SOS trigger, BLE characteristics, RF broadcast/listen loop
Backend API Working prototype Auth, profile link device ID, SOS endpoints, emergency contacts
Admin dashboard Functional Polls /api/sos every 5 seconds and displays active events
Mobile app Partially production-ready Core flows work, but some paths still use simulation/placeholder behavior
Tests Minimal Backend test script is placeholder; admin has default CRA test scaffold

What works today

  • User registration/login with JWT
  • Link device ID stored on user profile
  • SOS creation from mobile app to backend
  • Active SOS listing in admin dashboard
  • BLE command flow between app and ESP32 (TEST_SOS, DEACTIVATE_SOS, location updates)
  • RF SOS packet receive/forward path in firmware

Known gaps before rollout

  • Backend JWT secret is hardcoded in backend/server.js
  • Admin API URL is hardcoded in admin-frontend/src/App.js
  • Mobile has simulated logic in SOS/background monitoring paths
  • Some mobile screens still show "coming soon" actions (settings/profile)
  • No automated end-to-end or hardware-in-the-loop test suite

Prerequisites

  • Node.js 18+ and npm
  • Flutter SDK 3.9+
  • Android Studio or VS Code with Flutter tooling
  • ESP32 board support in Arduino IDE
  • nRF24L01 module and matching wiring for the hardware sketch

Local development setup

1) Backend API

cd backend
npm install
npm start

Runs on http://localhost:8000.

2) Admin dashboard

cd admin-frontend
npm install
npm start

Runs on http://localhost:3000 and reads from http://localhost:8000/api/sos.

3) Mobile app

cd mobileapp
flutter pub get
dart run build_runner build

Create mobileapp/.env from mobileapp/.env.example, then run:

flutter run

For Android emulator, keep API_HOST=10.0.2.2.

4) Hardware firmware

Open hardware/stresso-hardware/stresso-hardware.ino in Arduino IDE, install required libraries (ESP32 BLE, RF24), and flash to your board with the nRF24L01 connected to the pins defined in the sketch.

Deployment notes

Backend

  • Deploy as a Node web service with npm ci && npm start
  • Persist stresso.db on durable storage or migrate to managed PostgreSQL
  • Move JWT secret and port to environment variables before public deployment

Admin frontend

  • Build with npm run build
  • Serve static files from Netlify, Vercel, S3+CloudFront, or Nginx
  • Replace hardcoded API URL with an environment-based config

Mobile app

  • Keep API values in .env per environment
  • Build release APK/AAB with Flutter toolchain
  • Use HTTPS backend endpoints for release builds

Hardware

  • Keep BLE service/characteristic UUIDs aligned with mobile app constants
  • Validate RF channel and power settings in your target environment

API surface (backend)

  • POST /api/users/register
  • POST /api/users/login
  • GET /api/users/profile
  • PUT /api/users/profile
  • POST /api/sos
  • POST /api/sos/nearby
  • GET /api/sos
  • POST /api/emergency-contacts
  • GET /api/emergency-contacts

About

a distress beacon

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors