Skip to content

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚛 TransitOps – Smart Transport Operations Platform

Built for the Odoo Hackathon 2026 | 8-Hour Sprint

TransitOps is a full-stack transport management system that digitizes vehicle, driver, dispatch, maintenance, fuel, and expense tracking. It enforces strict business rules, provides real-time operational insights, and includes a clean, responsive UI.


📌 Table of Contents


✨ Features

🔐 Authentication & RBAC

  • Secure JWT-based login (email + password)
  • Role-Based Access Control (Fleet Manager, Driver, Safety Officer, Financial Analyst)
  • Protected frontend routes — pages are inaccessible without a valid session

📊 Dashboard

  • Real-time KPIs: Active Vehicles, Available Vehicles, Vehicles in Maintenance, Active Trips, Pending Trips, Drivers On Duty
  • Card-based layout for quick operational visibility

🚚 Vehicle Registry

  • Full CRUD operations
  • Status lifecycle: AvailableOn TripIn ShopRetired
  • Unique registration number enforcement

👤 Driver Management

  • License validation (expiry, category)
  • Safety score tracking
  • Status lifecycle: AvailableOn TripOff DutySuspended
  • Expired license flagged directly in the table

🗺️ Trip Management

  • Full lifecycle: DraftDispatchedCompletedCancelled
  • Dropdowns only show Available vehicles/drivers
  • Cargo weight validated against vehicle max load capacity before creation
  • Auto status transitions for both vehicle and driver on dispatch

🔧 Maintenance Logging

  • Create and close maintenance records
  • Auto-switches vehicle to In Shop on creation, reverts to Available on closure

📈 Reports & CSV Export

  • Trip reporting page
  • One-click CSV export using browser-native Blob API

📁 Project Structure

transitops/
├── backend/
│   ├── src/
│   │   ├── config/          # Database connection config
│   │   ├── controllers/     # Route handlers (auth, vehicle, driver, trip)
│   │   ├── models/          # Sequelize models (User, Vehicle, Driver, Trip)
│   │   ├── routes/          # Express route definitions
│   │   ├── middlewares/     # Auth guard, error handler, validators
│   │   └── index.js         # App entry point
│   ├── scripts/
│   │   └── seed.sql         # Database seed script
│   ├── .env.example
│   └── package.json
│
├── frontend/
│   ├── public/
│   ├── src/
│   │   ├── assets/          # Images, icons
│   │   ├── components/      # Reusable UI (Sidebar, ProtectedRoute)
│   │   ├── pages/           # Login, Dashboard, Vehicles, Drivers, Trips, Maintenance, ReportsPage
│   │   ├── services/        # mockApi.js, mockData.js, realApi.js
│   │   ├── App.jsx          # Route definitions
│   │   ├── main.jsx         # App entry point
│   │   └── index.css        # Global styles
│   ├── .env.example
│   └── package.json
│
├── docker-compose.yml
├── .gitignore
└── README.md

🏗️ Architecture

┌─────────────────────────────────────────────────────┐
│                      Frontend                        │
│               React + Vite + React Router            │
│                         │                             │
│                axios (REST API + JWT)                 │
│                         ▼                             │
│                      Backend                          │
│              Node.js + Express + JWT                  │
│                         │                             │
│                    Sequelize ORM                       │
│                         ▼                             │
│                      MySQL                             │
│         (Local instance, port 3306)                    │
└─────────────────────────────────────────────────────┘

DevOps:

  • Git feature-branch workflow (developmain)
  • Docker Compose for MySQL + Adminer (optional)
  • .env-based configuration for secrets

💻 Tech Stack

Layer Technology
Frontend React 18, Vite, React Router, Axios
Backend Node.js, Express, JWT, bcryptjs
Database MySQL 8.0 (local), Sequelize ORM
DevOps Git, Docker Compose, dotenv
Utilities Nodemon, CORS, Postman (API testing)

⚙️ Setup & Installation

Prerequisites

  • Node.js (v18+)
  • MySQL 8.0 (installed locally)
  • Git

Steps

# 1. Clone the repository
git clone https://github.com/shellsri/transitops.git
cd transitops

# 2. Install backend dependencies
cd backend
npm install

# 3. Install frontend dependencies
cd ../frontend
npm install

# 4. Configure environment variables

# Backend: create backend/.env with:
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=root
DB_NAME=transitops
JWT_SECRET=super_secret_hackathon_2026
PORT=3000

# Frontend: create frontend/.env with:
VITE_API_URL=http://localhost:3000

# 5. Set up the database
mysql -u root -p < scripts/seed.sql

# 6. Start the backend
cd backend
npm run dev

# 7. Start the frontend (in a separate terminal)
cd frontend
npm run dev

# 8. Access the app
# Open http://localhost:5173

👥 Team Roles

Role Name Responsibilities
Frontend Lead Swaran Abha React UI, routing, components, forms, state management, API integration, JWT auth wiring, route protection
Backend Lead Shubhangi Saxena Sequelize models, Auth, CRUD APIs, business rules, transactions, database seeding
Integration / DevOps Lead Shelly Srivastava Database setup, Docker, .env config, Reports page, CSV export, Git workflow, final integration

📋 Business Rules Implemented

Rule Implementation
Unique registration number MySQL UNIQUE constraint + Sequelize validation
Retired/In Shop vehicles excluded from dispatch Backend query filter + frontend dropdown filtering
Expired/Suspended drivers cannot be assigned License expiry check + status validation
Cargo weight ≤ vehicle max load Validated on trip creation (frontend + backend)
Dispatch → vehicle/driver On Trip Sequelize transaction (atomic update)
Complete → vehicle/driver Available Sequelize transaction
Active maintenance → vehicle In Shop Maintenance log creation triggers status update
Close maintenance → vehicle Available Maintenance closure triggers status update

🔌 API Endpoints

Method Endpoint Description
POST /auth/login Authenticate user, return JWT
GET /auth/me Get current user info (protected)
GET /dashboard KPI counts
GET /vehicles List all vehicles
POST /vehicles Register a new vehicle
GET /drivers List all drivers
POST /drivers Register a new driver
GET /trips List all trips
POST /trips Create draft trip
PUT /trips/:id/dispatch Validate rules + dispatch trip
PUT /trips/:id/complete Complete trip, restore statuses
PUT /trips/:id/cancel Cancel trip, restore statuses
POST /maintenance Create maintenance log
PUT /maintenance/:id/close Close maintenance, restore vehicle
GET /reports/trips Get all trips for reporting

🚀 Future Enhancements

  • PDF export for reports
  • Email reminders for expiring driver licenses
  • Vehicle document management (photos, insurance)
  • Advanced chart visualisations (D3.js / Recharts)
  • Full dark mode toggle
  • Fuel & expense management module

👏 Contributors

  • Swaran Abha — Frontend Lead: React UI/UX, routing, state management, API binding, auth wiring
  • Shubhangi Saxena — Backend Lead: API development, Sequelize, business logic, auth, transactions
  • Shelly Srivastava — Integration/DevOps Lead: Database architecture, .env, Reports + CSV, Git workflow, final integration

📄 License

This project was built for the Odoo Hackathon 2026. It is not intended for commercial use.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages