How suri341/invoice-generation-app works
Jagannath Enterprises’ app manages rice-mill parts customers, quotations, invoices, and reports. Users work through a React interface; the documented three-tier design sends requests to a FastAPI backend, which validates and processes records against PostgreSQL. The invoice path includes quotation creation, tax calculation, quotation-to-invoice conversion with stock checks, status tracking, and PDF download. The README documents the frontend/backend/database relationship; source excerpts and the index show backend routing and invoice-service calls. Some frontend-to-endpoint details and report internals were not sampled, so those links are omitted or documented at the tier level.
Main entry points: App.tsx App routing · database.py Database access · main.py FastAPI application · invoices.py Invoice routes
Components 25
Web interface
- App routing
frontend/src/App.tsx - Dashboard
frontend/src/pages/Dashboard.tsx - Customer management
frontend/src/pages/Customers.tsx - Parts catalog
frontend/src/pages/Parts.tsx - Stock view
frontend/src/pages/Stock.tsx - Invoice list
frontend/src/pages/Invoices.tsx - Create or edit
frontend/src/pages/CreateInvoice.tsx - API client
frontend/src/lib/api.ts
Backend API
- FastAPI application
backend/app/main.py - Customer routes
backend/app/api/customers.py - Parts routes
backend/app/api/parts.py - Invoice routes
backend/app/api/invoices.py - Reports routes
backend/app/api/reports.py
Invoice domain
- Invoice service
backend/app/services/invoice_service.py - Invoice validation
backend/app/schemas/invoice.py - Customer and part schemas
backend/app/schemas - Customer model
backend/app/models/customer.py - Part and stock model
backend/app/models/part.py - Invoice records
backend/app/models/invoice.py
Persistence and output
- Application settings
backend/app/config.py - Database access
backend/app/database.py - PostgreSQL
- Invoice PDF generator
backend/app/utils/pdf_generator.py - Quotation PDF generator
backend/app/utils/pdf_generator_backup_old.py
Other components
- Business user
Connections 33
- Business user → App routing: uses
README.md - App routing → Dashboard: routes to
frontend/src/App.tsx - App routing → Customer management: routes to
frontend/src/App.tsx - App routing → Parts catalog: routes to
frontend/src/App.tsx - App routing → Stock view: routes to
frontend/src/App.tsx - App routing → Invoice list: routes to
frontend/src/App.tsx - App routing → Create or edit: routes to
frontend/src/App.tsx - App routing → FastAPI application: calls API
README.md - FastAPI application → Customer routes: registers routes
backend/app/main.py - FastAPI application → Parts routes: registers routes
backend/app/main.py - FastAPI application → Invoice routes: registers routes
backend/app/main.py - FastAPI application → Reports routes: registers routes
backend/app/main.py - FastAPI application → Database access: initializes
backend/app/main.py - Customer routes → Database access: queries via
backend/app/api/customers.py - Parts routes → Database access: queries via
backend/app/api/parts.py - Reports routes → Database access: queries via
backend/app/api/reports.py - Invoice routes → Database access: queries via
backend/app/api/invoices.py - Invoice routes → Invoice service: delegates to
backend/app/api/invoices.py - Invoice routes → Invoice PDF generator: generates invoice PDF
backend/app/api/invoices.py - Invoice routes → Quotation PDF generator: generates quotation PDF
backend/app/api/invoices.py - Invoice service → Invoice records: creates and updates
backend/app/services/invoice_service.py - Invoice service → Part and stock model: checks and adjusts stock
backend/app/services/invoice_service.py - Invoice service → Invoice validation: accepts validated data
backend/app/services/invoice_service.py - Invoice routes → Invoice validation: validates requests
backend/app/api/invoices.py - Customer routes → Customer model: uses model
backend/app/api/customers.py - Parts routes → Part and stock model: uses model
backend/app/api/parts.py - Database access → Application settings: reads connection settings
backend/app/database.py - Database access → PostgreSQL: persists records
README.md - Invoice PDF generator → Invoice records: renders invoice data
backend/app/utils/pdf_generator.py - Quotation PDF generator → Invoice records: renders quotation data
backend/app/utils/pdf_generator_backup_old.py - Invoice PDF generator → Application settings: reads company and tax settings
backend/app/utils/pdf_generator.py - Quotation PDF generator → Application settings: reads company and tax settings
backend/app/utils/pdf_generator_backup_old.py - Invoice records → Database access: uses ORM base
backend/app/models/invoice.py