Project Name & Team Members SafeNet.AI Team: Solo Developer – Shubham Kumbhar
SafeNet.AI is a next-generation civic safety intelligence platform that leverages AI, real-time data, and community reporting to provide actionable insights, threat analysis, and live incident mapping for public safety and emergency response.
- Incident Reporting: Citizens can report incidents (crime, emergencies, suspicious activity, etc.) with location, description, and media uploads.
- AI Threat Analysis: Automated threat assessment, severity scoring, and tag extraction for incidents and news using AI.
- Live Safety Map: Interactive Mapbox map with clustering, heatmaps, and advanced filtering (type, severity, time, source).
- News Aggregation: Real-time safety and crime news feed with AI-powered analysis and categorization.
- Intelligence Dashboard: Visual analytics, trends, and pattern recognition for authorities and the public.
- Gemini AI Chatbot: Google Gemini-powered assistant for emergency guidance, safety tips, and general queries.
- Backend API: Node.js/Express server with MongoDB for incident storage, file uploads, and Gemini AI proxying.
SafenetAI/
project/
src/
components/ # Reusable UI components (charts, cards, map, etc.)
context/ # React context for global state (incidents, news)
pages/ # Main app pages (Dashboard, Map, NewsFeed, etc.)
services/ # API and AI service integrations
types/ # TypeScript types and interfaces
utils/ # Utility functions
index.css # Tailwind CSS entry
App.tsx # Main app component (routing)
main.tsx # App entry point
public/
package.json # Frontend dependencies and scripts
...
server/
index.js # Express backend (API, uploads, Gemini proxy)
uploads/ # Uploaded incident images
README.md # Project documentation (this file)
- Framework: React 18, TypeScript, Vite
- Styling: Tailwind CSS, PostCSS, Autoprefixer
- Routing: React Router v6
- Map: Mapbox GL JS, react-map-gl, supercluster (clustering)
- AI Integration: Google Gemini API (for chatbot, suggestions, analysis)
- State Management: React Context API
- Charts & UI: Custom components, Lucide icons
- Dashboard: Overview, stats, recent incidents, threat map, safety tips
- Report Incident: Form for submitting new incidents (with AI suggestions)
- Map: Interactive map with filters, heatmap, clustering, and popups
- News Feed: Live news with search, category filter, and AI analysis
- Intelligence: AI-powered analytics, threat trends, and pattern recognition
- Chatbot: Gemini AI assistant for safety guidance and Q&A
- API Endpoints:
POST /api/reports— Create a new incident reportGET /api/reports— Fetch all incident reportsPOST /api/reports/upload— Upload images for incidentsPOST /api/gemini— Proxy to Google Gemini for AI analysis
- Database: MongoDB (Mongoose schema for reports)
- File Uploads: Multer (uploads stored in
server/uploads/) - CORS: Enabled for local development
- Environment:
.envfor MongoDB URI and Gemini API key
git clone <repo-url>
cd SafenetAI/project# Frontend
npm i
# Backend
cd ../server
npm iCreate a .env file in both project/ and server/:
VITE_GNEWS_API_KEY=your_gnews_api_key
VITE_GNEWS_API_BASE_URL=https://gnews.io/api/v4
VITE_MAPBOX_ACCESS_TOKEN=your_mapbox_token
VITE_GEMINI_API_KEY=your_gemini_api_key
MONGO_URI=mongodb://localhost:27017/safenetai
GEMINI_API_KEY=your_gemini_api_key
cd server
node index.js
# or use nodemon for auto-reloadcd project
npm run dev- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
- Google Gemini: Used for chatbot, incident suggestions, and threat analysis (API key required)
- GNews API: For real-time safety and crime news (API key required)
- Mapbox: For interactive map and geospatial features (API key required)
- Do not share sensitive personal information in reports or chatbot.
- All incident data is stored securely in MongoDB and images in the server uploads folder.
- API keys should never be committed to version control.
- Fork the repo and create a feature branch.
- Make your changes (with clear commits and comments).
- Test thoroughly (frontend and backend).
- Submit a pull request with a detailed description.
This project is for educational and civic tech purposes. See LICENSE for details.