Skip to content

HMB-research/open-accounting

Repository files navigation

Open Accounting

🇪🇪 Made in Estonia | Open-source accounting software for modern businesses

CI codecov Go Report Card License: MIT Go Version

PostgreSQL SvelteKit Vite TypeScript Docker PRs Welcome

⚠️ Development Status This project is under active development and not yet production-ready. APIs may change, and features may be incomplete. Contributions and feedback welcome!

Verified locally on 2026-03-13: go test ./..., go test -count=1 -race -tags=integration $(go list ./... | grep -v /testutil), cd frontend && bun run test, and cd frontend && bun run test:e2e:smoke pass. Production hardening, historical payroll migration, deeper accountant exception actions, and broader document retention/reconciliation workflows are still in progress.

CLI access is available via go run ./cmd/oa. It bootstraps a tenant-scoped API token once and then uses that token for subsequent reads and mutations.


🎮 Demo

The previous hosted Railway demo is currently offline.

For a resettable local demo instead:

docker-compose up -d db
export DATABASE_URL="postgres://openaccounting:openaccounting@localhost:5432/openaccounting?sslmode=disable"
go run ./cmd/migrate -db "$DATABASE_URL" -path migrations -direction up
DEMO_MODE=true DEMO_RESET_SECRET=test-demo-secret go run ./cmd/api
curl -X POST http://localhost:8080/api/demo/reset -H 'X-Demo-Secret: test-demo-secret'
Credential Value
Email demo1@example.com
Password demo12345

What is Open Accounting?

Open Accounting is a self-hosted, multi-tenant accounting platform focused today on Estonian SMB and accountant workflows. The current wedge is accounting, invoicing, payroll, bank import/reconciliation, and KMD/TSD export for self-hosted teams that want source access and tenant isolation.

It is not yet a full SmartAccounts/Merit replacement or a production-hardened embedded accounting platform. Built with modern technologies and focused on Estonian/EU compliance, it provides:

  • True Double-Entry Bookkeeping — Immutable journal entries with full audit trail
  • Multi-Company Support — One installation serves multiple businesses with complete data isolation
  • Role-Based Access — Owner, Admin, Accountant, and Viewer roles with granular permissions
  • Accountant Review Queue — Dashboard review surface for overdue invoices, unmatched bank transactions, close status, and recent journal activity, with a cross-tenant portfolio rollup for accountant users
  • Estonian Tax Compliance — KMD (VAT) declarations with e-MTA XML export
  • Modern Stack — Go backend, SvelteKit frontend, PostgreSQL database

✨ Features

Status note: features listed below exist in the repository. That does not mean each one is production-hardened, accountant-grade, or at full parity with proprietary incumbents.

Core Accounting

Feature Description
Chart of Accounts Hierarchical 5-type account structure (Asset, Liability, Equity, Revenue, Expense)
Journal Entries Draft → Posted → Void workflow with reversal entries
Multi-Currency Support for multiple currencies with exchange rate tracking
Trial Balance Real-time balance reports as of any date
Balance Sheet Assets, liabilities, and equity statement
Income Statement Revenue and expense summary (P&L)
Report Exports Export to Excel, CSV, or PDF formats
VAT Tracking Date-aware VAT rates for proper EU compliance

Business Operations

Feature Description
Invoicing Sales and purchase invoices with line items and VAT
Quotes Sales quotes with draft/sent/accepted workflow, conversion to orders
Orders Order management with quote linking and status tracking
Contacts Customer and supplier management
Payments Payment recording with invoice allocation
PDF Generation Professional invoice PDFs with customizable branding
Recurring Invoices Automated invoice generation on schedule

Fixed Assets

Feature Description
Asset Tracking Register and track fixed assets with serial numbers and locations
Asset Categories IT Equipment, Office Furniture, Vehicles, Software with depreciation settings
Depreciation Straight-line and declining balance methods with configurable useful life
Asset Lifecycle Draft → Active → Disposed/Sold/Scrapped status workflow
Depreciation Entries Automatic depreciation calculations with audit trail

Banking & Reconciliation

Feature Description
Bank Accounts Track multiple bank accounts per company
Transaction Import CSV import for bank statements
Auto-Matching Intelligent matching of transactions to payments
Reconciliation Full bank reconciliation workflow

Multi-Tenant & Security

Feature Description
Tenant Isolation Schema-per-tenant for complete data separation
User Management Invite users, assign roles, manage permissions
JWT and API token auth JWT access/refresh tokens plus tenant-scoped API tokens for automation
RBAC Role-based access control with permission checks
API Rate Limiting Token bucket rate limiting with configurable thresholds

Payroll (Estonian)

Feature Description
Employee Management Full employee lifecycle with personal codes
Estonian Tax Calculations Income tax, social tax, unemployment insurance
Funded Pension (II Pillar) Configurable pension contribution rates
Payroll Runs Monthly payroll with draft → approved → paid workflow
Payslips Detailed breakdown of earnings and deductions
TSD Declaration Annex 1 generation with XML/CSV export for e-MTA

Estonian Compliance

Feature Description
KMD Declaration VAT declaration generation with export for manual filing
TSD Declaration Payroll tax declaration with XML/CSV export
e-MTA Export XML export for manual upload to the Estonian Tax Board
Estonian Defaults Pre-configured for Estonian accounting standards

Plugin Marketplace

Feature Description
Plugin Registries Add custom plugin marketplaces (GitHub/GitLab)
Permission System Fine-grained permissions with risk levels
Event Hooks 27+ events for plugin integration
UI Slots Extend dashboard, invoices, and more
Two-Level Control Instance-wide install, per-tenant enable

📖 See Plugin Documentation for development guide


🛠 Technology Stack

Layer Technology
Backend Go 1.24+, Chi router, pgx/v5, sqlc (shared tables)
Frontend SvelteKit 2, Svelte 5, Vite 7, TypeScript
i18n Paraglide-JS (compile-time translations)
Database PostgreSQL 16+
Auth JWT access/refresh tokens plus tenant-scoped API tokens
API Docs Swagger/OpenAPI
Testing Go unit tests, backend integration tests, Vitest, Playwright demo suite
CI/CD GitHub Actions, Codecov
Container Docker, Docker Compose

🚀 Quick Start

Docker (Recommended)

# Clone and start
git clone https://github.com/HMB-research/open-accounting.git
cd open-accounting
docker-compose up -d

# Run migrations
docker-compose run --rm migrate

# Access the app
# API: http://localhost:8080
# Frontend: http://localhost:5173
# Swagger: http://localhost:8080/swagger/

Local Development

# Prerequisites: Go 1.24+, Node.js 22+, PostgreSQL 16+

# Start database
docker-compose up -d db

# Set environment
export DATABASE_URL="postgres://openaccounting:openaccounting@localhost:5432/openaccounting?sslmode=disable"

# Run migrations
go run ./cmd/migrate -db "$DATABASE_URL" -path migrations -direction up

# Start API (terminal 1)
go run ./cmd/api

# Start frontend (terminal 2)
cd frontend && bun install && bun run dev

CLI bootstrap

go run ./cmd/oa auth init \
  --base-url http://localhost:8080 \
  --email you@example.com \
  --password 'your-password'

go run ./cmd/oa accounts list
go run ./cmd/oa contacts import --file ./contacts.csv
go run ./cmd/oa employees import --file ./employees.csv
go run ./cmd/oa documents upload --entity-type bank_transaction --entity-id <transaction-id> --file ./evidence.pdf --document-type reconciliation_evidence
go run ./cmd/oa journal import-opening-balances --file ./opening-balances.csv --entry-date 2026-01-01

More examples are in docs/CLI.md.


📁 Project Structure

open-accounting/
├── cmd/
│   ├── api/              # HTTP API server (main application)
│   ├── migrate/          # Database migration CLI tool
│   └── oa/               # Operator CLI using tenant-scoped API tokens
│
├── internal/
│   ├── accounting/       # Core: accounts, journal entries, reports
│   ├── analytics/        # Dashboard metrics and reporting
│   ├── auth/             # JWT authentication, RBAC, rate limiting
│   ├── banking/          # Bank accounts, transactions, reconciliation
│   ├── contacts/         # Customer and supplier management
│   ├── email/            # Email notifications and templates
│   ├── invoicing/        # Sales and purchase invoices
│   ├── payments/         # Payment recording and allocation
│   ├── payroll/          # Estonian payroll with TSD declarations
│   ├── pdf/              # PDF generation for invoices
│   ├── plugin/           # Plugin marketplace system
│   ├── recurring/        # Recurring invoice automation
│   ├── tax/              # Estonian KMD/VAT compliance
│   └── tenant/           # Multi-tenant management, users, invitations
│
├── migrations/           # SQL database migrations
├── frontend/             # SvelteKit web application
├── docs/                 # Documentation (API, Architecture, Deployment)
└── deploy/               # Deployment configurations

📚 Documentation

Document Description
API Reference Complete REST API documentation with examples
Architecture System design, multi-tenancy, authentication flow
CLI Guide API-token bootstrap, token management, and import examples for the oa CLI
Deployment Production deployment guide
EMTA Integration Estonian Tax Board integration guide
Plugins Plugin development and marketplace guide
E2E Testing End-to-end testing architecture
Swagger UI Interactive API explorer (when server is running)

⚙️ Configuration

Variable Description Default
DATABASE_URL PostgreSQL connection string Required
PORT API server port 8080
JWT_SECRET JWT signing key Required in production
ALLOWED_ORIGINS CORS allowed origins localhost:5173,localhost:3000

🗺 Roadmap

Working in repo

  • Feature presence only; not a claim of production parity or operational maturity.

  • Double-entry bookkeeping with journal entries

  • Multi-tenant architecture with schema isolation

  • User authentication and RBAC

  • Invoicing with PDF generation

  • Payment recording and allocation

  • Bank transaction import and reconciliation

  • Estonian KMD/VAT compliance

  • User invitation system

  • Dashboard analytics with charts

  • Email notifications

  • Recurring invoice automation

  • Balance sheet and income statement reports

  • Payroll module with Estonian TSD declarations

  • API rate limiting

  • Plugin marketplace system

  • Internationalization (English/Estonian) with Paraglide-JS

  • Mobile-responsive frontend with touch-friendly UI

  • Report exports (Excel, CSV, PDF)

  • Quotes with quote-to-order conversion

  • Order management

  • Fixed assets with depreciation tracking

  • Tenant-scoped API token auth and Go CLI

  • CSV import for chart of accounts, contacts, employees, invoices, and opening balances

  • Tenant period lock on core write paths

  • Close/reopen workflow with audit trail in API and company settings

  • Fiscal-year close readiness and retained-earnings carry-forward workflow

  • Document attachments for invoices, journal entries, payments, bank transactions, and fixed assets

Still missing for reliable production use

  • Historical payroll and broader external migration imports
  • Full document approval workflow, retention admin controls, and broader evidence policy enforcement
  • Backup/restore verification and stronger auth/session controls
  • E-invoice, direct bank feeds, SEPA initiation, and automatic e-MTA submission

🤝 Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

# Development workflow
git checkout -b feature/your-feature
make test                    # Run tests
make lint                    # Check code style
git commit -m "feat: your feature"
git push origin feature/your-feature
# Open a Pull Request

Contributors


🏆 Supporters

A huge thank you to our supporters who help make this project possible!

Sponsors

Become the first sponsor! Support us on GitHub Sponsors or Ko-fi


📄 License

MIT License — see LICENSE for details.


💖 Support

If you find this project useful, consider supporting its development:

GitHub Sponsors Ko-fi

Releases

No releases published

Packages

 
 
 

Contributors