Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RescueLink

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

What's the need for this?

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.

How does this work?

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"

How does it discover peers/other devices if offline?

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).

Files description

  • 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 to logs/messages.log as a recovery backup.
  • src/main/java/com/rescuelink/controller/WebSocketController.java :- STOMP @MessageMapping handler 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.

Frontend UI

  • Created using React
  • Can be used to send messages, SOS alerts, medical alerts and location pings via GUI.
  • Code can be found inside /frontend folder.

frontend

Commands to run on your local system.

Steps to start backend

  • Go to the root /RescueLink folder
  • 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

Steps to start frontend

  • Go to /frontend
  • Type command
npm install
npm run dev
  • Open http://localhost:5173 in your browser.

Steps to run on another device on the same LAN

  • 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).

To run backend tests

mvn clean test

Created by - Yash Magarde

About

An emergency communication system that works totally without internet!

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages