How nageshantarvedipalem-a11y/cattlefeed works
Cattle Feed ERP is a React/Express/MySQL business system for cattle-feed retail. Staff use the frontend to manage catalog and inventory, sell through POS billing, track customer/supplier balances and cash, and review reports and dashboards. The backend mounts feature APIs and separates request routing, controllers, services, and persistence. The README documents the full feature set; only selected request paths and service calls are evidenced in the sampled source, so unsampled feature branches are shown without speculative internal links.
Main entry points: app.js Express application · server.js API server · stock.routes.js Inventory API routes · cashBook.routes.js Cash book routes
Components 31
Web application
- ERP interface
frontend/src - HTTP client
frontend/src/services/api.js - POS workflow
frontend/src/hooks/usePosBilling.js
API runtime
- Express application
backend/src/app.js - API server
backend/src/server.js - API responses
backend/src/utils/apiResponse.js - Request validation
backend/src/middlewares/validate.middleware.js - Process guards
backend/src/processGuards.js
Retail operations
- Inventory API routes
backend/src/routes/stock.routes.js - Inventory controller
backend/src/controllers/stock.controller.js - Inventory service
backend/src/services/stock.service.js - Products and catalog
backend/src - POS billing
backend/src/services/billing.service.js - Customer management
backend/src/services/customer.service.js - Supplier management
backend/src - WhatsApp integration
backend/src/services/whatsapp.service.js
Finance and insights
- Cash book routes
backend/src/routes/cashBook.routes.js - Cash book controller
backend/src/controllers/cashBook.controller.js - Cash book service
backend/src/services/cashBook.service.js - Cash period logic
backend/src/helpers/cashBookPeriod.helper.js - Ledger and payments
backend/src - Profit and reports
backend/src - Dashboard insights
backend/src
Identity and persistence
- Authentication
backend/src/services/auth.service.js - Identity API routes
backend/src/routes/auth.routes.js - User persistence
backend/src/repositories/user.repository.js - MySQL database
backend/config/database.js - Access middleware
backend/src/middlewares/auth.middleware.js - Application logging
backend/src/utils/logger.js - Auth cache
backend/src/utils/authCache.js
Other components
- Business staff
Connections 34
- Business staff → ERP interface: uses
- ERP interface → HTTP client: sends requests
frontend/src/services/authService.js - API server → Express application: starts
backend/src/server.js - API server → MySQL database: tests connection
backend/src/server.js - API server → Process guards: loads
backend/src/server.js - API server → Application logging: logs through
backend/src/server.js - Express application → Identity API routes: mounts
backend/src/app.js - Express application → Inventory API routes: mounts
backend/src/app.js - Express application → Cash book routes: mounts
backend/src/app.js - Express application → Products and catalog: mounts product API
backend/src/app.js - Express application → POS billing: mounts billing API
backend/src/app.js - Express application → Customer management: mounts customer API
backend/src/app.js - Express application → Supplier management: mounts supplier API
backend/src/app.js - Express application → Ledger and payments: mounts ledger API
backend/src/app.js - Express application → Profit and reports: mounts reports API
backend/src/app.js - Express application → Dashboard insights: mounts dashboard API
backend/src/app.js - Express application → WhatsApp integration: mounts WhatsApp API
backend/src/app.js - Inventory API routes → Inventory controller: dispatches
backend/src/routes/stock.routes.js - Inventory controller → Inventory service: calls
backend/src/controllers/stock.controller.js - Cash book routes → Cash book controller: dispatches
backend/src/routes/cashBook.routes.js - Cash book controller → Cash book service: calls
backend/src/controllers/cashBook.controller.js - Cash book service → Cash period logic: uses period logic
- Identity API routes → Authentication: dispatches
- Authentication → User persistence: reads and updates
backend/src/services/auth.service.js - Authentication → Auth cache: invalidates
backend/src/services/auth.service.js - Inventory controller → API responses: formats responses
backend/src/controllers/stock.controller.js - Cash book controller → API responses: formats responses
backend/src/controllers/cashBook.controller.js - Cash book routes → Access middleware: authenticates
backend/src/routes/cashBook.routes.js - Cash book routes → Request validation: validates requests
backend/src/routes/cashBook.routes.js - Inventory API routes → Access middleware: authenticates
backend/src/routes/stock.routes.js - Inventory API routes → Request validation: validates requests
backend/src/routes/stock.routes.js - MySQL database → Application logging: reports connection errors
backend/config/database.js - POS workflow → POS billing: creates sales
frontend/src/hooks/usePosBilling.js - POS workflow → WhatsApp integration: sends invoices
frontend/src/hooks/usePosBilling.js