Skip to content

Naeem404/Flare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”₯ FLARE - Emergency Rescue Beacon

Turn any smartphone into a rescue beacon. When disaster strikes and someone is trapped, they press one button - their phone becomes a homing signal.

License: MIT

πŸ“± The Core Concept

FLARE turns any smartphone into a rescue beacon. When disaster strikes and someone is trapped, they press one button - their phone becomes a homing signal. Rescuers follow the signal like a treasure hunt, with real-time distance updates and a heat map showing safe paths around obstacles.

No GPS, no internet, no special equipment needed. Just Bluetooth waves and smart navigation.

🎯 The Problem We're Solving

During disasters (earthquakes, building collapses, floods):

  • Cell towers are down - no calls or texts
  • GPS doesn't work indoors or under rubble
  • Rescuers can't locate victims who are:
    • Unconscious and can't call for help
    • Buried under debris
    • Lost and don't know their own location
    • Children who can't describe where they are

FLARE solves the problem: FINDING people who can't communicate.

πŸ’‘ Our Solution

Two-sided app system:

Victim Side (SOS Beacon):

  • One-tap SOS button
  • Phone becomes a continuous Bluetooth/WiFi beacon
  • Works even if victim is unconscious (just needs to be turned on once)
  • Broadcasts device ID + battery status

Rescuer Side (Navigator):

  • Detects all SOS beacons in range
  • Shows distance to each victim (using signal strength)
  • Provides directional navigation ("hot/cold" guidance)
  • 2D Heat Map showing safe paths vs obstacles
  • AR View (optional) with 3D markers overlaid on camera

πŸ”§ Key Technologies

Technology Range Accuracy Purpose
Bluetooth LE ~100m Β±3-5m Primary victim detection
WiFi Direct ~200m Β±2-4m Extended range detection
UWB (if available) ~50m Β±10-30cm High-precision positioning

RSSI-Based Distance Estimation

  • RSSI = Received Signal Strength Indicator
  • Stronger signal = closer to victim
  • Formula converts signal strength β†’ approximate distance
  • Updates in real-time as rescuer moves

Movement-Based Direction Finding

Rescuer walks 5 meters β†’
Signal got stronger? β†’ "Keep going this direction βœ“"
Signal got weaker? β†’ "Turn around β†Ί"

Obstacle Detection

We detect obstacles WITHOUT imaging by analyzing signal patterns:

  • 🟒 GREEN = Clear path (strong, stable signal)
  • 🟑 YELLOW = Unstable area (fluctuating signal)
  • πŸ”΄ RED = Obstacle detected (sudden signal drop)

🎨 User Interface

View 1: Radar Screen

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   🎯 FLARE SCANNER      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚        )))))))          β”‚
β”‚       )))))))           β”‚
β”‚      βŠ™  πŸ‘€  Victim A    β”‚
β”‚         ↑ 12m away      β”‚
β”‚  Signal: β–“β–“β–“β–“β–“β–“β–‘β–‘β–‘β–‘    β”‚
β”‚  Battery: 42%           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

View 2: Heat Map Navigator

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   πŸ—ΊοΈ HEAT MAP          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  πŸŸ’πŸŸ’πŸŸ’πŸ”΄πŸ”΄            β”‚
β”‚  πŸŸ’πŸŸ’πŸ”΄πŸ”΄πŸ”΄            β”‚
β”‚  🟒YOUπŸŸ’πŸŸ‘πŸ”΄           β”‚
β”‚  πŸŸ’πŸŸ’πŸŸ’πŸŸ’πŸ“ Victim    β”‚
β”‚  Safe path detected β†’  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Three Use Cases

  1. PUBLIC EMERGENCIES (Earthquake/Disaster)

    • Anyone can send SOS
    • Anyone can help locate victims
    • Trigger: Triple power button press
  2. PROFESSIONAL RESCUE (Fire/Police/EMT)

    • Certified rescuers only
    • Connects to emergency dispatch systems
    • Trigger: Long press + Volume Down
  3. PRIVATE GROUPS (Hiking/Outdoors)

    • Pre-formed groups of friends/family
    • Only group members see each other
    • Trigger: In-app button

πŸ“ Project Structure

Flare/
β”œβ”€β”€ src/                          # React Native Mobile App
β”‚   β”œβ”€β”€ screens/
β”‚   β”‚   β”œβ”€β”€ HomeScreen.js         # Main entry with mode selection
β”‚   β”‚   β”œβ”€β”€ VictimScreen.js       # SOS beacon activation
β”‚   β”‚   β”œβ”€β”€ RescuerScreen.js      # Radar/scanner view
β”‚   β”‚   β”œβ”€β”€ HeatMapScreen.js      # 2D heat map navigator
β”‚   β”‚   β”œβ”€β”€ ARViewScreen.js       # AR camera view
β”‚   β”‚   β”œβ”€β”€ SettingsScreen.js     # App configuration
β”‚   β”‚   β”œβ”€β”€ GroupScreen.js        # Private groups
β”‚   β”‚   └── ProfessionalModeScreen.js
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ BluetoothService.js   # BLE P2P logic
β”‚   β”‚   β”œβ”€β”€ WiFiService.js        # WiFi Direct
β”‚   β”‚   β”œβ”€β”€ SupabaseService.js    # Cloud sync
β”‚   β”‚   β”œβ”€β”€ NavigationService.js  # Distance/direction calc
β”‚   β”‚   └── HeatMapService.js     # Obstacle detection
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ BeaconCard.js         # Victim card UI
β”‚   β”‚   β”œβ”€β”€ HeatMapCanvas.js      # Heat map visualization
β”‚   β”‚   β”œβ”€β”€ RadarView.js          # Radar screen
β”‚   β”‚   └── SignalStrength.js     # Signal indicator
β”‚   β”œβ”€β”€ context/
β”‚   β”‚   β”œβ”€β”€ AppContext.js         # Global state
β”‚   β”‚   └── BluetoothContext.js   # Bluetooth state
β”‚   └── utils/
β”‚       β”œβ”€β”€ rssiCalculator.js     # RSSI β†’ distance
β”‚       └── constants.js          # App constants
β”‚
└── flare_backend/                # Django REST API
    β”œβ”€β”€ api/
    β”‚   β”œβ”€β”€ models.py             # Data models
    β”‚   β”œβ”€β”€ serializers.py        # JSON serialization
    β”‚   β”œβ”€β”€ views.py              # API endpoints
    β”‚   └── urls.py               # API routes
    β”œβ”€β”€ flare_backend/
    β”‚   β”œβ”€β”€ settings.py           # Django config
    β”‚   └── urls.py               # URL routing
    └── requirements.txt

πŸ› οΈ Quick Start

Backend Setup

# Navigate to backend
cd flare_backend

# Create virtual environment
python -m venv venv
venv\Scripts\activate  # Windows
source venv/bin/activate  # macOS/Linux

# Install dependencies
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# Edit .env with your settings

# Run migrations
python manage.py migrate

# Start server
python manage.py runserver

API available at: http://localhost:8000/api/

Mobile App Setup

# Navigate to mobile app
cd src

# Install dependencies
npm install

# iOS only
cd ios && pod install && cd ..

# Run on Android
npm run android

# Run on iOS
npm run ios

πŸ”‘ Environment Configuration

Backend (.env)

SECRET_KEY=your-secret-key
DEBUG=True
DATABASE_URL=postgresql://...  # Optional, uses SQLite by default
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-anon-key

Mobile App

Update Supabase credentials in src/services/SupabaseService.js

πŸ“± Required Permissions

Android

  • Bluetooth (Scan, Connect, Advertise)
  • Location (Fine)
  • WiFi State

iOS

  • Bluetooth
  • Location When In Use
  • Camera (for AR view)

βœ… Key Features Checklist

  • One-tap SOS beacon activation
  • Bluetooth LE beacon broadcasting
  • Real-time beacon scanning
  • RSSI-based distance estimation
  • Navigation guidance (hot/cold)
  • 2D Heat Map visualization
  • Obstacle detection via signal analysis
  • Private groups with join codes
  • Professional rescuer mode
  • Battery priority sorting
  • Offline-first architecture
  • Cloud sync when available
  • AR View (stretch goal - UI ready)

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    Bluetooth P2P    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Victim    │◄───────────────────►│  Rescuer    β”‚
β”‚  Mobile App β”‚                     β”‚  Mobile App β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜                     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚                                   β”‚
       β”‚      (when internet available)    β”‚
       β”‚                                   β”‚
       └────────► Supabase β—„β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      ↕
              Django REST API

P2P is primary, cloud sync is secondary.

πŸ“„ License

MIT License - see LICENSE file.

🀝 Contributing

Contributions welcome! Please read our contributing guidelines first.


FLARE - Because every second counts in an emergency.

About

A proximity-based mutual aid network for moments when systems fail and communities step up.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors