Build an accounting system
How to build an accounting system with AI
To build an accounting system, describe who it is for and what they do in it, and let Forge64 plan and generate the app. A finance system of record for one or more legal entities: chart of accounts, balanced immutable journals in integer minor units, AP bills with approval and payment runs, AR invoices and cash application, bank reconciliation, multi-currency with FX revaluation, intercompany eliminations, consolidated statements, period close with locks, and a full audit trail. The core parts of a first version are entities and consolidation groups, chart of accounts, general ledger and journals, fiscal periods and close and accounts payable.
Last checked
What the first version needs
These are the parts a accounting system needs before it is useful. Each one is something the plan covers.
- Entities and consolidation groups: Model each legal entity separately with its own books and base currency, grouped for consolidation.
- Chart of accounts: A governed list of accounts per entity with a standard roll-up for reporting.
- General ledger and journals: Every transaction is a balanced journal; reports are derived from journal lines.
- Fiscal periods and close: Lock closed periods so history cannot move, and run a repeatable month-end checklist.
- Accounts payable: Capture vendor bills, route them for approval, and pay them in controlled runs.
- Accounts receivable and invoicing: Issue invoices, apply cash and chase overdue balances.
- Approval chains: Amount- and role-based approval of bills, journals and payment runs.
- Segregation of duties: The person who creates a payment or journal cannot also approve it.
- Financial audit trail: Show who posted, approved, changed or reopened anything, in order, tamper-evident.
Parts you can add in the first version
- Statement and ledger import: Load opening balances, bank files and vendor lists with a dry run.
- Tax codes and returns support: Apply VAT/GST/sales tax by code and report the tax position.
The data it stores
Each table below becomes part of the Postgres database that belongs to your app.
- entities: status: active|dormant|closed; tax id is encrypted; base_currency is immutable once journals exist.
- gl_accounts: type: asset|liability|equity|revenue|expense; accounts with postings are deactivated, never deleted; currency set for bank and foreign-currency accounts.
- journals: source: manual|ap|ar|bank|fx|intercompany|consolidation|opening; status: draft|pending_approval|posted|reversed; posted rows are immutable; CHECK (approved_by is distinct from created_by) for manual journals.
- journal_lines: CHECK (amount_minor > 0), direction D|C; deferred trigger enforces sum(D)=sum(C) per journal in transaction currency and in functional currency; immutable once posted.
- fiscal_periods: status: open|soft_closed|closed; trigger rejects journals into closed; reopen requires two approvers and is audited.
- vendors: bank detail changes need a second approver and open a 48 h payment hold for that vendor.
- bills: status: draft|submitted|approved|scheduled|paid|void; CHECK (approved_by is distinct from created_by); amounts in integer minor units.
- invoices: status: draft|issued|part_paid|paid|void|credited; issuing allocates the number inside the transaction; issued invoices are immutable, corrections are credit notes.
- receipts: allocations to invoices live in receipt_allocations rows (invoice_id, amount_minor) summing to at most the receipt amount.
Pages and endpoints
| Route | Who can use it | What it does |
|---|---|---|
| /ledger | authed | journal list and drill-down to source documents. |
| /ledger/journals/new | authed | manual journal with live balance check and attachment. |
| /payables/bills | authed | bill inbox, approval and payment scheduling. |
| /receivables/invoices | authed | invoice list, issue, credit note, aging. |
| /banking/reconcile | authed | two-pane match of statement lines to ledger. |
| /close | authed | period close checklist, lock and reopen request. |
| /reports | authed | trial balance, balance sheet, income statement, cash flow, aging, tax summary. |
| /api/journals | authed | create and post a journal; Idempotency-Key required; period and balance enforced. |
| /api/bills/[id]/approve | authed | approve the next step; maker is refused. |
| /api/invoices/[id]/issue | authed | allocate number, post journal, render PDF; Idempotency-Key required. |
| /api/payment-runs | authed | build and release a payment batch file; two approvers. |
What to leave out of version one
- No filing of tax returns or statutory accounts; the app produces the numbers and exports.
- No editing or deleting of posted journals; reversals only.
- No floating point money or FX rates.
- No holding of customer funds; payment execution is via the bank file or a licensed processor.
- No payroll calculation (see hr-payroll).
- Intercompany and consolidation: plan for it, build it later.
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 accounting system need first?
- Entities and consolidation groups, chart of accounts, general ledger and journals, fiscal periods and close, accounts payable and accounts receivable and invoicing. The plan for a accounting system covers all of these before it generates code.
- What should I leave out of the first version of an accounting system?
- No filing of tax returns or statutory accounts; the app produces the numbers and exports. No editing or deleting of posted journals; reversals only. No floating point money or FX rates.
- Which products define the accounting system category?
- Well-known examples include Xero, QuickBooks, NetSuite, Odoo Accounting and Sage Intacct. 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