Full Stack Development

Geo-Guardian

Real-time danger zone management platform

Geo-Guardian

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

01.

Draw and modify custom danger zones using an interactive Leaflet Draw polygon interface.

02.

Real-time GPS coordinate logging and location searching utilizing Nominatim API integration.

03.

Sub-100ms toast notifications and alerts triggered on mobile boundary breaches via Socket.io Client.

Code Implementation

implementation_module.jsjavascript
// 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

ReactViteLeafletReact LeafletLeaflet DrawSocket.io ClientAxiosTailwind CSSNode.jsExpress.jsMongoDB

Architecture Stack

1React & Leaflet UI

Renders interactive maps, allows administrators to draw danger zone boundaries, and handles Nominatim search.

2Socket.io Bridge

Coordinates live, bi-directional socket relays between admin dashboards and the mobile client ecosystem.

3Node.js & Express API

Processes REST endpoints, validates inputs, and queries geospatial datasets.

4MongoDB Atlas (2dsphere)

Stores coordinates as GeoJSON polygons with 2dsphere indexes for rapid distance/point intersections.