How bigm-o/chosen-energy works
Chosen Energy Operations Portal manages diesel procurement and distribution, tanker fleet operations, sales, driver logs, and approvals. Users enter through the React portal; authentication establishes role-aware access, then operational pages support distinct purchasing, inventory, supply, fleet, and daily-log work. The .NET API exposes domain controllers and services backed by PostgreSQL; the sampled truck controller also performs direct Dapper queries. README capabilities are represented, but detailed wiring for unsampled pages and services is not asserted.
Main entry points: App.tsx Portal Router · TrucksController.cs Truck API · DriverDailyLogPage.tsx Driver and Admin Logs · PurchasingPage.tsx Purchasing
Components 21
Operations Portal
- Portal Router
frontend/src/app/App.tsx - Login Page
frontend/src/app/pages/LoginPage.tsx - Dashboard
frontend/src/app/pages/DashboardPage.tsx - Driver and Admin Logs
frontend/src/app/pages/DriverDailyLogPage.tsx - Purchasing
frontend/src/app/pages/PurchasingPage.tsx - Supply and Invoices
frontend/src/app/pages/SupplyPage.tsx - Fleet Management
frontend/src/app/pages/TrucksPage.tsx - Transloading
frontend/src/app/pages/TransloadingPage.tsx - Approvals
frontend/src/app/pages/ApprovalsPage.tsx
Identity and Access
- Auth State
frontend/src/hooks/useAuth.tsx - Auth API Client
frontend/src/services/authService.ts - Auth Controller
backend/ChosenEnergy.API/Controllers/AuthController.cs - Auth Service
backend/ChosenEnergy.API/Services/AuthService.cs - User Repository
backend/ChosenEnergy.API/Repositories/UserRepository.cs
Fleet and Inventory
- Truck API
backend/ChosenEnergy.API/Controllers/TrucksController.cs - Fleet and Log Services
backend/ChosenEnergy.API/Services
Sales and Governance
- Purchasing API
backend/ChosenEnergy.API/Controllers/PurchasesController.cs - Supply API
backend/ChosenEnergy.API/Controllers/SuppliesController.cs - Sales and Purchase Services
backend/ChosenEnergy.API/Services
Other components
- Staff and Drivers
- PostgreSQL
Connections 25
- Staff and Drivers → Portal Router: use portal
- Portal Router → Login Page: renders unauthenticated
- Portal Router → Dashboard: routes authenticated
- Portal Router → Driver and Admin Logs: routes drivers
- Portal Router → Purchasing: routes purchasing
- Portal Router → Supply and Invoices: routes supply
- Portal Router → Fleet Management: routes fleet
- Portal Router → Transloading: routes transfers
- Portal Router → Approvals: routes approvals
- Portal Router → Auth State: provides auth
- Auth State → Auth API Client: requests login
- Auth API Client → Auth Controller: HTTP auth
- Auth Controller → Auth Service: delegates auth
- Auth Service → User Repository: looks up users
- User Repository → PostgreSQL: reads and writes
- Purchasing → Purchasing API: purchase operations
- Purchasing API → Sales and Purchase Services: delegates purchase
- Supply and Invoices → Supply API: supply operations
- Supply API → Sales and Purchase Services: delegates supply
- Fleet Management → Truck API: truck operations
- Truck API → PostgreSQL: queries and updates
- Truck API → Fleet and Log Services: gets truck balance
- Driver and Admin Logs → Staff and Drivers: driver logging
- Transloading → Staff and Drivers: fuel transfers
- Approvals → Staff and Drivers: reviews approvals