Phase 1 — REST + JavaScript

Inventory & POS System

A clothing shop with 200+ SKUs tracks inventory in a spreadsheet. They reorder stock manually when they notice items are low. They want real-time stock tracking, low-stock alerts, sales logging, and reports showing what's selling and what's dead stock.

Two main views: POS screen for cashiers and back-office dashboard for the owner. Harder than the invoice system — multi-role access, product variants with individual stock counts, atomic stock operations under concurrency, and a POS interface that needs to be fast enough for daily use.

What to Build

Phases

1Schema design: Product (with variants), Sale (with line items), StockAdjustment, PurchaseOrder, User. Think hard about variants — "Blue T-Shirt Size M" needs its own stock count but shares a product page.
2Backend: Product CRUD, sale processing (deduct stock atomically — what if stock hits 0 mid-transaction?), stock adjustment logging, purchase order workflow, report aggregation endpoints.
3POS frontend: fast, keyboard-friendly. Search by name or SKU, cart management, checkout. Needs to be snappy.
4Admin frontend: product management, inventory overview, alerts, purchase orders, reports with charts. Deploy.

Decisions You'll Make

How to model variants (separate docs? embedded array? Variant collection referencing Product?). How to prevent stock going negative during concurrent sales (transactions? optimistic concurrency?). How to structure POS cart state (useReducer: ADD_ITEM, REMOVE_ITEM, SET_QTY, APPLY_DISCOUNT, CLEAR). How to build fast product search for cashiers. How to calculate profit margins using aggregation.

Stack

React Express MongoDB Mongoose JWT React Router React Query useReducer useContext Redux Toolkit Custom Hooks Vitest SuperTest