How pratikdas-vtu/nexus works
NEXUS is an offline-first emergency and community mesh app: people report incidents, devices validate and queue them locally, then relay them opportunistically to peers and responders. Field views and an admin dashboard support situational awareness and coordination. The graph follows documented layers and sampled call sites; unsampled implementation details are represented only where the README or repository tree establishes the capability, so uncertain wiring is omitted.
Main entry points: incidentService.ts Incident Service · ServiceContext.tsx Service Context · multiTransportManager.ts Transport Manager · relayEngine.ts Relay Engine
Components 25
Field And Command
- Application Shell
frontend/src/App.tsx - Field Views
frontend/src/components - Command Dashboard
frontend/src/admin
Incident Lifecycle
- Service Context
frontend/src/context/ServiceContext.tsx - Incident Service
backend/data/incidentService.ts - Validation Schema
backend/data/schema.ts - Ingest Checks
backend/data/dedup.ts - Priority Rules
backend/data/priority.ts - Relay Outbox
backend/data/outboxService.ts - Local Incident Store
backend/data/db.ts - Incident Mapper
frontend/src/services/incidentMapper.ts
Mesh Coordination
- Network Coordinator
frontend/src/services/networkCoordinator.ts - Relay Engine
networking/relayEngine.ts - Wire Protocol
shared/protocol.ts
Peer Transports
- Transport Manager
networking/multiTransportManager.ts - Nearby Controller
frontend/src/services/nearbyMeshController.ts - WebRTC Transport
networking/webRtcTransport.ts - WebSocket Transport
networking/webSocketTransport.ts - LAN Signaling
networking/signalingClient.ts
Native Radio
- Native Bridge
networking/nativeBridge.ts - Android Plugin
android/app/src/main/java/org/nexus/mesh/NexusNativePlugin.java
Other components
- Community / Responder
- Android Radios
- Nearby Peer Devices
- Gemini API
Connections 27
- Community / Responder → Application Shell: uses
- Application Shell → Field Views: renders
- Application Shell → Command Dashboard: opens
- Field Views → Service Context: reads services
- Command Dashboard → Service Context: manages incidents
- Service Context → Incident Service: creates and updates
- Incident Service → Validation Schema: validates
- Incident Service → Priority Rules: assigns priority
- Incident Service → Ingest Checks: ingests through
- Incident Service → Local Incident Store: persists
- Incident Service → Relay Outbox: queues
- Service Context → Incident Mapper: maps incidents
- Service Context → Network Coordinator: coordinates network
- Network Coordinator → Relay Engine: starts relay
- Network Coordinator → Transport Manager: manages connections
- Relay Engine → Transport Manager: uses transports
- Relay Engine → Wire Protocol: encodes messages
- Relay Engine → Relay Outbox: syncs queued reports
- Nearby Controller → Native Bridge: calls
- Nearby Controller → Transport Manager: registers connections
- Native Bridge → Android Plugin: bridges calls
- Android Plugin → Android Radios: discovers and connects
- Android Radios → Nearby Peer Devices: links devices
- Transport Manager → WebRTC Transport: selects transport
- Transport Manager → WebSocket Transport: selects transport
- LAN Signaling → Nearby Peer Devices: coordinates sessions
- Field Views → Gemini API: requests triage