Something went wrong. Try again.
A self-hosted household ledger.
Something went wrong. Try again.
README.md
Server core conventions (design D6: transport-agnostic core) #
A future native frontend (Deno desktop, mobile) must be able to target a standalone Quantum backend. To keep that cheap, the server core follows these rules:
- Domain logic lives in
services/. Every domain operation (ledger queries, categorization, rules, reports, sync, account classification) is a plain function insrc/lib/server/services/taking typed inputs and returning plain data. NoRequest/Response, no cookies, no SvelteKit imports. - Routes are thin adapters.
+page.server.tsloads and form actions only parse input, call a service, and shape the response. No SQL and no domain logic in routes. When native clients arrive,/api/*JSON routes become a second adapter over the same services. - No SQL outside
services/anddb.ts. - Relative imports within
src/lib/server/(not$lib/...) so modules and their tests run under plaindeno testwithout Vite alias resolution. - Sessions are opaque tokens. Delivered via HTTP-only cookie today; the token format must never assume cookie transport (bearer support later).
- Money is integer cents. Conversion from SimpleFIN's numeric strings happens exactly once, at normalization. Floats never touch amounts.