SafeGo is a full MERN-stack web application designed to improve school bus safety, student monitoring, and trip management. This system supports parents, drivers, coordinators, and school admins, providing real-time updates, alerts, and bus tracking simulation.
-
View assigned trips
-
Track bus location (manual update system)
-
Receive boarding/checkout alerts
-
Manage student profiles
-
Update bus location at each stop
-
Mark student check-in & check-out
-
Manage trip schedules
-
Safety alert handling
-
Manage drivers
-
Manage buses
-
Create and assign trips
-
View student activity logs
-
Fee calculation
-
Payment history
-
Receipt generation
-
React.js
-
Tailwind CSS / Material UI
-
Axios
-
Context API / Redux (if used)
-
Node.js
-
Express.js
-
JWT authentication
-
REST API architecture
- MongoDB (Cloud or Local)
- Node.js (v16 or higher) - Download here
- MongoDB (local installation) - Download here
- Git - Download here
git clone https://github.com/Vidushika0819/SafeGo.git
cd SafeGocd backend
npm install-
Start MongoDB (if using local MongoDB):
# On Windows (run as Administrator) net start MongoDB # Or use MongoDB Compass to start the service
-
Seed the Database (optional - creates sample users):
npm run seed
The .env file is already configured for local MongoDB. If you want to use MongoDB Atlas instead:
- Uncomment the Atlas connection string in
backend/.env - Replace with your MongoDB Atlas connection string
# Development mode (with auto-restart)
npm run dev
# Or production mode
npm startBackend will run on: http://localhost:5000
cd ../frontend
npm installnpm startFrontend will run on: http://localhost:3000
Open your browser and go to: http://localhost:3000
After running the seed script, you can login with these accounts:
- Email: admin@safego.com
- Password: admin123
- Email: parent@safego.com
- Password: parent123
- Email: coordinator@safego.com
- Password: coordinator123
- Email: driver@safego.com
- Password: driver123
SafeGo/
├── backend/ # Node.js/Express API
│ ├── Controllers/ # Route controllers
│ ├── Models/ # MongoDB models
│ ├── Routes/ # API routes
│ ├── __tests__/ # Backend tests
│ ├── app.js # Main application file
│ ├── package.json # Backend dependencies
│ └── .env # Environment variables
├── frontend/ # React application
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── context/ # React context
│ │ └── __tests__/ # Frontend tests
│ ├── public/ # Static assets
│ └── package.json # Frontend dependencies
└── README.md # This file
cd backend
npm testcd frontend
npm testnpm start- Start production servernpm run dev- Start development server with nodemonnpm test- Run Jest testsnpm run seed- Seed database with sample data
npm start- Start development servernpm run build- Build for productionnpm test- Run React testsnpm run eject- Eject from Create React App
- Authentication:
/api/auth - Admin:
/api/admin - Parent:
/api/parent - Coordinator:
/api/coordinator - Driver:
/api/driver - Children:
/api/children - Trip Assignments:
/api/trip-assignments - Buses:
/api/buses - Trips:
/api/trips
-
MongoDB Connection Error
- Ensure MongoDB is running:
net start MongoDB - Check
.envfile has correct connection string
- Ensure MongoDB is running:
-
Port Already in Use
- Backend: Change port in
backend/app.js - Frontend: Port 3000 is usually auto-assigned
- Backend: Change port in
-
npm install fails
- Clear npm cache:
npm cache clean --force - Delete node_modules and reinstall
- Clear npm cache:
-
CORS Errors
- Backend has CORS configured for frontend requests
This project is released under the MIT License. See the LICENSE file for more details.