A working multi-location stock tracker for an operations team: items, stock movements, a dashboard with server-side KPIs, and a nightly function that flags everything below its reorder point.
The point of this repo is the workflow. The app lives on
AgentUI, but you never open the web editor — you
create it, edit it as ordinary files, and deploy it with
@agentuiai/cli.
npm install -g @agentuiai/cli
agentui auth login
agentui project create --name "Inventory Tracker"
cd inventory-trackerproject create makes the project on the platform and scaffolds the local
folder — there is no separate mkdir and no separate sync. It writes an
AGENTS.md next to the code describing the entity SDK, the file layout and the
rules, so a coding agent can pick the project up without being told anything
else.
Copy the entities/, pages/, components/ and functions/ folders from this
repo into yours, then:
agentui validate # server-side check before anything ships
agentui project push --dry-run # see the diff without sending it
agentui project push
agentui build && agentui deploypush diffs your working tree against a local manifest and sends only what
changed. Deleting a file is opt-in with --delete, so a stray rm cannot wipe
components on the server.
Wire the reorder scan to a nightly run:
agentui automation trigger set schedule "0 6 * * *"
agentui functions invoke reorderScan
agentui functions logs reorderScanentities/Item.schema.json SKU, quantity, reorder_point, location_code
entities/StockMovement.schema.json receipt / issue / adjustment, dated
entities/Location.schema.json warehouse or store codes
pages/Dashboard.jsx KPIs via server-side aggregate
pages/Items.jsx list + create, React Query
pages/Movements.jsx receive stock, updates the item in one mutation
components/ KpiCard, ItemForm, StockLevelBadge
functions/reorderScan.js Deno function, flags items below reorder point
Entities are JSON Schema files. The platform generates the CRUD API from them,
so entities/Item.schema.json is the only place the shape of an item is
defined:
{
"name": "Item",
"type": "object",
"properties": {
"sku": { "type": "string", "minLength": 1 },
"quantity": { "type": "number", "default": 0 },
"reorder_point": { "type": "number", "default": 0 }
},
"required": ["sku", "name"]
}KPIs are computed on the server. Item.list() and Item.filter() are hard
capped at 300 rows no matter what limit you pass, so summing in JavaScript
produces a number that is correct in development and quietly wrong once the
table grows. Dashboard.jsx uses Item.aggregate({ metrics: [...] }) instead.
"Below reorder point" is materialised, not queried. It compares two columns,
and aggregate filters compare a field to a literal. functions/reorderScan.js
writes the comparison into a needs_reorder boolean on a schedule, and the
dashboard aggregates on that.
Dates use YYYY-MM-DD. For a format: "date" field, passing
new Date().toISOString() stores the local calendar date, so an evening write
in Sydney lands on tomorrow. Movements.jsx uses
format(new Date(), "yyyy-MM-dd") from date-fns.
Every agentui subcommand takes --json and prints machine-parseable JSON on
stdout, structured errors included — the same contract the AWS and GitHub CLIs
offer:
agentui --json project list
agentui --json project push --dry-run
agentui project open --preview --print # prints a URL and nothing elsePoint your agent at AGENTS.md, let it edit the JSX, and have it run
agentui validate before agentui project push.
- CLI docs: https://www.agentui.ai/en/agentui-cli/
- Flat command reference for agents: https://www.agentui.ai/agentui-cli.md
- Package: https://www.npmjs.com/package/@agentuiai/cli (MIT, Node 22+)
MIT.