SafeComm is a community-based safety app aimed at improving public transportation. The platform tracks real-time locations of public transit vehicles, allows users to submit safety reports, and provides route safety ratings. It helps commuters make informed decisions based on real-time data and community feedback.
The goal of SafeComm is to build a backend system that manages real-time tracking of public transportation, user interactions for safety ratings, and data storage for transit and user safety reports.
- Frontend: 🚀 Live Demo
- Backend API: 🔗 API Link
SafeComm/ ├─ backend/🖥️ │ ├─ server.js │ ├─ package.json │ ├─ routes/ │ ├─ controllers/ │ ├─ models/ │ ├─ configs/ │ └─ .env ├─ frontend/🌐 │ ├─ package.json │ ├─ vite.config.js │ ├─ tailwind.config.js │ ├─ src/💻 │ │ ├─ components/ │ │ ├─ context/ │ │ ├─ pages/ │ │ └─ App.jsx │ └─ public/ └─ README.md 📄
- JWT-based user registration and login system to authenticate users securely.
- API to track public transportation vehicles in real time, using data from third-party services such as Google Maps.
- Regular users can rate routes and view transit information.
- Admins can manage transit data and monitor safety reports.
- Integration with a location API (e.g., Google Maps) to provide live updates on vehicle locations.
- Users can rate the safety of public transit routes to help others make informed travel decisions.
- Store user profiles, transit data, route ratings, and reported safety issues in MongoDB.
- Frontend: ⚛️ React.js, ⚡ Vite, 🎨 Tailwind CSS, 🖌️ Ant Design
- Backend: 🟢 Node.js, 🚂 Express.js
- Database: 🍃 MongoDB, Mongoose
- Authentication: 🔑 JWT, 🔒 Bcrypt
- APIs: 🌍 Google Maps API
- Testing: 🧪 Mocha or Jest
-
Unit and integration tests for all APIs using Mocha or Jest.
POST /auth/register– Register a new userPOST /auth/login– Login
GET /transit/live– Live transit vehicle locations (user/admin)GET /transit/arrival/:routeName– Estimated arrival times (user/admin)GET /transit/live-otd– Live vehicle data (user/admin)
POST /transit/reports– Submit a safety report (user)GET /transit/reports/user– Get user-submitted reports (user)GET /transit/reports– Get all reports (admin)
POST /ratings– Submit route rating (user/admin)GET /ratings/:routeName– Get average route rating (user/admin)
- Navigate to the backend folder and install dependencies:
cd SafeComm/backend
npm install
---- Create a
.envfile in thebackendfolder with the following content:
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
---
- Start the backend server:
npm run dev
---- Navigate to the frontend folder and install dependencies:
cd SafeComm/frontend
npm install
---- Create a
.envfile in thefrontendfolder with your Google Maps API key:
VITE_GOOGLE_MAPS_API_KEY=your_google_maps_api_key
---- Register as a User or Admin.
- User Dashboard:
- View live transit vehicles
- Submit safety reports
- Rate routes
- Admin Dashboard:
- View all reports
- Monitor route ratings
- Manage transit safety data
Admin:
- Email: admin@example.com
- Password: admin123
User:
- Email: user@example.com
- Password: user123