Files
README.md

bn-bank-sparekonto-calc #

A single-page app to calculate interest and find a better distribution of savings across BN Bank ("BN Bank Sparekonto") savings accounts.

What this is #

  • Purpose: help figure out how to split savings across BN Bank's interest-tiered savings accounts to maximize interest earned.
  • No backend: purely client-side. All state lives in the browser (component state / localStorage if added later) — nothing is persisted or sent to a server.
  • Single page: no routing, no multi-view navigation planned.

Stack #

  • Preact (not React) + TypeScript, via @preact/preset-vite.
    • Bootstrapped with pnpm create vite@latest bn-bank-sparekonto-calc -- --template react, but the actual scaffold produced is Preact-based (see package.json deps: preact, @preact/preset-vite). Import from preact/preact/hooks, not react.
  • Vite as the build tool/dev server.
  • Package manager: pnpm.

Structure #

  • src/main.tsx — entry point, renders <App /> into #app.
  • src/app.tsx — main (currently only) app component.
  • src/app.css, src/index.css — styles.
  • public/ — static assets (favicon, icons).

Commands #

pnpm dev       # start dev server
pnpm build     # tsc -b && vite build
pnpm preview   # preview production build

Domain notes #

BN Bank Sparekonto accounts typically have tiered interest rates that depend on the balance held in each account (e.g. a higher rate up to some threshold, lower above it). The calculator's job is to take a total savings amount and work out the split across accounts/tiers that yields the best blended interest. Fill in actual current rates/tiers here as they're implemented, since they change over time and aren't derivable from code.