How abdulbaseer135/adil-petrolium works
Tail Website is a petroleum-dealer fuel management and customer-statement platform. Admins manage customers and fuel transactions, then review daily/monthly/yearly reports or export statements; customers sign in to view balances and statements. The React app uses a protected API backed by MongoDB. The graph preserves authentication, transaction/customer management, reporting/export, audit, and SSE capabilities. Some routes and services were not sampled, so uncertain wiring is omitted; dashed links indicate frontend-to-API interactions not shown directly in the excerpts.
Main entry points: models MongoDB models · index.js Route registry · reportController.js Report handling · App.js App routing
Components 25
React application
- App routing
frontend/src/App.js - Auth state
frontend/src/store/authSlice.js - HTTP client
frontend/src/api/axiosClient.js - Admin workflows
frontend/src/pages/admin - Customer statements
frontend/src/pages/customer
API and security
- API server
backend/src/server.js - Route registry
backend/src/routes/index.js - Auth routes
backend/src/routes/authRoutes.js - Authentication
backend/src/services/authService.js - Access control
backend/src/middleware/auth.js - Customer routes
backend/src/routes/customerRoutes.js - Transaction routes
backend/src/routes/transactionRoutes.js - Report routes
backend/src/routes/reportRoutes.js - SSE updates
backend/src/routes/eventsRoutes.js
Dealer operations
- Customer management
backend/src/services/customerService.js - Transaction operations
backend/src/services/transactionService.js - Daily records
backend/src/services/dailyRecordService.js
Statements and reports
- Report handling
backend/src/controllers/reportController.js - Excel exports
backend/src/services/excelService.js - Statement exports
backend/src/services/professionalStatementService.js
Persistence and activity
- Audit logging
backend/src/services/auditService.js - MongoDB models
backend/src/models - MongoDB
backend/src/config/database.js
Other components
- Admin
- Customer
Connections 34
- Admin → App routing: uses
frontend/src/App.js - Customer → App routing: uses
frontend/src/App.js - App routing → Admin workflows: routes to
frontend/src/App.js - App routing → Customer statements: routes to
frontend/src/App.js - App routing → Auth state: loads session
frontend/src/App.js - Auth state → HTTP client: resets tokens
frontend/src/store/authSlice.js - Admin workflows → HTTP client: requests API
- Customer statements → HTTP client: requests API
- HTTP client → API server: calls API
- API server → Route registry: mounts routes
backend/src/server.js - Route registry → Auth routes: registers
backend/src/routes/index.js - Route registry → Customer routes: registers
backend/src/routes/index.js - Route registry → Transaction routes: registers
backend/src/routes/index.js - Route registry → Report routes: registers
backend/src/routes/index.js - Route registry → SSE updates: registers
backend/src/routes/index.js - Auth routes → Authentication: delegates to
- Authentication → MongoDB models: reads and writes
backend/src/services/authService.js - Authentication → Audit logging: records activity
backend/src/services/authService.js - Customer routes → Access control: protects routes
backend/src/routes/customerRoutes.js - Transaction routes → Access control: protects routes
backend/src/routes/transactionRoutes.js - Report routes → Access control: protects routes
backend/src/routes/reportRoutes.js - Customer routes → Customer management: delegates to
- Transaction routes → Transaction operations: dispatches to
backend/src/routes/transactionRoutes.js - Transaction operations → MongoDB models: uses records
- Daily records → MongoDB models: uses records
- Report routes → Report handling: dispatches to
backend/src/routes/reportRoutes.js - Report handling → Excel exports: generates workbook
backend/src/controllers/reportController.js - Report handling → Statement exports: generates statement
backend/src/controllers/reportController.js - Report handling → MongoDB models: queries transactions
backend/src/controllers/reportController.js - Report handling → Audit logging: audits exports
backend/src/controllers/reportController.js - Excel exports → MongoDB models: reads records
backend/src/services/excelService.js - Statement exports → MongoDB models: reads records
backend/src/services/professionalStatementService.js - MongoDB models → MongoDB: persists data
- SSE updates → Customer: streams updates