- One-click sample data (six months of a tipper haulage firm) and a start-here panel on empty books; clearable in one click - Ctrl/Cmd+K command palette for pages, quick actions and contacts - Grouped navigation, page titles, business name in the header, and a single header on phones - Dashboard panels with titles above their content and links through - Invoices and bills: search, outstanding and overdue totals, view as customer, add a contact from the editor, filter by contact - Confirmation dialogs instead of browser prompts; error boundary - VAT screen opens on the first unfiled quarter for the business - Fix: VAT due date for a quarter ending on the 30th was a day early - Fix: routine payroll dates were shown as overdue with no way to know - Fix: debtor and creditor days overstated for a young business - Drop three.js from the dashboard (about 960 kB down to 46 kB) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Copperplate
UK accounting for owner-run businesses: a self-hosted web app and a portable AI agent, built on the same researched rulebook.
Invoicing · Banking · VAT with MTD filing · Payroll · Reports · Assistant
Quick start · What it does · Model providers · The agent · Limits · Configuration
The assistant, answering from the live books. Sample conversation on test data.
🧭 Two things in one repository
| What it is | Where | |
|---|---|---|
| 🖥️ Web app | A self-hosted accounting application with a real double-entry ledger | app/ |
| 🤖 Agent | Plain-Markdown instructions and a UK accounting knowledge base that load into any AI assistant | AGENTS.md, knowledge/ |
The app embeds the agent: the assistant inside the app is given the same instructions and knowledge base, plus a live snapshot of your books.
It was built for a tipper haulage company, so it knows about fuel, CIS, operator-licence financial standing and vehicle finance. Nothing stops any other small UK business using it.
🚀 Quick start
docker compose up -d
Open http://localhost:3000 and create the owner account. That is the whole setup.
The image is built by Gitea Actions on every push to main:
docker pull tig.sshah.email/cheeba/copperplate:latest
Your data lives in the copperplate-data volume (/data: the database and uploaded receipts). Back that volume up.
Use PostgreSQL instead of SQLite
POSTGRES_PASSWORD=change-me \
COMPOSE_PROFILES=postgres \
DATABASE_URL=postgres://copperplate:change-me@db:5432/copperplate \
docker compose up -d
Any postgres:// URL works, including an existing server. Uploaded receipts still live in the data volume.
Run it without Docker
cd app
pnpm install
pnpm build
pnpm start # http://localhost:3000
Needs Node 22 or later.
✨ What the app does
| Area | Details | |
|---|---|---|
| 🧾 | Invoices and quotes | Create, approve, email, share a customer link, convert quotes to invoices, record payments including CIS deductions, automatic overdue reminders at 1, 7 and 14 days, card payment through Stripe Checkout |
| 📸 | Bills and expenses | Supplier bills, and receipt capture from a camera or file that reads supplier, date, net, VAT and category for you to check |
| 🏦 | Banking | CSV statement import (Tide and most UK banks), duplicate detection, suggested matches to invoices and bills including receipts paid net of CIS, saved rules, transfers, undo |
| 💷 | VAT | The nine-box return from the ledger with every line behind it, sanity warnings, draft returns, filing through the HMRC Making Tax Digital API, locking of filed periods |
| 👷 | Payroll | 2026/27 PAYE (Scottish codes included), NI by category letter, directors' annual NI, pensions, student loans, Employment Allowance, payslips, ledger posting |
| 📊 | Reports | Profit and loss, balance sheet, cash flow, trial balance, aged debtors and creditors, 13-week cash forecast, KPIs including fuel and wages as a share of revenue |
| 🗂️ | Projects | Tag invoices, bills and bank lines to a job and see its profit |
| 📦 | Inventory | Items, stock quantities and value, reorder warnings, automatic movement from invoices and bills |
| 💱 | Multi-currency | Foreign-currency invoices and bills with European Central Bank rates |
| 🚛 | Vehicles and assets | Fixed-asset register with finance type, capital allowance claimed, test and tax dates |
| 📅 | Compliance calendar | Every filing and payment date for the next 12 months, built from your year end, VAT quarters, payroll and vehicles |
| 🔔 | Alerts | Overdrawn director's loan, VAT threshold approaching, operator-licence financial standing, cash forecast going negative, deadlines within 14 days |
| 💬 | Assistant | The Copperplate agent with the full knowledge base and your live figures, answering in formatted Markdown |
| 📱 | Platform | Installable PWA, responsive down to a phone, browser notifications, dark mode, Ctrl K command palette |
| 🧪 | Sample data | One click loads six months of a two-lorry tipper firm so every screen has something to show; one click clears it |
Every screen that posts money writes balanced double-entry journals. Entries inside a filed VAT period are locked and can only be corrected by a new entry.
🧠 Model providers
The assistant and receipt reading work with three providers. Pick one in Settings → Connections; each keeps its own API key and model.
| Provider | How it connects | Privacy control | Notes |
|---|---|---|---|
| Anthropic | Official SDK, Claude models | Follows your Anthropic organisation's retention settings | Default model claude-opus-5-5. Reads images and PDFs. Schema-enforced receipt extraction |
| Ollama Cloud | Native /api/chat at ollama.com |
Ollama states it does not train on prompts | Point the server address at your own Ollama machine to keep everything on your network |
| Command Code | Provider API at api.commandcode.ai. Claude models use its Anthropic route, all others its OpenAI-compatible route |
Zero data retention switch | Around a hundred models from one key. Needs a plan with Provider API access |
🔒 Zero data retention with Command Code
Turn on Zero data retention (ZDR) and Copperplate sends x-cmd-zdr: 1 with every request. Command Code then routes only to upstream hosts that neither store prompts nor train on them.
If the chosen model has no such route, the request fails with a clear message. It never falls back to a host that retains data. Some models cost more with ZDR on.
What is sent
- A question to the assistant sends the agent instructions, the knowledge base, your recent conversation, and a summary of the books (totals, balances, alerts and deadlines; not individual transactions).
- Capturing a receipt sends that one image or PDF.
- Nothing is sent unless you use those two features.
Note
Receipt reading on Ollama, and on non-Claude models through Command Code, accepts images only and needs a vision-capable model. Those routes are asked for JSON by instruction, so extraction is less dependable than on Claude.
⚠️ Read this before you rely on it
Copperplate is honest about its edges. These are the ones that matter.
| Area | Position |
|---|---|
| HMRC filing | Needs your own application on the HMRC Developer Hub. Sandbox works immediately. Filing real returns requires HMRC to approve that application for production. Until then, file elsewhere and use "Mark as filed" |
| VAT schemes | Standard (invoice) basis only. Cash accounting and flat rate are not calculated |
| Bank feeds | CSV import. A live Open Banking feed needs a regulated provider and is not included |
| Payroll | Calculated and posted, but RTI (FPS/EPS) is not submitted. Run the figures through RTI software such as HMRC Basic PAYE Tools |
| Year end | Corporation tax returns and Companies House accounts are not produced or filed |
| Inventory | Tracks quantity and value. Does not post cost-of-sales journals |
| Foreign currency | Posts at the rate entered. No revaluation or exchange differences |
| Responsibility | The director or owner remains legally responsible for every return. Copperplate is not a regulated accountant. Have a qualified accountant review the year-end accounts |
| Rules date | Checked 14 November 2026, valid for tax year 2026/27. Re-check anything used after 5 April 2027 |
How much of it has been tested
| Verified | Not yet verified |
|---|---|
| ✅ Ledger posting, VAT boxes, bank matching, period locking and payroll, by automated tests | ⬜ PostgreSQL end to end |
| ✅ Provider request shapes including the ZDR header, by automated tests against mocked responses | ⬜ A real chat or receipt read through Ollama Cloud or Command Code |
| ✅ Setup, invoicing and the main screens, by hand on SQLite at desktop and phone widths | ⬜ HMRC submission, Stripe payment and SMTP email against the real services |
| ✅ The Docker image builds and boots healthily in CI |
🏗️ How it fits together
flowchart LR
subgraph Browser["Browser · installable PWA"]
UI["React + shadcn/ui + Aceternity UI"]
SW["Service worker · notifications"]
end
subgraph Server["Node server · Hono"]
API["REST API"]
Ledger["Double-entry ledger"]
Jobs["Reminders and deadline alerts"]
LLM["Provider layer"]
end
DB[("SQLite or PostgreSQL")]
KB["AGENTS.md + knowledge/"]
UI --> API
API --> Ledger --> DB
Jobs --> DB
API --> LLM
KB --> LLM
LLM --> Anthropic
LLM --> Ollama["Ollama Cloud"]
LLM --> CC["Command Code · optional ZDR"]
API --> HMRC["HMRC MTD VAT API"]
API --> Stripe
API --> SMTP
| Layer | Built with |
|---|---|
| Front end | Vite, React 19, TypeScript, Tailwind CSS 4, shadcn/ui, 22 Aceternity UI components, TanStack Query, Recharts |
| Back end | Hono on Node 22, Kysely query builder, better-sqlite3 or pg |
| Money | Stored as integer pence. Every journal must balance or it is rejected |
| Offline shell | Workbox service worker. API responses are never cached, so figures are always live |
⚙️ Configuration
Everything optional can be entered in Settings inside the app, or supplied as environment variables.
| Variable | Purpose |
|---|---|
DATABASE_URL |
postgres://… for PostgreSQL. Leave unset for SQLite at $DATA_DIR/copperplate.db |
DATA_DIR |
Database and uploads. /data in Docker, ./data otherwise |
PUBLIC_URL |
The address customers and HMRC reach the app at. Needed for invoice links and the HMRC redirect |
PORT |
Default 3000 |
AI_PROVIDER, AI_MODEL |
anthropic, ollama or commandcode, and the model to use |
ANTHROPIC_API_KEY |
Anthropic key |
OLLAMA_API_KEY, OLLAMA_BASE_URL |
Ollama Cloud key; base URL for a self-hosted Ollama server |
COMMAND_CODE_API_KEY, CMD_ZDR |
Command Code key; CMD_ZDR=1 turns zero data retention on by default |
HMRC_CLIENT_ID, HMRC_CLIENT_SECRET, HMRC_ENV |
Your HMRC application; sandbox or production |
STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET |
Card payments. Point a checkout.session.completed webhook at /api/stripe/webhook |
SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, SMTP_FROM |
Outgoing email for invoices and reminders |
Important
Put the app behind HTTPS (a reverse proxy) for anything beyond local use. Sign-in cookies, the service worker, browser notifications and HMRC all expect it.
🤖 The agent
The agent is the app's brain in portable form: one instruction file and fifteen reference files, all plain Markdown.
| Platform | How to load it |
|---|---|
| Claude (Project) | Paste AGENTS.md into the project instructions; upload knowledge/, workflows/ and templates/, or just dist/copperplate-full.md |
| Claude (Skill) | Upload dist/copperplate-skill.zip under Settings → Capabilities → Skills |
| Claude Code | Clone and run claude. CLAUDE.md loads the agent; a copperplate subagent is defined too |
| Kiro | Open the folder. .kiro/steering/copperplate.md is always included |
| Cursor | Open the folder. .cursor/rules/copperplate.mdc applies automatically |
| Codex, Windsurf, Zed, Aider | AGENTS.md is read natively |
| GitHub Copilot | .github/copilot-instructions.md |
| Gemini CLI | GEMINI.md |
| ChatGPT, Gemini Gems, anything else | AGENTS.md as the instructions, dist/copperplate-full.md as the attached knowledge |
Used on its own, the agent prepares and checks figures; it cannot file anything. See workflows/migrating-from-tide.md for what still needs filing software.
📚 Knowledge base
| File | Covers |
|---|---|
00-rates-and-thresholds |
Every 2026/27 rate, band and limit in one place |
01-business-structures |
Sole trader, partnership, company; registrations |
02-bookkeeping |
Records, double entry, posting patterns, invoices, self-billing |
03-vat |
Registration, MTD, schemes, input tax, reverse charge, penalties |
04-payroll |
RTI, pay calculation, statutory pay, pensions, benefits, status |
05-corporation-tax |
Rates, adjustments, losses, close companies |
06-capital-allowances |
AIA, full expensing, pools, vehicle finance |
07-company-law |
Directors' duties, Companies House, identity verification |
08-directors-pay |
Salary, dividends, loan accounts, s455 |
09-sole-traders-mtd |
Self Assessment and MTD for Income Tax |
10-haulage-and-tipper |
Sector costs, licensing, drivers, waste and materials |
11-cis-construction |
CIS and which tipper work falls inside it |
12-calendar-and-penalties |
Deadlines and what lateness costs |
13-year-end-accounts |
FRS 105, FRS 102, the close checklist |
14-sources |
Primary sources, legislation, the re-check list |
After each Budget and every April: update 00-rates-and-thresholds.md, work through the re-check list in 14-sources.md, then rebuild the single-file and skill packages:
bash scripts/build.sh
🛠️ Development
cd app
pnpm install
pnpm dev # API on :3000, Vite on :5173 with hot reload
pnpm test # ledger, VAT, banking, payroll and provider tests
pnpm typecheck
pnpm build && pnpm start
Repository layout
copperplate/
├── AGENTS.md the agent
├── knowledge/ 15 reference files
├── workflows/ onboarding, migration, month end, VAT, payroll, year end
├── templates/ company profile, chart of accounts, CSV layouts
├── dist/ single-file agent and Claude Skill package
├── app/
│ ├── server/ Hono API
│ │ ├── ledger.ts journals, documents, payments
│ │ ├── bank.ts CSV import and reconciliation
│ │ ├── vat.ts nine boxes and HMRC MTD
│ │ ├── payroll.ts 2026/27 PAYE and NI
│ │ ├── reports.ts statements, forecast, KPIs
│ │ ├── llm.ts Anthropic, Ollama, Command Code
│ │ └── extras.ts calendar, alerts, reminders, Stripe, assistant
│ └── src/ React front end
├── Dockerfile
├── docker-compose.yml
└── .gitea/workflows/docker.yml
🗺️ Roadmap
- Agent and knowledge base
- Web application
- Choice of model provider with zero data retention
- PostgreSQL verified end to end
- Cash accounting and flat rate VAT
- Live Open Banking feed
- Cost-of-sales posting for inventory
- RTI payroll submission