Skip to content

Latest commit

 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚍 SafeGo – Smart School Bus & Safety Monitoring Portal

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.

⭐ Features

👨‍👩‍👧 Parent Portal

  • View assigned trips

  • Track bus location (manual update system)

  • Receive boarding/checkout alerts

  • Manage student profiles

🚌 Coordinator Panel

  • Update bus location at each stop

  • Mark student check-in & check-out

  • Manage trip schedules

  • Safety alert handling

🧑‍🏫 Admin Module

  • Manage drivers

  • Manage buses

  • Create and assign trips

  • View student activity logs

💳 Payment & Cost Handling

  • Fee calculation

  • Payment history

  • Receipt generation

🎯 Tech Stack

Frontend

  • React.js

  • Tailwind CSS / Material UI

  • Axios

  • Context API / Redux (if used)

Backend

  • Node.js

  • Express.js

  • JWT authentication

  • REST API architecture

Database

  • MongoDB (Cloud or Local)

🚀 Quick Start Guide

Prerequisites

1. Clone the Repository

git clone https://github.com/Vidushika0819/SafeGo.git
cd SafeGo

2. Backend Setup

Install Dependencies

cd backend
npm install

Database Setup

  1. Start MongoDB (if using local MongoDB):

    # On Windows (run as Administrator)
    net start MongoDB
    
    # Or use MongoDB Compass to start the service
  2. Seed the Database (optional - creates sample users):

    npm run seed

Environment Configuration

The .env file is already configured for local MongoDB. If you want to use MongoDB Atlas instead:

  1. Uncomment the Atlas connection string in backend/.env
  2. Replace with your MongoDB Atlas connection string

Start Backend Server

# Development mode (with auto-restart)
npm run dev

# Or production mode
npm start

Backend will run on: http://localhost:5000

3. Frontend Setup

Install Dependencies

cd ../frontend
npm install

Start Frontend Development Server

npm start

Frontend will run on: http://localhost:3000

4. Access the Application

Open your browser and go to: http://localhost:3000

📋 Default Login Credentials

After running the seed script, you can login with these accounts:

Admin Account

Parent Account

Coordinator Account

Driver Account

🏗️ Project Structure

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

🧪 Running Tests

Backend Tests

cd backend
npm test

Frontend Tests

cd frontend
npm test

🔧 Available Scripts

Backend

  • npm start - Start production server
  • npm run dev - Start development server with nodemon
  • npm test - Run Jest tests
  • npm run seed - Seed database with sample data

Frontend

  • npm start - Start development server
  • npm run build - Build for production
  • npm test - Run React tests
  • npm run eject - Eject from Create React App

🌐 API Endpoints

  • 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

🐛 Troubleshooting

Common Issues:

  1. MongoDB Connection Error

    • Ensure MongoDB is running: net start MongoDB
    • Check .env file has correct connection string
  2. Port Already in Use

    • Backend: Change port in backend/app.js
    • Frontend: Port 3000 is usually auto-assigned
  3. npm install fails

    • Clear npm cache: npm cache clean --force
    • Delete node_modules and reinstall
  4. CORS Errors

    • Backend has CORS configured for frontend requests

📄 License

This project is released under the MIT License. See the LICENSE file for more details.

About

SafeGo is a smart school bus safety and monitoring system designed to ensure safe travel for students. It provides real-time trip updates, seat reservations, student check-in/checkout, alerts, and parent–coordinator communication through a user-friendly web platform.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages