Built with my team for a computational thinking course. Products carry QR codes that the app reads from a webcam with OpenCV and PyZbar, and admins and cashiers get different views of the same data.
Sales history is stored in CSV through pandas and charted with Matplotlib. The inventory totals are answered by a segment tree we wrote ourselves instead of reaching for a library.
Point the box at the camera.
The cashier view runs the webcam through OpenCV and decodes QR codes with PyZbar. A recognized code pops a quantity dialog, the item lands in the cart, and checking out writes every line to the sales history.
Every product in the sample catalog has its own QR code, all hundred of them included with the source. Admins see Inventory, Scan and Analytics; a cashier only gets the scanner.
Where the money went.
Admins get a dashboard on top of the same CSV files: revenue, transactions and items sold, a daily revenue chart and sales by category, drawn with Matplotlib inside the app.
The numbers in the picture are the sample sales data that ships with the project.
A segment tree, written by hand.
Inventory totals come from a segment tree over the product list. Each leaf is one product and each parent the sum of its children, so a sale only touches the path from its leaf to the root, and any range total comes back in logarithmic time.
No library: just build, update and query, the way we learned them.