Swedish accounting and bookkeeping application for small businesses. Supports double-entry bookkeeping, the BAS kontoplan, SIE export/import, K2 compliance, asset management, and annual report filing.
Backend: Rust, Axum, SQLite (SQLx), JWT authentication Frontend: React 19, TypeScript, TanStack Router & Query, Tailwind CSS, shadcn/ui
- Copy the environment file and set a JWT secret:
cp .env.example .env
# Edit .env and set a strong JWT_SECRET- Start the backend:
cargo run -p balans-serverThe server runs on http://localhost:3100 by default. The SQLite database is created automatically at data/balans.db.
- Start the frontend:
cd frontend
pnpm install
pnpm devThe frontend runs on http://localhost:5173 and proxies API requests to the backend.
crates/server/ Rust API server
migrations/ SQL migrations (applied automatically)
src/
access.rs Company access control helpers
config.rs AppState, AppMode (SaaS/Fixed), AppConfig
auth/ JWT authentication & middleware
db/ Database pool, migrations, seeding
routes/ API endpoint handlers
admin.rs User management & approval endpoints
models/ Data models
assets/ Fixed asset management
filing/ Annual report generation
k2/ K2 compliance checks
report/ Financial reporting (balance sheet, income statement)
sie/ SIE format import/export
tax/ Tax calculations
frontend/ React SPA
src/
api/ API client, queries, types
auth/ Auth context & helpers
routes/ Page components (including admin panel)
components/ui/ shadcn/ui components
- First user registered is automatically approved as admin
- Subsequent users register with pending status and require admin approval
- Admin panel at
/adminfor managing users, roles, and company access - System roles: admin, user, viewer
- Company roles: owner, admin, member, viewer
- SaaS mode (default): Users create companies and are auto-added as owner
- Fixed mode (
APP_MODE=fixed): Users are assigned to a pre-configured company (FIXED_COMPANY_ID)
| Variable | Description | Default |
|---|---|---|
JWT_SECRET |
Secret key for signing JWT tokens | required |
DATABASE_URL |
SQLite connection string | sqlite://data/balans.db |
APP_MODE |
saas or fixed |
saas |
FIXED_COMPANY_ID |
Company ID for fixed mode | — |
PORT |
Server port | 3100 |
STATIC_DIR |
Path to built frontend assets | frontend/dist |