How mdaamir2001/billing-system works
This is a small server-rendered billing application. The main workflow is cashier bill entry, product/stock validation, totals and change calculation, purchase persistence and stock/drawer updates, followed by an invoice result and background email. Separate branches manage products and retrieve purchase history. The excerpts show router ownership of these calls; README documents template pages, configurable database and asynchronous email. The template files and some route implementations were not sampled, so their internal behavior is not expanded.
Main entry points: billing.py Bill generation · main.py FastAPI app · products.py Product management · purchases.py Purchase history
Components 15
Web workflows
- FastAPI app
app/main.py - Product management
app/routers/products.py - Bill generation
app/routers/billing.py - Purchase history
app/routers/purchases.py - Data schemas
app/schemas.py - HTML views
app/templates
Billing services
- Bill and change math
app/services/billing.py
Persistence
- Data access
app/crud.py - Billing records
app/models.py - Database sessions
app/database.py - SQL database
Invoice delivery
- Invoice email
app/services/email.py
Other components
- Cashier
- Customer
- SMTP server
Connections 21
- FastAPI app → Product management: registers
app/main.py - FastAPI app → Bill generation: registers
app/main.py - FastAPI app → Purchase history: registers
app/main.py - Cashier → Product management: manages products
README.md - Cashier → Bill generation: submits bill
README.md - Customer → Purchase history: requests history
README.md - Product management → Data access: uses
app/routers/products.py - Bill generation → Data access: uses
app/routers/billing.py - Purchase history → Data access: uses
app/routers/purchases.py - Bill generation → Bill and change math: calculates totals and change
app/routers/billing.py - Bill generation → Invoice email: schedules invoice
app/routers/billing.py - Product management → HTML views: renders pages
README.md - Bill generation → HTML views: renders bill pages
app/routers/billing.py - Purchase history → HTML views: renders history
app/routers/purchases.py - Bill generation → Customer: emails invoice
README.md - Invoice email → SMTP server: sends through
README.md - Data access → Billing records: queries and updates
app/crud.py - Billing records → Database sessions: uses base
app/models.py - Database sessions → SQL database: connects
README.md - FastAPI app → Database sessions: creates tables
app/main.py - Bill generation → HTML views: returns bill result
app/routers/billing.py