Svenska översättning längst ner ↓
Cloud-based bookkeeping for Swedish businesses, built from the ground up to the Swedish Bookkeeping Act (Bokföringslagen 1999:1078).
A lightweight general ledger with double-entry accounting, the Swedish BAS chart of accounts, and SIE 4 import/export. Posted vouchers are immutable — protected by a SHA-256 hash chain and an append-only audit log. No floats: everything is counted in öre (1/100 of a krona).
| Phase | Scope | Status |
|---|---|---|
| 1 | Chart of accounts (BAS 2024), manual vouchers, balance & income statement, live debit/credit validation | done |
| 2 | Immutability via DB triggers, SHA-256 hash chain, attachments (dedup), audit log, correcting vouchers | done |
| 3 | SIE 4 import/export, PC8 (CP437) and UTF-8, round-trip tests | done |
| 4 | Invoices + PDF | planned |
| 5 | VAT (report + codes) | planned |
| 6 | OCR / receipt scanning | planned |
| — | Auth + multi-tenant, hosting template | planned |
| Layer | Tech |
|---|---|
| UI & server | SvelteKit 2 / Svelte 5 (runes), adapter-node |
| Database | PostgreSQL 16 + Drizzle ORM |
| Language | TypeScript on Node 22 |
| Tests | node --test via tsx |
npm install
npm run db:up # Postgres in Docker
npm run db:push # schema + triggers
npm run db:seed # BAS 2024 + demo company
npm run dev # http://localhost:5173/bokföring/
npm test # core package- Money in öre. All amounts are integers (
bigintin Postgres,bigintin code) — no float drift. - Debit = credit.
validateVoucher()refuses to save an unbalanced voucher. - Draft → posted. Posted vouchers are locked by Postgres triggers. To change them you create a correcting voucher that reverses the original, linked via
corrects_voucher_id. - Hash chain. Each posted voucher is hashed together with the previous one's hash (SHA-256, per series). The chain can be verified live at
/bokföring/integrity. - Audit log. Append-only via DB trigger; shown in the voucher's detail view.
apps/
web/ SvelteKit app (base path /bokföring)
landing/ Static marketing page (served at /booksky-ui/)
deploy/ systemd unit, Caddyfile, nginx snippet, install scripts
server.js prod server around the adapter-node handler
packages/
core/ öre-based money, voucher validation, hash chain, reports, SIE
db/ Drizzle schema, BAS 2024 seed, Postgres client
docker-compose.yml local Postgres on 127.0.0.1:5433
The app runs behind nginx via a systemd service listening on 127.0.0.1:3100.
See apps/web/deploy/:
booksky.service— systemd unit (PORT, ORIGIN, EnvironmentFile)setup-nginx.sh— idempotent script that adds a/bokföringproxy and a/booksky-ui/static alias to an existing nginx configCaddyfile— alternative if you'd rather run Caddy instead of nginx
Shortcut:
npm run build -w @booksky/web
sudo bash apps/web/deploy/setup-nginx.shNot yet decided.
Molnbaserad bokföring för svenska företag, byggd från grunden enligt Bokföringslagen (1999:1078).
Lättviktig huvudbok med dubbel bokföring, BAS-kontoplan och SIE-import/export. Verifikationer är oföränderliga efter bokföring — säkrade med SHA-256 hash-kedja och en append-only audit-logg. Inga flyttal: allt räknas i öre.
| Fas | Innehåll | Status |
|---|---|---|
| 1 | Kontoplan (BAS 2024), manuell verifikation, balans/resultat, realtidsvalidering | klart |
| 2 | Oföränderlighet via DB-triggers, SHA-256 hash-kedja, bilagor (dedup), audit-logg, rättelseverifikationer | klart |
| 3 | SIE 4 import/export, PC8 (CP437) + UTF-8, round-trip-tester | klart |
| 4 | Fakturor + PDF | planerad |
| 5 | Moms (rapport + koder) | planerad |
| 6 | OCR / kvittotolkning | planerad |
| — | Auth + multi-tenant, hosting-mall | planerad |
| Lager | Teknik |
|---|---|
| UI & server | SvelteKit 2 / Svelte 5 (runes), adapter-node |
| Databas | PostgreSQL 16 + Drizzle ORM |
| Språk | TypeScript på Node 22 |
| Test | node --test via tsx |
npm install
npm run db:up # Postgres i Docker
npm run db:push # schema + triggers
npm run db:seed # BAS 2024 + demo-bolag
npm run dev # http://localhost:5173/bokföring/
npm test # core-paketet- Belopp i öre. Alla pengar är heltal (
biginti Postgres,biginti koden) — inga flyttalsfel. - Debet = kredit.
validateVoucher()vägrar spara obalanserade verifikationer. - Utkast → bokfört. Bokförda verifikationer låses av postgres-triggers. Ändras de? Nej — du skapar en rättelseverifikation som motbokar, länkad via
corrects_voucher_id. - Hash-kedja. Varje bokförd verifikation hashas tillsammans med föregåendes (SHA-256, per serie). Kedjan kan verifieras live på
/bokföring/integrity. - Audit-logg. Append-only via DB-trigger; visas i verifikationens detaljvy.
apps/
web/ SvelteKit-appen (base path /bokföring)
landing/ Statisk hemsida (serveras på /booksky-ui/)
deploy/ systemd-unit, Caddyfile, nginx-block, install-skript
server.js prod-server runt adapter-node-handlern
packages/
core/ öre-pengar, voucher-validering, hash, rapporter, SIE
db/ Drizzle-schema, BAS 2024-seed, Postgres-klient
docker-compose.yml lokal Postgres på 127.0.0.1:5433
Appen körs bakom nginx via en systemd-tjänst som lyssnar på 127.0.0.1:3100.
Se apps/web/deploy/:
booksky.service— systemd-unit (PORT, ORIGIN, EnvironmentFile)setup-nginx.sh— idempotent script som lägger till/bokföring-proxy och/booksky-ui/-statisk-alias i en befintlig nginx-konfigCaddyfile— alternativ om man hellre kör Caddy istället för nginx
Snabbväg:
npm run build -w @booksky/web
sudo bash apps/web/deploy/setup-nginx.shEj fastställd ännu.