MCPcopy Index your code
hub / github.com/erp-mafia/accounted

github.com/erp-mafia/accounted @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
7,266 symbols 25,894 edges 2,182 files 543 documented · 7% updated 2d ago★ 18178 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Accounted

Open-source Swedish accounting software for sole traders (enskild firma) and limited companies (aktiebolag).

License: AGPL-3.0-or-later

What is Accounted?

Accounted implements double-entry bookkeeping compliant with Swedish accounting law (Bokforingslagen). It supports the BAS 2026 chart of accounts, handles VAT declarations (momsdeklaration), SIE import/export, and enforces 7-year document retention. Built for sole traders and limited companies operating in Sweden.

Features

  • Double-entry bookkeeping -- BAS 2026 chart of accounts, draft/commit workflow, sequential voucher numbering
  • Invoicing -- Create, send, and track invoices with mixed VAT rates and PDF generation
  • Bank reconciliation -- PSD2 bank connection via Enable Banking, 4-pass automatic matching
  • VAT declaration -- SKV 4700 form mapping, per-rate breakdown, EU/export handling
  • Tax reports -- NE-bilaga, INK2, SRU export for Skatteverket
  • Supplier invoices -- Registration, payment tracking, input VAT deduction
  • Document archive -- SHA-256 integrity, 7-year retention enforcement, full archive ZIP export
  • SIE import/export -- Standard Swedish accounting interchange format
  • Extension system -- Opt-in plugins for AI categorization, receipt OCR, email, calendar, and more

Self-Hosting

git clone https://github.com/erp-mafia/gnubok.git
cd Accounted
./setup.sh              # Prompts for Supabase credentials, generates .env
docker compose up -d

You need a Supabase project and must apply the database migrations before first use. See SELF-HOSTING.md for the full step-by-step guide, including Supabase setup, auth configuration, optional features (AI, email, push notifications), and troubleshooting.

Development Setup

Prerequisites: Node.js 20+, a Supabase project.

npm install
npm run dev       # Start dev server (auto-generates extension registry)
npm test          # Run tests
npm run build     # Production build
npm run lint      # ESLint

Tech Stack

  • Framework: Next.js 16 (App Router), React 19, TypeScript (strict)
  • Database: Supabase (PostgreSQL + Row Level Security + email/password auth + TOTP MFA)
  • Styling: Tailwind CSS 4 + shadcn/ui
  • Integrations: Enable Banking (PSD2), Anthropic SDK, LangChain, OpenAI, Resend, JSZip

Documentation

  • SELF-HOSTING.md -- Full self-hosting guide (Docker, Supabase setup, migrations, optional features)
  • CLAUDE.md -- Architecture, bookkeeping engine, database conventions, extension system
  • CONTRIBUTING.md -- Development workflow, code style, pull request process
  • SECURITY.md -- Vulnerability reporting policy

Contributing

Contributions are welcome. See CONTRIBUTING.md for the full guide.

All commits require a DCO sign-off (git commit -s).

License

AGPL-3.0-or-later with an extension exception: third-party extensions that interact solely through the documented Extension API may be licensed under any terms, including proprietary. See LICENSE for details and NOTICE for third-party attributions.

Extension points exported contracts — how you extend this code

EmailService (Interface)
(no doc) [4 implementers]
lib/email/service.ts
KontrollFinding (Interface)
* Per-rule validation finding from Skatteverket's kontrollresultat. Maps to * either a kontrollfel item (per-period) or
components/salary/AGIPanel.tsx
AllocationCandidate (Interface)
* Direction-aware allocation candidate. The dialog normalizes customer and * supplier invoices to the same shape so the
components/transactions/MatchAllocationDialog.tsx
TaggingLine (Interface)
Line DTO inside a voucher from GET /api/dimensions/tagging/lines.
components/dimensions/BulkTagWorkbench.tsx
BlockingPeriod (Interface)
A prior period that must be locked before a new fiscal year can be created.
components/bookkeeping/CreatePeriodDialog.tsx
ExpiringBankConnection (Interface)
* AttGoraSection: the dashboard's unified worklist ("Att göra"). * * One flat ledger of everything actionable, grouped
components/dashboard/AttGoraSection.tsx
DaySegment (Interface)
* Resolve a shift's occupied minutes into segments keyed by ISO weekday. * Returns one segment per occupied weekday. Wr
lib/salary/shift-premium-engine.ts
TxLike (Interface)
* Centralised predicate for "is this bank transaction anchored to a * verifikat?": single source of truth that readers
lib/transactions/is-booked.ts

Core symbols most depended-on inside this repo

enqueue
called by 1796
tests/helpers.ts
get
called by 1108
lib/extensions/types.ts
createMockRequest
called by 754
tests/helpers.ts
error
called by 733
lib/logger.ts
getPool
called by 727
tests/pg/setup.ts
createQueuedMockSupabase
called by 720
tests/helpers.ts
toast
called by 698
components/ui/use-toast.tsx
set
called by 526
lib/extensions/types.ts

Shape

Function 5,401
Interface 1,555
Method 172
Class 138

Languages

TypeScript100%

Modules by API surface

types/index.ts147 symbols
lib/bookkeeping/errors.ts56 symbols
lib/pending-operations/commit.ts54 symbols
app/(dashboard)/transactions/page.tsx49 symbols
extensions/general/mcp-server/server.ts46 symbols
components/supplier-invoices/NewSupplierInvoiceForm.tsx45 symbols
extensions/general/enable-banking/lib/api-client.ts40 symbols
components/reports/views/index.tsx36 symbols
lib/providers/dto.ts34 symbols
lib/extensions/types.ts33 symbols
scripts/seed-demo-account.ts32 symbols
tests/helpers.ts31 symbols

Datastores touched

postgresDatabase · 1 repos

For agents

$ claude mcp add accounted \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page