A community-based safety platform for public transportation in Kanpur. SafeComm helps users make informed decisions about their daily commutes through real-time vehicle tracking, crowdsourced safety ratings, and incident reporting.
- Frontend — https://safecomm-transportation.vercel.app
- Backend API — https://safecomm-api.onrender.com
- 🔐 JWT Authentication — Secure user registration and login
- 🗺️ Real-Time Vehicle Tracking — Live tracking of buses, metros and autos on Google Maps via Socket.io
- ⭐ Route Safety Ratings — Users can rate routes based on personal experiences
- 🚨 Incident Reporting — Report unsafe situations on routes in real-time
- 🔒 Role-Based Access Control — Separate access for users and admins
- 🔍 Initial Route Safety Consultation — When selecting a route, the system suggests similar routes ranked by safety score
- 📊 Admin Dashboard — Data visualizations with charts showing safety scores and incident statistics
- ⚡ Real-Time Updates — Live vehicle location updates using Socket.io
- Node.js + Express.js
- MongoDB + Mongoose
- Socket.io
- JWT + bcryptjs
- Google Maps Platform
- React + Vite
- Tailwind CSS
- Framer Motion
- Google Maps JavaScript API
- Recharts
- Axios + Socket.io-client
SafeComm-Transportation/
├── backend/
│ ├── config/ # Database configuration
│ ├── controllers/ # Route handler logic
│ ├── middleware/ # Auth and RBAC middleware
│ ├── models/ # Mongoose schemas
│ ├── routes/ # Express routers
│ ├── sockets/ # Socket.io handlers
│ ├── seed.js # Database seeder
│ └── server.js # Entry point
├── frontend/
│ ├── src/
│ │ ├── api/ # Axios configuration
│ │ ├── components/ # Reusable components
│ │ └── pages/ # Page components
│ └── index.html
└── README.md
- Node.js v18+
- MongoDB Atlas account
- Google Maps API Key
cd backend
npm installCreate .env file in backend:
PORT=5000
MONGO_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secretRun the server:
npm run devSeed the database:
npm run seedcd frontend
npm installCreate .env file in frontend:
VITE_GOOGLE_MAPS_API_KEY=your_google_maps_api_keyRun the frontend:
npm run dev| Role | Access |
|---|---|
| User | View map, rate routes, report incidents, view similar routes |
| Admin | All user access + dashboard with charts and stats |
/— Home page with live Google Maps vehicle tracking/routes— All transit routes with safety scores/routes/:id— Route details, ratings, similar routes and incident reporting/admin— Admin dashboard with data visualizations/login— User login/register— User registration
| Variable | Description |
|---|---|
PORT |
Server port (default: 5000) |
MONGO_URI |
MongoDB Atlas connection string |
JWT_SECRET |
Secret key for JWT tokens |
| Variable | Description |
|---|---|
VITE_GOOGLE_MAPS_API_KEY |
Google Maps JavaScript API key |
Made by Om Omer