TransitOps is a modern, responsive, and secure transport operations management platform. It allows fleet managers, safety officers, financial analysts, and drivers to coordinate vehicles, profiles, trips, maintenance logs, and fuel expenses from a single dynamic workspace.
- Frontend: React, Vite, Tailwind CSS, Lucide icons, Context API (Theme, Auth, and Settings).
- Backend: FastAPI, SQLAlchemy (ORM), Uvicorn, Jose JWT tokens.
- Database: PostgreSQL (with base metrics saved in Standard units: kilometers and INR).
- Dynamic Database-Driven RBAC: Permissions are stored in the database for each role (Fleet Manager, Driver, Safety Officer, and Financial Analyst). Role permission changes made in the Settings view propagate in real-time to restrict API endpoint access on the backend.
- User-Specific Configuration: General settings (Depot name, currency, and distance unit) are stored per user. Changing these preferences updates symbols, formats, and converts metrics (Miles vs. Kilometers, USD/EUR vs. INR) throughout the application specifically for that user.
- Real-Time Analytics & SVG Graphs: The Reports tab computes operational costs, average fuel efficiency, utilization rates, and queries completed trip revenues from the database to render dynamic bar chart graphics.
- License & Fleet Safety Warnings: Highlights expired licenses, driver suspensions, and vehicle maintenance holds during dispatch validation.
- Node.js (v18+)
- Python (v3.8+)
- PostgreSQL running locally or remotely
-
Navigate to the backend directory:
cd backend -
Create and activate a virtual environment:
# Windows python -m venv .venv .\.venv\Scripts\activate # macOS/Linux python3 -m venv .venv source .venv/bin/activate
-
Install the required dependencies:
pip install -r requirements.txt
-
Configure the Environment Variables: Create a
.envfile in thebackend/directory (or modify the existing one) with the following structure:DATABASE_URL=postgresql://postgres:password@localhost:5432/transitops SECRET_KEY=randomstring ALGORITHM=HS256 ACCESS_TOKEN_EXPIRE_MINUTES=1440
Ensure the
DATABASE_URLmatches your local PostgreSQL username, password, port, and database name.
TransitOps comes with a database initialization script that creates the necessary tables (including the system_settings and roles tables with default RBAC permissions) and populates them with test users, drivers, vehicles, and logs.
Run the seed script from the backend directory with:
# Ensure your virtual environment is active
python -m app.seedThis will output:
Dropping existing database tables...
Creating database tables...
Seeding roles...
Seeding initial users...
Database seeded successfully with test users and driver profile!
You can log in to the dashboard using any of the following credentials (password for all is demo1234):
- Fleet Manager (Admin):
fleet@transitops.dev(Full access to all modules and permission settings) - Safety Officer:
safety@transitops.dev(Manages drivers and lists trips) - Financial Analyst:
analyst@transitops.dev(Accesses fuel logs, expenses, and reports) - Driver:
driver@transitops.dev(Accesses trips and fuel logs)
Start the FastAPI application with:
uvicorn app.main:app --reloadThe documentation will be available at http://127.0.0.1:8000/docs.
-
Navigate to the frontend directory:
cd ../frontend -
Install dependencies:
npm install
-
Configure Frontend Environment Variables: Verify the base API url is set inside
frontend/.env(or config file) pointing to your backend address:VITE_API_BASE_URL=http://localhost:8000
-
Start the development server:
npm run dev
Vite will start the dev server, typically at
http://localhost:5173/orhttp://localhost:5174/. Open this URL in your web browser.
A full backend test suite is included to verify API security, role-based controls, data isolation, and operational limits.
Run the tests from the backend/ folder:
# Make sure virtual environment is active
python -m pytest