How fahad2bhatti/fleetflow works
FleetFlow is a multi-company fleet and transportation management platform. Users sign in, then role-protected web pages call the REST API to manage fleet resources and progress delivery orders through trip assignment, transit, and delivery; the backend enforces business rules and persists company-scoped records. Separate capabilities cover finance, maintenance, analytics, audit, notifications, and expiry/service alerts. Relationships are based on the README and shown source/index references; unsampled implementation details are not treated as inspected.
Main entry points: routes API routers · data-source.ts PostgreSQL data source · insights.service.ts Reports and analytics · App.tsx Route application
Components 24
Web application
- Route application
frontend/src/App.tsx - Login and register
frontend/src/pages/Auth.tsx - Session state
frontend/src/store/authSlice.ts - Fleet and trip pages
frontend/src/pages - Reports and dashboard
frontend/src/pages - Role permissions
frontend/src/lib/permissions.ts - HTTP client
frontend/src/lib/api.ts
API and security
- Express app
backend/src/app.ts - API routers
backend/src/routes - Request authentication
backend/src/infra/middleware/authenticate.ts - Permission checks
backend/src/infra/middleware/authorize.ts - Request validation
backend/src/application/dtos/schemas.ts
Business services
- Trip dispatch
backend/src/application/services/trip.service.ts - Smart assignment
backend/src/application/services/assignment.service.ts - Fleet operations
backend/src/application/services/operations.service.ts - Fleet management
backend/src/application/services/fleet.service.ts - Reports and analytics
backend/src/application/services/insights.service.ts - Identity service
backend/src/application/services/auth.service.ts - Audit history
backend/src/application/services/audit.service.ts - Notifications
backend/src/application/services/notification.service.ts
Persistence and alerts
- PostgreSQL data source
backend/src/infra/database/data-source.ts - Scheduled alerts
backend/src/infra/jobs/alerts.job.ts
Other components
- Fleet user
- Database
Connections 36
- Fleet user → Route application: opens
frontend/src/App.tsx - Route application → Login and register: routes to
frontend/src/App.tsx - Route application → Fleet and trip pages: routes to
frontend/src/App.tsx - Route application → Reports and dashboard: routes to
frontend/src/App.tsx - Login and register → Session state: dispatches auth
frontend/src/pages/Auth.tsx - Session state → HTTP client: sends requests
frontend/src/store/authSlice.ts - Fleet and trip pages → HTTP client: fetches resources
- Role permissions → Route application: guards routes
- HTTP client → Express app: calls REST API
- Express app → API routers: mounts
backend/src/app.ts - API routers → Trip dispatch: dispatches trip calls
backend/src/routes/trips.routes.ts - API routers → Smart assignment: dispatches assignment
backend/src/routes/trips.routes.ts - API routers → Fleet operations: dispatches operations
backend/src/routes/trips.routes.ts - API routers → Fleet management: dispatches fleet calls
backend/src/routes/fleet.routes.ts - API routers → Reports and analytics: dispatches analytics
backend/src/routes/insights.routes.ts - API routers → Notifications: dispatches notification calls
backend/src/routes/insights.routes.ts - API routers → Identity service: dispatches identity calls
- API routers → Request authentication: authenticates requests
backend/src/routes/helpers.ts - API routers → Permission checks: checks permissions
backend/src/routes/helpers.ts - API routers → Request validation: validates input
backend/src/routes/helpers.ts - Trip dispatch → PostgreSQL data source: reads and writes
- Smart assignment → PostgreSQL data source: reads availability
- Fleet operations → PostgreSQL data source: reads and writes
backend/src/application/services/operations.service.ts - Fleet operations → Audit history: records changes
backend/src/application/services/operations.service.ts - Fleet operations → Notifications: notifies roles
backend/src/application/services/operations.service.ts - Fleet management → PostgreSQL data source: reads and writes
- Reports and analytics → PostgreSQL data source: queries metrics
backend/src/application/services/insights.service.ts - Reports and analytics → Fleet operations: uses operations data
backend/src/application/services/insights.service.ts - Reports and analytics → Fleet management: uses fleet data
backend/src/application/services/insights.service.ts - Reports and analytics → Notifications: uses notifications
backend/src/application/services/insights.service.ts - Identity service → PostgreSQL data source: reads and writes
backend/src/application/services/auth.service.ts - Identity service → Audit history: records auth events
backend/src/application/services/auth.service.ts - Audit history → PostgreSQL data source: stores audit logs
backend/src/application/services/audit.service.ts - Notifications → PostgreSQL data source: stores notifications
backend/src/application/services/notification.service.ts - Scheduled alerts → Notifications: creates alerts
- PostgreSQL data source → Database: connects to
backend/src/infra/database/data-source.ts