Skip to content

Black-Relay/web-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

463 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Black Relay

Black Relay Logo

Creating a common operating picture through real-time sensor intelligence

License Build Node.js React MongoDB


🎯 Mission

When crisis strikes, information is survival. First responders need a unified view of the operational environmentβ€”sensor data, environmental readings, threat assessmentsβ€”all in real-time, all in one place.

Black Relay was born from a hackathon organized by Arrowhead Research, an organization dedicated to bridging intelligence, special operations expertise, and corporate leadership. Leveraging methodologies from former intelligence and special operations professionals, our mission is to aggregate IoT sensor data from edge devices and transform it into actionable intelligence for emergency coordinators.

Whether it's a natural disaster, hazmat situation, or tactical operation, Black Relay creates a common operating picture that helps responders make informed decisions when every second counts.


✨ Key Features

πŸ”΄ Real-Time Sensor Integration

  • MQTT-based data ingestion from edge compute sensors
  • Supports multiple sensor types: temperature, motion, air quality, gas detection, WiFi reconnaissance, and more
  • Automatic event storage and categorization

πŸ“Š Event Management & Escalation

  • Four-tier escalation system: DETECT β†’ ALERT β†’ ALARM β†’ THREAT
  • Event acknowledgment tracking
  • Historical event querying with timestamp filters
  • Flexible JSON payloads for diverse sensor data

πŸ—ΊοΈ Geographic Visualization

  • Interactive maps powered by Leaflet.js and OpenStreetMap
  • Real-time sensor location tracking
  • Situational awareness through geographic context

πŸ” Role-Based Access Control

  • Admin and analyst user roles
  • Session-based authentication with JWT
  • Secure, httpOnly cookie implementation

πŸš€ Modern Tech Stack

  • Backend: Node.js/Express with MongoDB
  • Frontend: React 19 with TypeScript, Vite, and Tailwind CSS
  • Infrastructure: Dockerized microservices, MQTT broker (Mosquitto), Caddy reverse proxy
  • Maps: Self-hosted OpenStreetMap tile server

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Edge      β”‚         β”‚    MQTT      β”‚         β”‚   Express   β”‚
β”‚  Sensors    │────────▢│   Broker     │────────▢│     API     β”‚
β”‚             β”‚  MQTT   β”‚ (Mosquitto)  β”‚  Sub    β”‚             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
                                                         β”‚
                                                         β”‚ REST API
                                                         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   React     β”‚         β”‚   MongoDB    β”‚         β”‚     OSM     β”‚
β”‚  Dashboard  │◀────────│   Database   β”‚         β”‚ Tile Server β”‚
β”‚  (Leaflet)  β”‚  Query  β”‚   (Events)   β”‚         β”‚    (Maps)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow:

  1. Edge sensors publish JSON data to MQTT topics
  2. Backend subscribes to topics and listens for messages
  3. Incoming messages automatically stored as events in MongoDB
  4. Frontend queries events via REST API
  5. Dashboard displays events with geographic context

πŸš€ Quick Start

Prerequisites

  • Docker & Docker Compose
  • Node.js 20+ (for local development)
  • npm or yarn

Development Environment

# Clone the repository
git clone https://github.com/Black-Relay/web-app
cd web-app/docker-compose/dev

# Start all services
docker compose up -d

# Access the application
# Frontend: http://localhost:5173
# API: http://localhost:3001
# API Docs: http://localhost:3001/docs

Default Login Credentials:

  • Username: admin
  • Password: admin

Seed the Database

cd api
npm run seed

Send Test Sensor Data

# Python script (requires paho-mqtt)
pip install paho-mqtt
python3 scripts/send_sensor_data.py -b mqtt://localhost:1883 -t environment_sensor

πŸ“š Documentation

Document Description
Backend Architecture API design, database schemas, ERD
Development Guide Setup instructions, workflows, commands
Session Fix Authentication persistence implementation
Nginx SPA Fix React Router production routing solution
MQTT Sender Tool Testing tool for sensor data simulation
Registry Setup GitHub Container Registry configuration

πŸ§ͺ Testing & Development

Available Test Sensor Topics

Topic Description Use Case
digital_temp Temperature monitoring Environmental conditions
motion Motion detection events Perimeter security
accelerometer Vibration/acceleration data Structural monitoring
air_quality PPM readings Hazmat situations
gas CO2/VOC detection Atmospheric hazards
optical_distance Proximity measurements Object detection
proximity_light Light sensor data Visibility assessment
kismet WiFi packet capture Network reconnaissance

Key Commands

# View MongoDB data
docker exec -it mongodb mongosh -u admin -p password

# Subscribe to MQTT topic (verify data flow)
mosquitto_sub -h localhost -p 1883 -t {topic} -v

# Run dummy data generators
cd api && npm run dummy

# Cleanup environment
docker compose down --rmi local && docker volume rm api_mongodb_data

🎨 Tech Stack

Backend

  • Node.js 20+ / Express 5
  • MongoDB 8.2 / Mongoose ODM
  • MQTT Client / Mosquitto 2.0
  • JWT Authentication
  • Swagger API Docs

Frontend

  • React 19 / TypeScript 5.8
  • Vite 7 / Tailwind CSS 4
  • React Router 7
  • Leaflet.js / React-Leaflet
  • Radix UI Components

Infrastructure

  • Docker & Docker Compose
  • Caddy (Reverse Proxy)
  • Nginx (Static Serving)
  • GitHub Actions CI/CD

Services

  • Eclipse Mosquitto (MQTT)
  • OpenStreetMap Tile Server
  • GitHub Container Registry
  • Cloudflare DNS (Production)

πŸ›£οΈ Roadmap

  • Real-time MQTT sensor integration
  • Event escalation system (DETECT β†’ ALERT β†’ ALARM β†’ THREAT)
  • Geographic visualization with maps
  • Role-based access control
  • Session persistence
  • Data visualization dashboards
  • CSV/JSON data exports
  • Historical trend analysis
  • Advanced filtering and search
  • Mobile responsiveness optimization
  • Automated testing suite

πŸ–ΌοΈ Screenshots

Click here for screenshots

🀝 Contributing

Black Relay was created during an Arrowhead Research hackathon and is actively being developed. Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • [Arrowhead Research) - For organizing the hackathon that brought this project to life
  • Code Metal - For sponsoring the project
  • Open Source Community - For the amazing tools and libraries that made this possible

πŸŽ–οΈ Built for those who run toward danger πŸŽ–οΈ

When crisis strikes, every second counts. Black Relay delivers the intelligence you need, when you need it.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •