Build an inventory system
How to build an inventory system with AI
To build an inventory system, describe who it is for and what they do in it, and let Forge64 plan and generate the app. A stock and purchasing system of record: items with variants and units of measure, multi-location stock from an insert-only movement ledger, purchase requisitions through approved purchase orders, goods receipt and three-way match against supplier invoices, reorder rules, cycle counts, transfers, and valuation. The core parts of a first version are companies, warehouses and locations, purchasing and warehouse roles, items, variants and units, stock movement ledger and requisitions and purchase orders.
Last checked
What the first version needs
These are the parts a inventory system needs before it is useful. Each one is something the plan covers.
- Companies, warehouses and locations: Hold stock across warehouses, bins and consignment locations under one tenant.
- Purchasing and warehouse roles: Buyers, approvers, receivers and AP see and do different things.
- Items, variants and units: Define what is stocked, with variants, packaging and unit-of-measure conversions.
- Stock movement ledger: Every change of quantity is a movement; balances are derived and provable.
- Requisitions and purchase orders: Control what is bought, from whom, at what price, and who agreed.
- Approval chains: Route requisitions and POs by amount, category and cost center.
- Segregation of duties: Requester, approver, receiver and invoice-matcher must be different people for the same spend.
- Goods receipt and three-way match: Receive against POs and match quantity and price to the supplier invoice before payment.
- Stock and spend audit trail: Show who changed prices, approved spend, adjusted stock or overrode a match.
Parts you can add in the first version
- Reorder rules and suggestions: Suggest what to buy before stock runs out.
- Cycle counts and adjustments: Reconcile physical stock to the system with accountable adjustments.
- Catalog and opening-stock import: Load items, suppliers, prices and opening balances.
- Exception queue: Work through match exceptions, receiving discrepancies and count variances.
- Reports and labels: Stock valuation, aging, supplier performance and printable pick, receive and barcode labels.
The data it stores
Each table below becomes part of the Postgres database that belongs to your app.
- warehouses: locations (zone/aisle/bin) belong to a warehouse in the locations table keyed by (warehouse_id, code).
- locations: kind: receiving|storage|picking|quarantine|shipping|consignment.
- items: valuation_method: fifo|average; variants in item_variants (item_id, attributes_json, sku_suffix); UOM conversions in uom_conversions.
- stock_moves: insert only; kind: receive|issue|transfer_out|transfer_in|adjust|count|return; a move needs at least one of from/to location; reversals reference the original.
- stock_balances: cache maintained only by the posting function; available = on hand minus reserved; verified nightly against stock_moves.
- suppliers: bank changes require a second approver; rating is updated from receipt timeliness and quality.
- purchase_orders: status: draft|pending_approval|approved|sent|part_received|received|closed|cancelled; CHECK (approved_by is distinct from requested_by); lines in po_lines (item, qty, price_minor, tax_minor).
- goods_receipts: lines in receipt_lines (po_line_id, qty, lot_code, location_id, condition); receiving creates stock_moves in the same transaction; over-receipt beyond tolerance needs approval.
- supplier_invoices: match_status: unmatched|matched|price_variance|qty_variance|override; override needs approval and a reason.
Pages and endpoints
| Route | Who can use it | What it does |
|---|---|---|
| /inventory | authed | stock by item and location with filters, low-stock flags and movement drill-down. |
| /inventory/scan | authed | mobile-friendly scan flow for receive, move, count and pick using camera or scanner input. |
| /purchasing/requisitions | authed | create and track requisitions. |
| /purchasing/orders | authed | PO board, approval, send and revision. |
| /receiving | authed | receive against PO with discrepancy capture. |
| /payables/matching | authed | three-way match exceptions and release to payment. |
| /reports/valuation | authed | stock valuation, aging and supplier performance. |
| /api/stock/moves | authed | post a movement; Idempotency-Key required; balances checked in the posting transaction. |
| /api/purchase-orders/[id]/approve | authed | approve the next step; requester is refused. |
| /api/import/items | authed | stage, validate and commit a catalog import. |
| /api/webhooks/ecommerce-orders | internal | reserve stock from storefront orders; signature verified, idempotent by event id. |
What to leave out of version one
- No demand forecasting beyond simple reorder suggestions in phase 1.
- No robotics, WCS or automated storage integrations.
- No automatic sending of purchase orders from suggestions.
- No editing or deleting of stock movements; reversals only.
- No payment execution to suppliers (see accounting-erp).
How Forge64 builds it
Forge64 matches your description to one of 25 reference architectures, writes the plan and data model into the project, generates the app, and runs a quality gate over the code before you see it. Each app gets its own Postgres database and sign-in with no per-user fee. Hosting on Forge Cloud and Forge Payments are rolling out.
This is a reference design for the category, not a promise that every item is generated today. Built-ins such as background jobs, file uploads and search are rolling out; email sent from your app is coming soon, so anything here that needs it is something you add yourself for now.
FAQ
- What does an inventory system need first?
- Companies, warehouses and locations, purchasing and warehouse roles, items, variants and units, stock movement ledger, requisitions and purchase orders and approval chains. The plan for a inventory system covers all of these before it generates code.
- What should I leave out of the first version of an inventory system?
- No demand forecasting beyond simple reorder suggestions in phase 1. No robotics, WCS or automated storage integrations. No automatic sending of purchase orders from suggestions.
- Which products define the inventory system category?
- Well-known examples include Odoo Inventory, Fishbowl, Cin7, NetSuite Inventory and Zoho Inventory. Use them to decide which features your users expect, then describe your own version.
Build your app with Forge64
One prompt to a running app with auth, database, hosting and payments. Start free, no credit card required.
Start building for free