# Open-Sourcing Our Zero-Dependency TypeScript 3-Statement Accounting Engine & 979-Formula SBA Excel Model (MIT)

> Source: <https://dev.to/tobias_halloran/open-sourcing-our-zero-dependency-typescript-3-statement-accounting-engine-979-formula-sba-excel-45pf>
> Published: 2026-12-03 14:38:22+00:00

**Key takeaway:** The engine's 60-month loop ties the balance sheet to exactly $0.00 across all 24 NAICS presets by computing operating cash flow as net income plus depreciation minus changes in AR and inventory plus changes in AP, rather than letting an LLM generate or plug P&L lines.

Most financial model spreadsheets floating around the internet fail the single check every commercial bank underwriter runs in the first 60 seconds: **does the Balance Sheet actually balance to `$0.00` every month across 60 months?**

When we built **[ProFormaPlan](https://www.proformaplan.com?utm_source=devto&utm_campaign=oss_launch)**—a US small-business planning and 5-year financial modeling web app—we refused to let an LLM hallucinate P&L tables or plug arbitrary "miscellaneous" lines to force a balance sheet to tie. Instead, we wrote a deterministic, zero-dependency TypeScript accounting engine and a native-formula Excel workbook generator.

Today we open-sourced the core TypeScript underwriting modules, 24 US NAICS industry benchmark presets, unit test suite, and a full unlocked **8-tab, 979-formula `.xlsx` sample workbook** under the **MIT License**:

**GitHub Repository:** [https://github.com/proformaplan/sba-5yr-financial-model-excel](https://github.com/proformaplan/sba-5yr-financial-model-excel)

**Direct `.xlsx` Release Download (`v1.0.0`):** [https://github.com/proformaplan/sba-5yr-financial-model-excel/releases/tag/v1.0.0](https://github.com/proformaplan/sba-5yr-financial-model-excel/releases/tag/v1.0.0)

Ask a general-purpose chatbot to generate a 5-year business plan financial model and you almost always get three silent accounting bugs:

Our open-source `src/engine.ts` runs a strict 60-month accounting loop from Month 0 (Opening Balance Sheet from Sources & Uses) through Month 60:

```
// Month-by-month indirect cash flow & Balance Sheet reconciliation:
// Operating Cash Flow = Net Income + Depreciation - ΔAR - ΔInventory + ΔAP
// Financing Cash Flow = -Principal Payment
// Ending Cash         = Beginning Cash + Operating CF + Financing CF
// Balance Check       = Total Assets - (Total Liabilities + Total Equity) === $0.00
```

Across all 24 US NAICS presets—from a `$400K` Full-Service Restaurant (`NAICS 722511`) to a `$280K` Regional Trucking Carrier (`NAICS 484110`) to a `$550K` Short-Term Rental portfolio (`NAICS 721199`)—the maximum balance-sheet variance across all 60 months is strictly **`$0.00`**.

Zero `npm` runtime dependencies—runs straight on Node 22.6+ or Node 24+ native TypeScript stripping:

```
git clone https://github.com/proformaplan/sba-5yr-financial-model-excel.git
cd sba-5yr-financial-model-excel
npm test
```

`src/engine.ts` — 60-month integrated Income Statement, Indirect Cash Flow, Balance Sheet (`$0.00` tie-out), and SBA SOP 50 10 8.1 Scorecard`src/presets.ts` — 24 US NAICS small-business assumption presets`src/sbaLoan.ts` — Level-payment `PMT` amortization, FY2027 SBA 7(a) upfront guarantee fee tiers, and minimum EBITDA required for 1.15x / 1.25x DSCR`src/acquisition.ts` — Business acquisition SDE -> CFADS waterfall, 10% equity injection check (including the SBA rule allowing a full-standby seller note for up to 5% of the 10% floor), and Year-1 Cash-on-Cash return`src/breakeven.ts` — Contribution margin, fixed OpEx + debt-service break-even, and Margin of Safety`templates/sba-5yr-3-statement-financial-model-sample.xlsx` — Unlocked 8-tab workbook with `=SUM`, `=PMT`, `=IPMT`, `=PPMT`, cross-sheet references), zero macros, zero locked sheets; opens cleanly in Microsoft Excel, Google Sheets, and LibreOffice Calc.
If you want to run the same TypeScript engine interactively in the browser before cloning:

Fork it, run `npm test`, inspect every formula in the sample `.xlsx`, or open an issue on GitHub if you want to see another US NAICS vertical added.

*Disclaimer: Financial modeling software and illustrative US small-business benchmarks only—not a CPA, attorney, lender, or loan broker, and does not guarantee loan approval.*
