An offline-first, LAN-based emergency communication system built to communicate in disaster-prone areas where there is no connectivity to the internet.
Demo video
In areas hit with natural disasters tend to have no internet connectivity. Using this system, any number of devices (the rescue team or the civilians) can communicate with each other as long as they are connected to a same network via wifi/hotspot/ethernet LAN.
It uses Spring Boot WebSocket (STOMP) to establish peer-2-peer connections. Creates a unified Emergency Operations feed, allowing multiple users to broadcast messages, SOS alerts, medical alerts and location pings to everyone on the same LAN.
Each node broadcasts its presence via mDNS on the LAN, allowing peers to discover each other automatically.
The default room is defined in src/main/resources/application.yml like this:
rescuelink:
node:
room: "main-room"It uses MDNS (Multicast DNS) via the JmDNS library to discover peers in the same LAN network.
Its implementation is given in /src/main/java/com/rescuelink/discovery/MdnsDiscoveryService.java
Brief explanation about MDNS
Multicast DNS (mDNS) is a computer networking protocol that resolves hostnames to IP addresses within small networks that do not include a local name server. It is a zero-configuration service, using essentially the same programming interfaces, packet formats and operating semantics as unicast Domain Name System (DNS).
src/main/java/com/rescuelink/RescueLinkApplication.java:- Main entry point to start the Spring Boot server.src/main/java/com/rescuelink/config/WebSocketConfig.java:- Configures STOMP WebSocket broker and endpoints.src/main/java/com/rescuelink/config/CorsConfig.java:- Global CORS configuration for frontend-backend communication.src/main/java/com/rescuelink/config/AppConfig.java:- App-level beans including unique node ID and Jackson ObjectMapper.src/main/java/com/rescuelink/discovery/MdnsDiscoveryService.java:- JmDNS mDNS implementation for LAN peer discovery.src/main/java/com/rescuelink/discovery/PeerRegistry.java:- In-memory store for all discovered LAN peers.src/main/java/com/rescuelink/messaging/ChatRoomService.java:- Handles message storage, broadcasting and room management.src/main/java/com/rescuelink/messaging/MessageLogService.java:- Records all messages tologs/messages.logas a recovery backup.src/main/java/com/rescuelink/controller/WebSocketController.java:- STOMP@MessageMappinghandler for real-time message routing.src/main/java/com/rescuelink/controller/MessageController.java:- REST API:POST /api/send,GET /api/messages.src/main/java/com/rescuelink/controller/PeerController.java:- REST API:GET /api/peers— returns discovered LAN peers.src/main/java/com/rescuelink/model/ChatMessage.java:- DTO for all emergency messages.src/main/java/com/rescuelink/model/PeerInfo.java:- Metadata model for discovered peers.logs/messages.log:- Records all messages as a recovery backup.
- Created using React
- Can be used to send messages, SOS alerts, medical alerts and location pings via GUI.
- Code can be found inside
/frontendfolder.
- Go to the root
/RescueLinkfolder - Optionally customize your node configuration in
src/main/resources/application.yml - Run command
mvn spring-boot:run- Backend starts at
http://localhost:8080 - WebSocket endpoint at
ws://localhost:8080/ws
- Go to
/frontend - Type command
npm install
npm run dev- Open
http://localhost:5173in your browser.
- Make sure both devices are connected to the same WiFi / Hotspot / Ethernet LAN.
- Start the backend on one device.
- On the second device, open a browser and navigate to
http://<first-device-ip>:8080(replace with the actual LAN IP shown in the backend logs). - Both devices will communicate seamlessly across the LAN.
- Start communicating by sending messages or using the Quick Broadcast buttons (SOS / Medical / Location Ping).
mvn clean testCreated by - Yash Magarde
