How krusnap/epc-app works
Mahindra EPC is a field-travel and conveyance system: employees record trips and GPS locations, which feed distance-based claims; managers review claims and monitor employees. The Flutter app provides employee and manager workflows, while an Express API handles authentication, trips, locations, claims, and geofence management over PostgreSQL/PostGIS. The sampled backend shows route dispatch, database access, and claim fraud scoring. Mobile service-to-screen wiring and several README-listed capabilities are not shown in the excerpts, so those links are left unverified.
Main entry points: database.js Database access · server.js Express API · main.dart Flutter app · auth.js JWT and roles
Components 21
Mobile workflows
- Flutter app
mobile_app/lib/main.dart - Login screen
mobile_app/lib/screens/shared/login_screen.dart - Employee screens
mobile_app/lib/screens/employee - Manager screens
mobile_app/lib/screens/manager - Mobile services
mobile_app/lib/services
API and access
- Express API
backend/server.js - Authentication routes
backend/routes/auth.routes.js - Authentication
backend/controllers/authController.js - JWT and roles
backend/middleware/auth.js
Travel and claims
- Trip routes
backend/routes/trip.routes.js - Trip lifecycle
backend/controllers/tripController.js - Location routes
backend/routes/location.routes.js - GPS tracking
backend/controllers/locationController.js - Claim routes
backend/routes/claim.routes.js - Claim generation and review
backend/controllers/claimController.js - Fraud scoring
backend/services/fraudDetection.js - Geofence management
backend/routes/geofence.routes.js
Persistence and risk
- Database access
backend/config/database.js - PostgreSQL / PostGIS
backend/database/schema.sql
Other components
- Employee
- Manager
Connections 31
- Employee → Flutter app: uses
README.md - Manager → Flutter app: uses
README.md - Flutter app → Login screen: presents
- Flutter app → Employee screens: presents
- Flutter app → Manager screens: presents
- Login screen → Mobile services: uses
- Employee screens → Mobile services: uses
- Manager screens → Mobile services: uses
- Mobile services → Express API: calls API
- Express API → Authentication routes: mounts
backend/server.js - Express API → Trip routes: mounts
backend/server.js - Express API → Location routes: mounts
backend/server.js - Express API → Claim routes: mounts
backend/server.js - Express API → Geofence management: mounts
backend/server.js - Authentication routes → Authentication: dispatches
backend/routes/auth.routes.js - Authentication routes → JWT and roles: protects
backend/routes/auth.routes.js - Trip routes → Trip lifecycle: dispatches
backend/routes/trip.routes.js - Trip routes → JWT and roles: protects
backend/routes/trip.routes.js - Location routes → GPS tracking: dispatches
backend/routes/location.routes.js - Location routes → JWT and roles: protects
backend/routes/location.routes.js - Claim routes → Claim generation and review: dispatches
backend/routes/claim.routes.js - Claim routes → JWT and roles: protects
backend/routes/claim.routes.js - Geofence management → JWT and roles: protects
backend/routes/geofence.routes.js - Authentication → Database access: queries
backend/controllers/authController.js - Trip lifecycle → Database access: queries
backend/controllers/tripController.js - GPS tracking → Database access: queries
backend/controllers/locationController.js - Claim generation and review → Database access: queries
backend/controllers/claimController.js - Claim generation and review → Fraud scoring: calculates risk
backend/controllers/claimController.js - Geofence management → Database access: queries
backend/routes/geofence.routes.js - Database access → PostgreSQL / PostGIS: queries
backend/config/database.js - Fraud scoring → Database access: queries
backend/services/fraudDetection.js