How cadornajansen/glove-system works
Purpose and Topology
Glove System is a healthcare-IoT research prototype for stroke rehabilitation monitoring. An Arduino glove gathers flex, vital, and gesture signals; Bluetooth delivers them to a local Node.js process, which exposes WebSocket updates consumed by a Next.js dashboard. The browser UI is deployable to Vercel, but the hardware bridge remains local to the Bluetooth-connected machine.
Application Entry and Routing
The Next.js App Router starts at app/layout.tsx and app/page.tsx. The primary live-monitor/dashboard experience is represented by app/dashboard/page.tsx; the product also presents healthcare workflow sections through route pages including app/analytics/page.tsx, app/calendar/page.tsx, and app/care-plants/page.tsx.
Hardware Ingestion and Bridge
glove-bridge/bridge.js is the boundary between physical hardware and the web system. It receives Bluetooth/serial-originated Arduino data, cleans/parses it into JSON, and forwards it over WebSocket. This process has its own Node runtime and dependency boundary in glove-bridge/package.json; it must run separately from the Next.js deployment and have access to the HC-05 Bluetooth connection.
Live Client Data Layer
lib/use-glove-data.ts is the browser-facing real-time integration point. Dashboard pages/components consume this hook’s live sensor/command state and connection status rather than directly handling hardware transport. This separates UI rendering from WebSocket lifecycle and payload interpretation.
Monitoring and Clinical UI Surfaces
The live dashboard is complemented by patient-facing information and operational views: app/records/page.tsx, app/records/vitals/page.tsx, app/medication/today/page.tsx, app/tasks/page.tsx, and report routes under app/reports. These appear to be dashboard UI workflow boundaries; no repository evidence establishes durable patient/history storage, so live and displayed data should be treated as client/UI-oriented unless a backend is added.
Shared Application Shell
components/app-sidebar.tsx, components/page-shell.tsx, and components/sidebar.tsx define the cross-route healthcare navigation and layout boundary. Navigation composition is split into components/nav-main.tsx, components/nav-secondary.tsx, and components/nav-user.tsx. Reusable shadcn-style controls under components/ui/ keep route pages focused on monitoring/workflow composition.
API, Runtimes, and Deployment Boundaries
app/api/vitals.ts is the repository’s explicit Next-side vitals API surface. The web application uses Next.js/TypeScript and Tailwind/shadcn UI, configured from package.json and next.config.ts; Vercel is the documented web deployment target. Arduino Uno, flex sensors, MAX30102, LM35, and HC-05 Bluetooth are external physical dependencies. The local Node/WebSocket bridge is required for true live glove telemetry and cannot be replaced by the static hosted frontend alone.
Main entry points: layout.tsx Application shell · bridge.js Telemetry bridge · dashboard/page.tsx Live dashboard · records/page.tsx Clinical workflow routes
Components 15
Rehab glove hardware
Physical telemetry source.
- Arduino glove · Collects flex, vital, and gesture signals.
- Sensors · Flex sensors, MAX30102, and LM35 feed the glove.
- HC-05 Bluetooth
Local telemetry bridge
Must run on the Bluetooth-connected machine.
- Node bridge runtime · Separately deployed hardware integration runtime.
glove-bridge/package.json - Telemetry bridge · Cleans Arduino input into JSON and publishes live updates.
glove-bridge/bridge.js - WebSocket stream
Next.js web application
Dashboard and healthcare workflow UI.
- Application shell · Provides shared route structure.
app/layout.tsx - Home route
app/page.tsx - Glove data hook · Owns WebSocket lifecycle, payload interpretation, and connection state.
lib/use-glove-data.ts - Live dashboard · Consumes live sensor and command state through the hook.
app/dashboard/page.tsx - Clinical workflow routes · Records, vitals, medication, tasks, reports, analytics, calendar, and care plans.
app/records/page.tsx - Vitals API
app/api/vitals.ts - Shared navigation · Healthcare sidebar and page-shell composition.
components/app-sidebar.tsx - Reusable UI controls
components/ui/button.tsx
Other components
- Vercel deployment · Hosts the frontend but not the Bluetooth bridge.
Connections 16
- Sensors → Arduino glove: measurements
- Arduino glove → HC-05 Bluetooth: serial telemetry
- HC-05 Bluetooth → Telemetry bridge: Bluetooth input
- Node bridge runtime → Telemetry bridge: runs
- Telemetry bridge → WebSocket stream: JSON updates
- WebSocket stream → Glove data hook: live messages
- Glove data hook → Live dashboard: sensor state
- Application shell → Home route: wraps
- Application shell → Live dashboard: wraps
- Application shell → Clinical workflow routes: wraps
- Shared navigation → Application shell: composes
- Reusable UI controls → Live dashboard: supports
- Reusable UI controls → Clinical workflow routes: supports
- Vitals API → Clinical workflow routes: vitals surface
- Vercel deployment → Application shell: deploys web UI
- Vercel deployment → Telemetry bridge: does not host · Live telemetry still requires the local bridge.