Skip to content

About

StreetPulse addresses a critical yet overlooked problem faced by gig workers such as delivery riders, drivers, and field technicians who navigate unfamiliar urban areas, especially at night. While existing navigation tools like maps optimize routes for speed and efficiency, they completely ignore real-time safety conditions. This leaves millions of

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

⚡ StreetPulse: Real-Time Behavioral Safety Engine

🏆 Developed for Hackathon 2026 — Naresh IT

A collective intelligence platform that detects human discomfort and environmental hazards using real-time map movement analysis and community reporting.

StreetPulse transforms passive GPS data into a live interactive safety map, identifying anomalies like:

  • Sudden speed drops
  • Unusual reroutes
  • Hesitation patterns

These signals are combined with user-reported dangers to generate dynamic risk scores in real time.


🚀 Key Highlights

  • 🧠 Collective Intelligence-based safety detection
  • 📊 Real-time dynamic risk scoring (0–100)
  • 🗺️ Safe route recommendation (SafeNav)
  • ⚡ Live updates using WebSockets
  • 🆘 Emergency SOS (no paid SMS needed)
  • 🔒 Privacy-first (no personal data stored)

📸 Application Overview

1. Live Dashboard — Main Map

  • Full-screen interactive dark map (Leaflet.js)
  • H3 hexagonal zones showing risk levels
  • Real-time user location tracking
  • Floating action buttons (SOS + Danger Report)
  • Live statistics panel

2. Risk Zones (Hexagons)

Level Color Score Range Meaning
🟢 Safe Green 0–33 Normal movement
🟡 Caution Amber 34–66 Moderate anomalies
🔴 High Risk Red 67–100 Dangerous zone

Clicking a zone shows: Risk Score: 45/100
Slowdowns: 3
Reroutes: 1
Danger Reports: 2
Users: 4


3. SafeNav — Route Safety

  • Search destination using OpenStreetMap
  • Route generated via OSRM
  • Route is analyzed against risk zones
Status Meaning
✅ Safe No risky zones
⚠️ Caution Passes caution zones
🚨 High Risk Passes danger zones

4. Real-Time Alerts

  • Triggered when entering risky zones
  • Auto-dismiss in 6 seconds
  • Context-aware messages

Example: 🚨 High Risk Zone
Multiple users slowed down here recently


5. SOS Emergency Feature

  • One-tap emergency sharing
  • Uses Web Share API
  • Works with WhatsApp, Messages, etc.

6. Danger Report System

  • One-tap unsafe location reporting
  • Instant risk recalculation
  • WebSocket broadcast to all users
  • Anti-spam protection (rate limiting)

7. Live Risk Panel

Displays:

  • Active zones
  • Risk distribution
  • Connection status

🏗️ Tech Stack

Frontend

  • React 18
  • TypeScript
  • Vite
  • Leaflet.js
  • H3-js
  • Socket.io Client

Backend

  • Node.js
  • Express.js
  • PostgreSQL + PostGIS
  • Redis (optional)
  • Socket.io

Infrastructure

  • Render (hosting)
  • PostgreSQL (cloud DB)

🧠 System Architecture

  • Client captures GPS and sends signals
  • Server processes anomalies and computes risk
  • Database stores geo and risk data
  • WebSocket provides real-time updates

🔄 Core Workflow

1. Passive Tracking

  • GPS data collected
  • Sent every 5 seconds
  • Anomalies detected

2. Risk Calculation

  • Weighted scoring
  • Trust and time factors applied
  • Classified into Safe / Caution / High Risk

3. Real-Time Updates

  • Broadcast via WebSockets
  • Map updates instantly

4. Data Decay

  • Old data auto-deleted
  • Risk recalculated every 2 minutes

🧮 Risk Scoring Logic (Simplified)

Risk Score = Speed Drops + Reroutes + Danger Reports + Time Factor
→ Adjusted using Trust + Multi-user signals
→ Normalized to 0–100


🔐 Privacy & Security

  • No login required
  • Anonymous session IDs
  • SHA-256 hashing
  • Data auto-deletes after 15 minutes
  • Rate limiting enabled

🌐 API Endpoints

POST /api/signals → Send GPS data
POST /api/danger-tap → Report unsafe area
POST /api/alerts/check-location
GET /api/alerts/active-risks
GET /api/health


🗃️ Database Tables

  • raw_signals
  • anomalies
  • danger_taps
  • geo_cells
  • user_trust

⚙️ Setup Instructions

Clone repo

git clone

Install backend

cd server npm install

Install frontend

cd ../client npm install


▶️ Run Project

Backend

cd server npm run dev

Frontend

cd client npm run dev


🚢 Deployment (Render)

Backend:

  • Build: npm install && npm run build
  • Start: npm start

Frontend:

  • Build: npm run build
  • Publish: client/dist

🌟 Features Summary

Feature Description
🧠 Collective Intelligence Multi-user safety detection
📊 Risk Scoring Dynamic safety levels
🛡️ Trust Engine Prevents fake reports
🆘 SOS Emergency sharing
⚡ Real-time Updates Instant map refresh
🗺️ SafeNav Safe route suggestions
🔒 Privacy No personal data
🌙 Night Mode Risk increases at night
♻️ Auto Decay Self-healing system

💡 Final Note

StreetPulse is not just a map — it’s a real-time safety intelligence system powered by people.

⚡ Engineered for safer communities.

About

StreetPulse addresses a critical yet overlooked problem faced by gig workers such as delivery riders, drivers, and field technicians who navigate unfamiliar urban areas, especially at night. While existing navigation tools like maps optimize routes for speed and efficiency, they completely ignore real-time safety conditions. This leaves millions of

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages