Mini ERP
Inventory and sales management with stock consistency at its core.
Atomic stock transactions 2026
Overview
Mini ERP is an inventory and sales MVP for a small business. It brings products, suppliers, customers, purchase orders, sales orders, and stock movements into one application. Administrators maintain master data and create accounts, while warehouse staff record incoming and outgoing goods. A dashboard summarizes stock levels, inventory value, sales, best-selling products, and recent movements.
The engineering focus is keeping stock consistent under concurrent requests. A sales order locks product rows with SELECT FOR UPDATE in product-ID order, checks availability, and writes the order, stock deductions, and stock-card entries in one PostgreSQL transaction. A failure rolls everything back. A database check also prevents negative stock, while money is stored as whole-rupiah integers to keep order totals exact.
The React and TypeScript frontend uses Vite, with a Go REST API built on chi and pgx. Docker Compose runs the stack, and the production image serves both the frontend and API from one origin. GitHub Actions defines backend, frontend, API-contract, and container checks. This is a portfolio MVP; the repository documents remaining limitations before business production use.
Key features
Orders commit together
Purchase and sales documents, stock changes, and movement records share one transaction, so a failed step cannot leave a partially recorded order.
Concurrent sales stay consistent
Product-row locks serialize competing sales. Insufficient stock returns a conflict, and a PostgreSQL constraint provides a second guard against negative inventory.
Every movement has context
The stock card records incoming and outgoing quantities, balances, source orders, and the user behind each movement.
Roles match daily work
JWT authentication and role checks separate administrator maintenance from warehouse operations, while the dashboard gives both roles an operational summary.