Projects
2026

Dashtreme

A FastAPI admin core for e-commerce operations: variant-aware catalog, inventory with reservations and moving-average costing, a full procurement lifecycle, role-based access, and an audit log of every change.

Year
2026
Focus
Backend

Overview

Any admin panel can list orders. The hard part is making the numbers behind them true - that the stock figure on screen matches the shelf, and that last month's margin does not quietly change when this month's supplier raises a price. Dashtreme is my attempt at that operations layer, where inventory, cost and margin have to agree with each other.

Stock is owned by the variant, not the product, because the variant is what actually sells. Available stock is on-hand minus reserved, and the two move with order state: confirming an order reserves, cancelling releases, completing commits the reservation into a real deduction. Because the rule lives in one place, 'available' cannot drift away from what the warehouse has.

Cost is a moving average per variant. Receipts that are still pending do not touch valuation - only processing one does. COGS is recognized when stock is committed, and each order line stores its own realized COGS at that moment, so a cost change next quarter can never rewrite the margin on a sale that already happened. Returns reconcile back at the cost the unit was sold at.

Procurement closes the loop rather than leaving replenishment as a spreadsheet. Variants at or below their reorder threshold become candidates, candidates become draft purchase orders, and a PO moves through issued, partially received and received, with each linked receipt updating stock and cost in the same step.

Governance is built in, not bolted on: three roles (support, manager, super_admin), and a guard that stops the last active super_admin from demoting or deactivating themselves into lockout. Every mutation - a price edit, a stock adjustment, a role change - is written to an audit log, and the CSV exports for orders, catalog, purchase orders and profitability are role-aware too.

Highlights

Inventory that stays true

Variant-level stock with reserve, release and commit tied to order state, so available is always on-hand minus reserved.

Margin that stays honest

Moving-average cost per variant, with per-line realized COGS so later cost changes never rewrite past sales.

Procurement lifecycle

Reorder thresholds feed draft purchase orders, which become linked receipts that update stock and cost together.

Returns and refunds

Partial quantities and amounts, with optional restock that reconciles COGS at the recognized sold-unit cost.

RBAC with a safety catch

Support, manager and super_admin roles - and the last active super_admin cannot be locked out.

Audited and exportable

Every admin mutation hits an audit log; orders, catalog, POs and profitability export to role-aware CSV.

Stack

FastAPIPostgreSQLSQLAlchemyRedisDocker