Appearance
TypeRuleProgramming language for finance and operations
As easy as a spreadsheet. More solid than an ERP.
Replace the spreadsheets your team can’t trust with one reliable system.
As easy as a spreadsheet. More solid than an ERP.
Replace the spreadsheets your team can’t trust with one reliable system.
The rules of a business belong to the people who run it. Not lost in a spreadsheet, not buried in an ERP.
A formula gets overwritten, a customer is typed twice, and nobody knows which file is right.
Months of consultants or custom code, and the rules end up buried where nobody can check them. Errors still get through.
Write a few files of TypeRule code. TypeRule does the rest: the database, the screens, and a check on every entry.
Nothing stops a wrong value, and the mistakes surface weeks later, in the margin report.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Customer | Product | Qty | Stock | Margin |
| 2 | Rossi Srl | Valve DN50 | 40 | 120 | =C2*24 |
| 3 | Rossi S.r.l.1 | Seal kit | 40 | 900 | =C3*5.7 |
| 4 | Bianchi SpA | Pump P200 | 122 | 8 | =C4*230 |
| 5 | Verdi & Figli | Valve DN50 | 12 | 120 | 2883 |
Write your data structure, your rules and your automations, all in one simple language that anyone can audit. Even AI can audit and write it.
entity Customer:
name: Text
orders: [Order] via customer
entity Product:
name: Text
cost: Money<EUR>
price: Money<EUR>
stock: Int where >= 0
entity Order:
customer: Customer
date: Date default today()
lines: [OrderLine]
state: enum(Draft, Confirmed, Shipped) default Draft
revenue = lines.sum(l => l.amount)
margin = lines.sum(l => l.margin)
flow state:
Draft -> Confirmed by confirm
Confirmed -> Shipped by ship
action confirm:
require margin > 0, "Below cost: this order loses money"
action ship:
for l in lines:
l.product.stock = l.product.stock - l.qty
entity OrderLine:
order: Order parent
product: Product
qty: Int where > 0 default 1
amount = product.price * qty
margin = (product.price - product.cost) * qty
check qty <= product.stock, "Not enough stock"$ typerule dev the app on http://127.0.0.1:8080
| customer | date | state | revenue | margin |
|---|---|---|---|---|
| Rossi Srl | 2026-11-23 | Confirmed | 2,876.00 € | 1,188.00 € |
| Bianchi SpA | 2026-11-23 | Shipped | 1,920.00 € | 690.00 € |
| Verdi & Figli | 2026-11-23 | Confirmed | 1,384.00 € | 518.00 € |
| Rossi Srl | 2026-11-23 | Draft | 2,970.00 € | 1,710.00 € |
| Bianchi SpA | 2026-11-23 | Draft | 1,550.00 € | 600.00 € |
Drag key figures, boards, buttons and forms onto a grid, in the app. Every drop is written back to a file, reviewed in git with the rest.
app "Order desk":
page desk "Desk":
Rename a field, change a type, migrate years of data: TypeRule checks the whole system first. A change that would break something never goes live, a migration that fails changes nothing, and every change can be previewed and undone. So you can experiment without fear.
Order has no field margin. Did you mean gross_margin?typerule check, also in CIRoles, rules and hidden fields live in the model, next to the data. They apply everywhere: in the app, in the API and inside every action. Sign-in with a code sent by email and API tokens are already built in.
role Sales:
read Customer, Product
read, edit Order where o => o.created_by == me
run Order.confirm where o => o.created_by == me
hide Product.cost
role Warehouse:
read Order, Product
run Order.ship
role Manager is Sales:
read, edit Order
show Product.costgiulia cannot run Order.shipEvery value ever written is kept, with who changed it, when and why. The history is chained by hashes, so altering the past is detected. Ledgers are append-only, confirmed documents are frozen, and a bulk change needs the approval of a second person: the guarantees finance and compliance ask for, from day one.
$ typerule db verify ✓ hash chain intact, tables match the history (26 records)
Ask three departments for the margin and you get three numbers: one counts drafts, one forgets returns, one uses last year’s costs. In TypeRule a metric is defined once, with an owner and a definition in plain words, and every report uses the same one.
It is certified: if a change anywhere in the model alters what it means, even a default far away, typerule check stops until it is approved again.
metric gross_margin(period: DateRange) -> Money<EUR>:
label: "Gross margin"
owner: "Finance"
definition: "Price minus cost of shipped orders."
value = Order
.where(o => o.state is Shipped and o.date in period)
.sum(o => o.margin)$ typerule certify gross_margin --approved-by "m.bianchi (CFO)" certified gross_margin: sha256:a1c018754ce6c703 (9 dependencies)
Every branch gets its own environment, with sample data or a copy of production. Try a migration, a new rule or a new screen on real data: production never notices. Merge the code when it works, delete the branch when it doesn't.
The code: your rules, your data, everything underneath.
Use it as it is, or build your own frontend on the API.
Start with screens built in the app. When you need more, build your own interfaces or connect any system through the API. Underneath, nothing changes: one truth, the same rules, permissions enforced by design.
Every screen, integration and agent works on the same data. No copies to reconcile.
An order beyond the stock is refused, whoever sends it.
Every API request runs as a user, with their rows and fields. No back door.
TypeRule has an MCP server: connect your project to Claude, ChatGPT or any assistant that speaks MCP, and describe what you need in plain words. The assistant writes the rules, TypeRule checks every line and runs the tests, and nothing changes until you approve it.
“An order can’t be confirmed if it loses money.” The assistant turns it into a rule you can read.
TypeRule checks the code and runs the tests. The assistant gets every error with its line, and fixes it.
Nothing reaches your data until you say yes, and every change stays on record.
Read https://typerule.com/llms.txt, then help me build my app with TypeRule.Thirty critical spreadsheets and four quick apps? Replace them with one system, without weeks of boilerplate.
Deliver custom management software sooner, with fewer data bugs. Your client gets readable code, not a black box.
The work around the ERP: production, returns, non-conformities, job costing. Where Excel is too fragile and the ERP too rigid.
No need to replace your ERP on day one. Start where the spreadsheet hurts most.
Commissions, budgets, cost allocations, cash forecasts.
Stock, lots, picking and shipments.
Work orders, progress and job costing.
Samples, results within limits, certificates.
Hours by person and project, approvals, billing.
Non-conformities, returns, corrective actions.
Requests, approvals, suppliers, contracts.
Machines, rooms, vehicles and people.
The same project runs anywhere. Keep it on your own servers, or let us run it for you.
One command on your machines, with SQLite or PostgreSQL. Nothing leaves your network.
Push your project and it's live. No servers to manage.
The sandbox runs the whole system in your browser. Change the rules, watch the app change, then download the project and run it with typerule dev.