All projects
No. 12
Sales & inventory
Streamlit point of sale and inventory
- My role
- Sole author
- Period
- Nov 2025
The problem
A small business needs to record sales, know what's in stock and hand out a receipt without paying for a point-of-sale system. I wanted to solve it with a simple web app on top of a real database.
What I built
I built it alone, in 10 commits from November 2 to 23, 2025.
- A Streamlit app with 7 modules: dashboard, sales, products, purchases, expenses, reports and settings.
- Sign-in with bcrypt passwords, a signed session cookie with expiry and 2 roles, admin and cashier. A kiosk mode hides purchases, expenses, reports and settings from anyone who isn't an admin.
- Sales with a cart, configurable VAT and a PDF receipt generated with ReportLab.
- Purchases that update stock and cost (last cost or weighted average), expense tracking, period reports with charts, CSV export and a ZIP backup of 7 tables.
- PostgreSQL access through SQLAlchemy, with automatic commit or rollback per transaction.
Architecture
Results
There are no usage metrics to report. What can be checked is the code: the sale, purchase and reporting flows, and role-based access.
Known limits
- Everything lives in a single 2,363-line
app.py. Splitting data, domain and UI is the first thing I'd do. - The database schema was created by hand and isn't in the repository (
init_dbdoes nothing), so it can't be set up from scratch without rebuilding it. - There are no tests.
- The README presents sign-in as optional or in progress, even though it's implemented.