Inventory with purchase orders, built by Claude Code on Elements
Stock levels with low-stock flags and movement history, purchase orders emailed to suppliers and received line by line, all live.
How it's built
Pallethaven needed stock counts that change as people work, a history behind every number, purchase orders sent to suppliers by email, receiving line by line and a morning list of what to reorder. Each of those is a part of Elements, so the agent spent its 19 minutes on the shop itself.
- Live stock and orders. Products, stock movements, purchase orders and their lines are LiveTables. When a delivery is received, the stock list, the product's history and the order's status update on every open screen.
- A history behind every number. Every change to a count goes through one function that adjusts the stock and records why: a count, damage, a sale or a receipt against a purchase order.
- Purchase orders by email. Sending an order marks it sent and queues a job in the same transaction, so the supplier's email goes out once the order is saved as sent. Staff then receive it line by line, and the order moves to partly or fully received.
- A morning digest. A one-line cron schedule runs a job at 7am that emails each manager the products at or under their reorder point.
- Server calls as function calls. Creating orders, adding lines, receiving stock and editing products call server functions straight from the page with
@rpc. - Data and roles from SQL. Migrations define the shop and seed two logins, three suppliers, forty products and four orders, one in each status. Sessions and roles let staff count and receive stock and give managers the orders and product edits.
Why Elements
Elements is an integrated full-stack app framework and a project server. The project server checks the agent's work as it builds: it type-checks the server and browser code, analyzes the program, applies migrations and runs the tests, then reports the results to the agent. A security mistake, such as calling a server-only function from the browser, is a compile error. The agent reads the report and fixes its own mistakes before it tells you a feature is done. The same checks run on every feature you ask for next.
Run it yourself
- 1 Sign up
Already have an account? Sign in
- 2 Install and run the demo One prompt to paste into your agent.
The prompt
What Claude was given to build this app.
Build an inventory and purchasing app named pallethaven for a small retail business with one warehouse. Two kinds of accounts: manager and staff. - Products: SKU, name, supplier, cost, on-hand quantity, reorder point. - Stock list with search, and a "low stock" filter for anything at or under its reorder point. - Adjust stock with a reason (count, damage, sale). Every change is kept in a movement history per product. - Suppliers with contact email. - Purchase orders: a manager builds a PO for one supplier from low-stock products, sends it (emails the supplier a summary), and staff receive it line by line, which adds to on-hand quantity. PO status: draft, sent, partially received, received. - Every morning at 7am, email managers the list of low-stock products. Seed one manager, one staff member, three suppliers, forty products (some below reorder point), and four POs across statuses. Show the seeded logins on the sign-in page. Stock levels and PO status update in real time.