Build a POS & billing app.
Shell → client → server → advanced.
A complete point-of-sale and billing app in four stages. Start with a static POS shell, add a client-side cart with localStorage, move the data to Flask + SQLite with a sales / sale_lines / payments schema and an atomic checkout, then grow the data layer: receipt printing, refunds, a Z-report, and hold/resume. The same four-stage arc as the CRM and Inventory builds — shell, client logic, backend, advanced data layer. Each stage adds exactly one layer and stops.
What you end up with: a working POS app — a product grid, a live cart, an atomic checkout, a printable 80mm receipt, a sales history with refunds, and a Z-report for the end of the day. A Flask + SQLite backend with three POS tables (sales, sale_lines, payments) that reads products from the Inventory backend's shared database and writes stock_movements rows on every sale. The whole thing runs on your laptop with three commands.
What it is not: multi-register sync, hardware integration (cash drawer, card terminal), offline-first sync, or multi-store. Those are separate concept courses, not Stage 05.
🗺️ The four stages
Each stage adds exactly one layer. Stage 04 is the last one.
The static shell. A two-column layout: product grid on the left, cart on the right, totals at the bottom, a big Charge button, and an 80mm thermal receipt modal. No data, no logic, no JavaScript beyond a demo focus ring. Just the layout that Stage 02 brings to life.
Make it work. Tap a product → it's added to the cart. Adjust quantity → the line total and grand total update live. Remove → the line goes away. Charge → a payment modal with cash tendered and change due. Complete sale → the cart clears and a receipt shows. The cart persists in localStorage across reloads. Focus returns to the barcode input after every action. Tax rounding is documented and consistent.
Give it a server. Flask + SQLite. Three tables — sales, sale_lines, payments — with two foreign keys. POST /api/sales is the atomic checkout: insert the sale, insert the lines, insert the payment, write stock_movements rows, update products.quantity — all in one transaction. Reads products from the Inventory backend's shared database. Line prices are snapshotted at sale time. Sold products cannot be deleted (RESTRICT).
Make it real. Printable 80mm receipts via @media print. Sales history with date/payment filters and pagination. Refunds as reversal sales (the original stays immutable). A Z-report — total sales, tax collected, by payment method — computed with SQL aggregates. Hold/resume a sale via sales.status. Barcode focus management. Archived products (sold products can't be deleted, but can be hidden). This is the final stage.
🗄️ The data model
Three POS tables, two foreign keys, one shared catalog.
products ← shared with Inventory (read-only from POS) suppliers ← shared with Inventory (not used by POS) stock_movements ← shared with Inventory (POS writes reason='sold'/'refunded') sales ├── id ├── cashier_id ← text in Stage 03; auth later if you take the auth course ├── subtotal ← cached (derived from lines, stored for speed) ├── tax_total ← cached ├── discount_total ← cached ├── grand_total ← cached ├── status ← 'open' | 'paid' | 'voided' | 'held' ├── created_at └── paid_at sale_lines ← THE third table ├── id ├── sale_id FK → sales.id ON DELETE CASCADE ├── product_id FK → products.id ON DELETE RESTRICT ├── qty ├── unit_price ← snapshot at time of sale ├── line_total ← qty × unit_price └── created_at payments ├── id ├── sale_id FK → sales.id ON DELETE CASCADE ├── method ← 'cash' | 'card' | 'other' ├── amount └── created_at
Why RESTRICT on sale_lines.product_id
You cannot delete a product that has been sold. That would orphan the sale line and break every historical report. Products can be archived (Stage 04) but not deleted.
Why unit_price is snapshotted
If you raise a product's price tomorrow, today's sales must still report today's prices. The line stores what the customer was actually charged. This is accounting, not UI.
Why the totals are cached
Subtotal, tax, and grand total are derived from lines — but stored on the sale for fast history queries. The transaction guarantees they stay in sync with the lines.
Why POS reads Inventory's products
One catalog, two apps. Inventory owns it; POS consumes it. The POS writes stock_movements rows on every sale, so Inventory's audit log shows POS sales as reason='sold'.
📦 What you build, stage by stage
A concrete picture of the app at each point.
localStorage. Still single-device, still no server.📥 Downloads
Available as each stage ships.
🔗 Related tracks — not part of this build
Where to go after Stage 04.
The POS build is four stages and it will be complete. The things that could be a Stage 05 — multi-register sync, hardware integration, offline-first, multi-store — are separate concept courses. They apply to any POS, not just this one.
cashier_id field in the POS becomes a real user when you take this course.🧱 Build something new
The four-stage arc is a template. Shell → client logic → backend → advanced data layer works for any app that has a "record of a transaction":
Same four stages. Same transaction discipline. Same foreign-key structure. The pattern is the reusable thing.