How salimbd71/bh_agrof works
BH Agro is an animal-health ERP delivered as SR and Admin sites sharing code and a Firebase database. Users sign in, navigate role-appropriate views, and work with customers, products, orders, stock, collections, and reports; order pricing and inventory rules support booking and invoice preview. The sampled entry point explicitly renders shared UI and collections, while the source index identifies its broader module dependencies. Several workflow links are therefore shown as unverified; unsampled module internals are not inferred.
Main entry points: main.ts Application entry · store.ts ERP state and sync · orderPreview.ts Order preview · pricing.ts Pricing engine
Components 20
App shell
- Application entry
src/main.ts - Site rules
src/config/appMode.ts - Browser routing
src/modules/router.ts - Shared UI
src/modules/ui.ts
Sales operations
- Customer records
src/modules/customers.ts - Order booking
src/modules/orders.ts - Order preview
src/modules/orderPreview.ts - Invoice generation
src/modules/invoice.ts - Collections
src/modules/collections.ts
Admin operations
- Product inventory
src/modules/products.ts - Stock management
src/modules/stock.ts - Depot management
src/modules/depots.ts - Reports
src/modules/reports.ts - Sales targets
src/modules/targets.ts
Shared services
- Authentication
src/modules/auth.ts - Pricing engine
src/modules/pricing.ts - ERP state and sync
src/modules/store.ts - Firebase configuration
src/config/firebase.ts
Other components
- SR / Admin user
- Firebase Realtime Database
Connections 28
- SR / Admin user → Application entry: uses
- Application entry → Shared UI: renders
src/main.ts - Application entry → Collections: renders dashboard
src/main.ts - Application entry → Site rules: reads site rules
src/main.ts - Application entry → Browser routing: uses navigation
src/main.ts - Application entry → Authentication: uses sign-in
src/main.ts - Application entry → Customer records: uses customer views
src/main.ts - Application entry → Order booking: uses order views
src/main.ts - Application entry → Product inventory: uses product views
src/main.ts - Application entry → Reports: uses reports
src/main.ts - Application entry → Stock management: uses stock views
src/main.ts - Application entry → Depot management: uses depot views
src/main.ts - Application entry → Sales targets: uses target views
src/main.ts - Application entry → Order preview: opens preview
src/main.ts - Authentication → ERP state and sync: uses state
src/modules/auth.ts - Authentication → Shared UI: uses UI
src/modules/auth.ts - Order booking → Pricing engine: calculates prices
src/modules/orders.ts - Order booking → ERP state and sync: uses state
src/modules/orders.ts - Product inventory → Pricing engine: uses pricing
src/modules/products.ts - Product inventory → ERP state and sync: uses state
src/modules/products.ts - Reports → ERP state and sync: reads state
src/modules/reports.ts - Order preview → Invoice generation: builds and exports
src/modules/orderPreview.ts - Order preview → Pricing engine: calculates quantities
src/modules/orderPreview.ts - Order preview → ERP state and sync: reads and confirms
src/modules/orderPreview.ts - Order preview → Shared UI: shows feedback
src/modules/orderPreview.ts - ERP state and sync → Pricing engine: uses calculations
src/modules/store.ts - ERP state and sync → Firebase configuration: loads configuration
src/modules/store.ts - ERP state and sync → Firebase Realtime Database: syncs data