How baluduvamsi2006/transitops works
TransitOps is a web platform for managing fleet assets, drivers, dispatch, maintenance, operating costs, and analytics. Users authenticate through the login form and JWT cookie, then work in role-permitted dashboard and operational pages; trip actions enforce dispatch lifecycle rules, while finance and maintenance actions record operating data. Pages render server-fetched records and KPIs through a shared shell and UI, with Prisma as the persistence layer. README-described reporting, export, and global revalidation are included where documented; unsampled subsystems are represented at their exact tree paths.
Main entry points: prisma.ts Prisma client · transit-shell.tsx Application shell · route.ts Login endpoint · page.tsx Operations dashboard
Components 24
Identity & Access
- Login UI
src/components/auth/login-form.tsx - Login endpoint
src/app/api/auth/login/route.ts - JWT sessions
src/lib/jwt.ts - Role rules
src/lib/rbac.ts - User administration
src/app/api/admin/users/route.ts
Fleet Operations
- Vehicle registry
src/app/fleet/page.tsx - Vehicle actions
src/app/fleet/actions.ts - Driver management
src/app/drivers/page.tsx - Driver actions
src/app/drivers/actions.ts - Trip dispatch
src/app/trips/page.tsx - Trip lifecycle
src/app/trips/actions.ts - Maintenance logs
src/app/maintenance/page.tsx - Maintenance actions
src/app/maintenance/actions.ts
Insights & Finance
- Operations dashboard
src/app/page.tsx - Fuel & expenses
src/app/finance/page.tsx - Cost actions
src/app/finance/actions.ts - Reports & analytics
src/app/reports/page.tsx - CSV & profit analysis
src/app/reports
Shared Platform
- Application shell
src/components/transit-shell.tsx - Shared UI components
src/components/transit-ui.tsx - Session context
src/components/session-provider.tsx - Prisma client
src/lib/prisma.ts - PostgreSQL
Other components
- Operations user
Connections 40
- Operations user → Login UI: enters credentials
- Login UI → Login endpoint: submits login
- Login endpoint → Prisma client: looks up account
src/app/api/auth/login/route.ts - Login endpoint → JWT sessions: signs session
src/app/api/auth/login/route.ts - Login endpoint → Role rules: normalizes role
src/app/api/auth/login/route.ts - Login endpoint → Operations user: sets session cookie
src/app/api/auth/login/route.ts - Operations user → Operations dashboard: uses platform
- Operations dashboard → JWT sessions: checks session
src/app/page.tsx - Operations dashboard → Prisma client: reads KPIs
src/app/page.tsx - Operations dashboard → Application shell: renders within
src/app/page.tsx - Vehicle registry → Prisma client: reads vehicles
src/app/fleet/page.tsx - Vehicle registry → Vehicle actions: offers actions
src/app/fleet/page.tsx - Vehicle actions → Prisma client: updates vehicles
- Driver management → Prisma client: reads drivers
src/app/drivers/page.tsx - Driver management → Driver actions: offers actions
src/app/drivers/page.tsx - Driver actions → Prisma client: updates drivers
src/app/drivers/actions.ts - Trip dispatch → Prisma client: reads trips
src/app/trips/page.tsx - Trip dispatch → Trip lifecycle: invokes lifecycle
src/app/trips/page.tsx - Trip lifecycle → Prisma client: changes trip state
src/app/trips/actions.ts - Trip lifecycle → Vehicle actions: updates vehicle state
- Trip lifecycle → Driver actions: updates driver state
- Maintenance logs → Prisma client: reads logs
src/app/maintenance/page.tsx - Maintenance logs → Maintenance actions: invokes actions
src/app/maintenance/page.tsx - Maintenance actions → Prisma client: writes logs
src/app/maintenance/actions.ts - Fuel & expenses → Prisma client: reads costs
src/app/finance/page.tsx - Fuel & expenses → Cost actions: invokes actions
src/app/finance/page.tsx - Cost actions → Prisma client: writes costs
src/app/finance/actions.ts - Reports & analytics → Prisma client: aggregates records
src/app/reports/page.tsx - Reports & analytics → CSV & profit analysis: provides export
src/app/reports/page.tsx - Vehicle registry → Application shell: renders within
src/app/fleet/page.tsx - Driver management → Application shell: renders within
src/app/drivers/page.tsx - Trip dispatch → Application shell: renders within
src/app/trips/page.tsx - Maintenance logs → Application shell: renders within
src/app/maintenance/page.tsx - Fuel & expenses → Application shell: renders within
src/app/finance/page.tsx - Application shell → Session context: reads session
src/components/transit-shell.tsx - Application shell → Role rules: filters navigation
src/components/transit-shell.tsx - Operations dashboard → Shared UI components: renders metrics
src/app/page.tsx - Prisma client → PostgreSQL: queries
- User administration → JWT sessions: verifies admin
src/app/api/admin/users/route.ts - User administration → Prisma client: manages users
src/app/api/admin/users/route.ts