"Turning Chaos into Order." An AI-powered command center that synthesizes unstructured real-time data into actionable intelligence for emergency response.
CrowdGuard is a sophisticated crowd management and situational awareness platform designed for large venues. It utilizes the internal Aegis AI Engine (powered by Google Gemini) to analyze real-time surveillance feeds, detect anomalies, and coordinate emergency response units via a live, interactive dashboard.
In critical moments following a disaster, control rooms face:
- Information Overload: Thousands of panic calls and social posts.
- Unstructured Data: Hard-to-map images, voice recordings, and text.
- Slow Response: Manual verification delays critical dispatch decisions.
CrowdGuard acts as a "Central Nervous System," instantly analyzing incoming media to extract geolocation and severity, visualizing threats on a heatmap, and automating unit dispatch.
- Real-time Map: Interactive SVG-based stadium map utilizing Leaflet and WebSockets for sub-second updates.
- Unit Tracking: Live GPS-style tracking of stewards, medics, drones, and police units.
- Heatmap Overlay: Thermography mode to visualize crowd density and risk levels dynamically.
- Forensic Breakdown: Analyzes CCTV images to identify specific threats (e.g., "Smoke plume," "Crushing").
- Risk Scoring: Automatically rates incidents (Safe, Moderate, Critical) and calculates density scores (1-10).
- Strategic Recommendations: AI generates actionable containment strategies (e.g., "Close Gate NE," "Deploy Medic to Section B").
- One-Click Deploy: Assign the nearest available unit to an incident directly from the map.
- Automated Reporting: Generate comprehensive executive situation reports summarizing all active zones.
- Public Advisory: AI drafts context-aware emergency alerts for public broadcast.
- Feed Injector: A dedicated interface to simulate crowd reports, inject mock CCTV imagery, and test system responsiveness without real-world chaos.
- Framework: React 18 + Vite
- Styling: Tailwind CSS + Framer Motion (Animations)
- Mapping: Leaflet Maps (React-Leaflet) + Custom SVG Overlays
- Icons: Lucide React
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB (Atlas) via Mongoose
- Real-Time: Socket.io (Bi-directional communication)
- Model: Google Gemini 2.0 Flash (via
@google/genaiSDK) - Engine: Aegis Crowd Analysis AI
- Node.js (v18 or higher)
- MongoDB Atlas Account (Connection String)
- Google Gemini API Key (Get one at Google AI Studio)
git clone https://github.com/your-username/crowdguard.git
cd crowdguard
Navigate to the server directory and install dependencies:
cd server
npm install
Create a .env file in the server folder with the following variables:
PORT=3001
MONGO_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/aegis_db
GEMINI_API_KEY=your_google_gemini_api_key
Start the backend server:
npm run dev
# Server will run on http://localhost:3001
Open a new terminal, navigate to the client directory, and install dependencies:
cd client
npm install
Create a .env file in the client folder (optional if running locally on default ports):
VITE_API_URL=http://localhost:3001
Start the frontend development server:
npm run dev
# Client will run on http://localhost:5173
- Launch the Dashboard: Open
http://localhost:5173/dashboard. - Launch the Simulator: Open
http://localhost:5173/injectin a separate tab. - Simulate an Incident:
- Use the Feed Injector to upload an image of a crowd.
- Add a text description (e.g., "People pushing near North Gate").
- Click "Analyze & Inject".
- Monitor & Respond:
- Watch the Dashboard as the AI processes the data.
- A red alert marker will appear on the map.
- Click the marker to view AI analysis.
- Click a nearby "Idle" unit to Deploy them to the scene.
The backend exposes the following RESTful endpoints:
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/analyze |
Process image/text context via Gemini AI |
POST |
/api/generate-report |
Generate a venue-wide situation report |
GET |
/api/incidents |
Fetch all active incidents |
POST |
/api/incidents |
Manually create an incident |
GET |
/api/units |
Fetch all response units |
POST |
/api/units/deploy |
Update unit status and location |
POST |
/api/reset |
Clear all incidents and reset units |
- Fork the repository.
- Create a new branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Distributed under the MIT License. See LICENSE for more information.