How gwankhede/krushi-app works
Krushi Smart Billing is a full-stack retail billing and inventory application. Owners, managers, and staff use the frontend to manage products, customers, sales, purchases, settings, and analytics; the backend exposes corresponding APIs and persists business data. The graph highlights the documented product areas and the sampled sales, purchasing, and product-management behavior. Some frontend-to-API wiring and unsampled controller internals are not shown in the excerpts, so those links are omitted or marked unverified.
Main entry points: app.js Express API · auth.js JWT authentication · index.tsx Page routing · saleController.js Sales processing
Components 29
Frontend experience
- Web application
Frontend/src/App.tsx - Page routing
Frontend/src/routes/index.tsx - Product workspace
Frontend/src/pages/Products.tsx - Billing workspace
Frontend/src/pages/Billing.tsx - Purchase workspace
Frontend/src/pages/Purchase.tsx - Reports and dashboard
Frontend/src/pages/Report.tsx - Invoice PDF export
Frontend/src/components/PDFGenerator.tsx - API client
Frontend/src/services/api.tsx
Inventory and purchasing
- Product management
Backends/src/controllers/productController.js - Category management
Backends/src/controllers/categoryController.js - Purchase processing
Backends/src/controllers/purchaseController.js - Supplier management
Backends/src/controllers/supplierController.js
Billing and customers
- Sales processing
Backends/src/controllers/saleController.js - Customer management
Backends/src/controllers/customerController.js - Invoice numbering
Backends/src/utils/invoice.js
Business operations
- Dashboard analytics
Backends/src/controllers/dashboardController.js - Business reports
Backends/src/controllers/reportController.js - Business settings
Backends/src/controllers/settingsController.js
Backend API
- Express API
Backends/src/app.js - Authentication routes
Backends/src/routes/auth.js - Product routes
Backends/src/routes/products.js - Sales routes
Backends/src/routes/sales.js - Purchase routes
Backends/src/routes/purchases.js - Report routes
Backends/src/routes/reports.js - Settings routes
Backends/src/routes/settings.js - JWT authentication
Backends/src/middleware/auth.js
Other components
- Business staff
- PostgreSQL database
- Google image search
Connections 42
- Business staff → Web application: uses
README.md - Web application → Page routing: renders
Frontend/src/App.tsx - Page routing → Product workspace: routes to
- Page routing → Billing workspace: routes to
- Page routing → Purchase workspace: routes to
- Page routing → Reports and dashboard: routes to
- Product workspace → Product management: requests data
- Billing workspace → API client: requests data
- Purchase workspace → API client: requests data
- Reports and dashboard → API client: requests data
- Billing workspace → Invoice PDF export: exports invoices
- API client → Express API: calls API
- Express API → Authentication routes: mounts routes
Backends/src/app.js - Express API → Product routes: mounts routes
Backends/src/app.js - Express API → Sales routes: mounts routes
Backends/src/app.js - Express API → Purchase routes: mounts routes
Backends/src/app.js - Express API → Report routes: mounts routes
Backends/src/app.js - Express API → Settings routes: mounts routes
Backends/src/app.js - Authentication routes → JWT authentication: authenticates
- Product routes → Product management: dispatches to
Backends/src/routes/products.js - Product routes → JWT authentication: authenticates
Backends/src/routes/products.js - Sales routes → Sales processing: dispatches to
Backends/src/routes/sales.js - Sales routes → JWT authentication: authenticates
Backends/src/routes/sales.js - Purchase routes → Purchase processing: dispatches to
Backends/src/routes/purchases.js - Purchase routes → JWT authentication: authenticates
Backends/src/routes/purchases.js - Report routes → Business reports: dispatches to
Backends/src/routes/reports.js - Report routes → JWT authentication: authenticates
Backends/src/routes/reports.js - Settings routes → Business settings: dispatches to
Backends/src/routes/settings.js - Settings routes → JWT authentication: authenticates
Backends/src/routes/settings.js - Product management → PostgreSQL database: reads and writes
Backends/src/controllers/productController.js - Category management → PostgreSQL database: reads and writes
Backends/src/controllers/categoryController.js - Customer management → PostgreSQL database: reads and writes
Backends/src/controllers/customerController.js - Purchase processing → PostgreSQL database: records purchases
Backends/src/controllers/purchaseController.js - Purchase processing → PostgreSQL database: updates stock
Backends/src/controllers/purchaseController.js - Sales processing → PostgreSQL database: records sales
Backends/src/controllers/saleController.js - Sales processing → PostgreSQL database: updates stock
Backends/src/controllers/saleController.js - Sales processing → Invoice numbering: generates number
Backends/src/controllers/saleController.js - Dashboard analytics → PostgreSQL database: reads metrics
Backends/src/controllers/dashboardController.js - Business reports → PostgreSQL database: queries reports
- Business settings → PostgreSQL database: updates settings
Backends/src/controllers/settingsController.js - Supplier management → PostgreSQL database: manages suppliers
- Product management → Google image search: searches images