How agila-learning/weighment-gst-desktop-app works
This repository contains a GST billing desktop app and a weighbridge desktop app backed by a shared API and database. The GST workflow covers customer and vehicle setup, billing, invoices, payments, and reports. The weighbridge workflow captures device readings, manages weighments and pending records, and supports history and reporting, with offline caching and synchronization. The backend also exposes shared master-data, audit, import/export, permit-card, and reporting capabilities. Connections for unsampled route implementations are limited to backend registration and documented module references.
Main entry points: src/App.tsx GST app routing · src/App.tsx Weighbridge app routing · Weighment.tsx Weighment capture · routes Domain API routes
Components 26
GST billing
- GST app routing
frontend-gst/src/App.tsx - Customer and vehicle setup
frontend-gst/src/pages/Customers.tsx - Billing
frontend-gst/src/pages/Billing.tsx - Invoices
frontend-gst/src/pages/Invoices.tsx - Reports and payments
frontend-gst/src/pages/Reports.tsx - Settings and data
frontend-gst/src/pages/Settings.tsx - API client
frontend-gst/src/api/client.ts
Weighbridge operations
- Weighbridge app routing
frontend-weighbridge/src/App.tsx - Scale device service
frontend-weighbridge/src/services/WeighbridgeDeviceService.ts - Device implementations
frontend-weighbridge/src/services/hardware/devices - Weighment capture
frontend-weighbridge/src/pages/Weighment.tsx - History and pending
frontend-weighbridge/src/pages/History.tsx - Weighbridge masters
frontend-weighbridge/src/pages/masters/Customers.tsx - Weighbridge reports
frontend-weighbridge/src/pages/reports/Reports.tsx - Offline synchronization
frontend-weighbridge/src/services/SyncService.ts - API service
frontend-weighbridge/src/services/api.ts
Backend API
- HTTP application
backend/src/index.ts - Authentication
backend/src/middleware/auth.ts - Domain API routes
backend/src/routes - Permit cards
backend/src/controllers/permitCardController.ts
Persistence and output
- Prisma data access
backend/src/prisma.ts - PostgreSQL database
- Local SQLite cache
frontend-weighbridge/electron/database.ts - PDF generation
backend/src/utils/pdfGenerator.ts
Other components
- Billing user
- Weighbridge operator
Connections 30
- Billing user → GST app routing: uses
- GST app routing → Customer and vehicle setup: routes to
frontend-gst/src/App.tsx - GST app routing → Billing: routes to
frontend-gst/src/App.tsx - GST app routing → Invoices: routes to
frontend-gst/src/App.tsx - GST app routing → Reports and payments: routes to
frontend-gst/src/App.tsx - GST app routing → Settings and data: routes to
frontend-gst/src/App.tsx - Customer and vehicle setup → API client: calls
frontend-gst/src/pages/Customers.tsx - Billing → API client: calls
frontend-gst/src/pages/Billing.tsx - Billing → PDF generation: uses preview
frontend-gst/src/pages/Billing.tsx - API client → HTTP application: sends API requests
- Weighbridge operator → Weighbridge app routing: uses
- Weighbridge app routing → Weighment capture: routes to
frontend-weighbridge/src/App.tsx - Weighbridge app routing → History and pending: routes to
frontend-weighbridge/src/App.tsx - Weighbridge app routing → Weighbridge masters: routes to
frontend-weighbridge/src/App.tsx - Weighbridge app routing → Weighbridge reports: routes to
frontend-weighbridge/src/App.tsx - Weighment capture → Scale device service: reads weights
frontend-weighbridge/src/pages/Weighment.tsx - Scale device service → Device implementations: instantiates
frontend-weighbridge/src/services/WeighbridgeDeviceService.ts - Weighment capture → Offline synchronization: uses
frontend-weighbridge/src/pages/Weighment.tsx - Weighment capture → API service: calls
frontend-weighbridge/src/pages/Weighment.tsx - Weighbridge masters → API service: calls
frontend-weighbridge/src/pages/masters/Customers.tsx - Offline synchronization → API service: syncs through
frontend-weighbridge/src/services/SyncService.ts - Offline synchronization → Local SQLite cache: reads and writes
frontend-weighbridge/src/services/SyncService.ts - API service → HTTP application: sends API requests
- HTTP application → Domain API routes: mounts
backend/src/index.ts - Domain API routes → Authentication: uses
backend/src/routes/permitCardRoutes.ts - Domain API routes → Prisma data access: queries
backend/src/routes/auth.ts - Domain API routes → Permit cards: routes permit requests
backend/src/routes/permitCardRoutes.ts - Permit cards → Prisma data access: reads and writes
backend/src/controllers/permitCardController.ts - Permit cards → PDF generation: generates permit PDF
backend/src/controllers/permitCardController.ts - Prisma data access → PostgreSQL database: accesses
backend/src/prisma.ts