How sandipmbhosale18-netizen/agri-erp works
agri-erp is a desktop ERP for agricultural shops, built as an Electron application with a React interface and a local Prisma-backed database. The principal workflow is shop setup or sign-in, then role-gated shop operations: manage products and stock, record purchases or sales, track payments, and review accounting and reports. The main process registers IPC handlers and creates the desktop window; the preload exposes renderer-facing APIs. The tree also shows synchronization modules, but their runtime wiring is not established by the sampled excerpts.
Main entry points: preload/index.ts Preload API · src React application · client.ts Prisma database · main/index.ts Electron main
Components 25
Desktop interface
- React application
src/renderer/src - Setup and login
src/renderer/src/features/auth - Role-gated shell
src/renderer/src/shared - Preload API
src/preload/index.ts - Electron main
src/main/index.ts - Auth IPC
src/main/ipc/auth.ts
Shop operations
- Inventory screens
src/renderer/src/features/inventory - Inventory IPC
src/main/ipc/inventory.ts - Inventory service
src/main/inventory/service.ts - Purchases and suppliers
src/renderer/src/features/purchases - Purchase IPC
src/main/ipc/purchases.ts - Purchases service
src/main/purchases/service.ts - Customer screens
src/renderer/src/features/customers - Customer service
src/main/customers/service.ts
Finance and insights
- Billing screens
src/renderer/src/features/billing - Billing IPC
src/main/ipc/billing.ts - Billing service
src/main/billing/service.ts - Payment service
src/main/payments/service.ts - Accounting and expenses
src/main/accounting/service.ts - Reports and analytics
src/renderer/src/features/reports - GST reports
src/main/reports/service.ts - Sales analytics
src/main/analytics/service.ts
Persistence and sync
- Prisma database
src/main/db/client.ts - Synchronization
src/main/sync
Other components
- Shop staff
Connections 30
- Shop staff → React application: uses
- React application → Setup and login: routes
- React application → Role-gated shell: routes
- React application → Inventory screens: routes
- React application → Purchases and suppliers: routes
- React application → Customer screens: routes
- React application → Billing screens: routes
- React application → Reports and analytics: routes
- Setup and login → Preload API: calls API
- Inventory screens → Preload API: calls API
- Purchases and suppliers → Preload API: calls API
- Customer screens → Preload API: calls API
- Billing screens → Preload API: calls API
- Reports and analytics → Preload API: calls API
- Preload API → Auth IPC: invokes IPC
- Preload API → Inventory IPC: invokes IPC
- Preload API → Purchase IPC: invokes IPC
- Preload API → Billing IPC: invokes IPC
- Electron main → Auth IPC: registers
- Electron main → Inventory IPC: registers
- Electron main → Purchase IPC: registers
- Electron main → Billing IPC: registers
- Inventory service → Prisma database: reads and writes
- Purchases service → Prisma database: reads and writes
- Customer service → Prisma database: reads and writes
- Billing service → Prisma database: reads and writes
- Payment service → Prisma database: reads and writes
- Accounting and expenses → Prisma database: uses
- GST reports → Prisma database: reads
- Sales analytics → Prisma database: reads