Geo-Guardian
Real-time danger zone management platform

The Challenge
Managing danger zones on physical maps and broadcasting real-time safety alerts to tourists and operators requires a robust bidirectional socket bridge and high-performance spatial calculation indices.
Engineering Solution
Created a React + Leaflet control panel integrated with Leaflet Draw for active polygon editing, bound to a Node.js + Express backend. Submissions utilize geospatial index structures in MongoDB Atlas (2dsphere index) to compute coordinate proximity and push triggers instantly via Socket.io.
Key Product Capabilities
Draw and modify custom danger zones using an interactive Leaflet Draw polygon interface.
Real-time GPS coordinate logging and location searching utilizing Nominatim API integration.
Sub-100ms toast notifications and alerts triggered on mobile boundary breaches via Socket.io Client.
Code Implementation
// Express endpoint to check if a user is inside any danger zone using MongoDB 2dsphere index
const Zone = require('../models/Zone');
router.post('/check-location', async (req, res) => {
const { longitude, latitude } = req.body;
try {
const activeZone = await Zone.findOne({
geometry: {
$geoIntersects: {
$geometry: {
type: 'Point',
coordinates: [longitude, latitude]
}
}
}
});
if (activeZone) {
return res.json({ status: 'inside', zone: activeZone.name, alert: true });
}
return res.json({ status: 'safe', alert: false });
} catch (err) {
res.status(500).json({ error: 'Geospatial calculation failed' });
}
});Technologies Used
Direct Actions
Architecture Stack
Renders interactive maps, allows administrators to draw danger zone boundaries, and handles Nominatim search.
Coordinates live, bi-directional socket relays between admin dashboards and the mobile client ecosystem.
Processes REST endpoints, validates inputs, and queries geospatial datasets.
Stores coordinates as GeoJSON polygons with 2dsphere indexes for rapid distance/point intersections.