Local setup, environment, and the everyday commands for working on Open Finance.
- Node 22 (see
.node-version) — usenvm useorfnm use. - npm (ships with Node 22). Install deps with
npm install(usespackage-lock.json). - Wrangler (
npx wrangler) — only needed when working on the Cloudflare Functions / D1 / R2 layer.
nvm use # or: fnm use (selects Node 22)
npm install| Variable | Where | Purpose |
|---|---|---|
LOGO_DEV_API_TOKEN |
.dev.vars (Functions) |
token for the /api/logo/:domain proxy. Copy .dev.vars.example → .dev.vars. |
VITE_CLOUDFLARE_ANALYTICS_TOKEN |
.env (frontend, optional) |
injects the Cloudflare Analytics beacon in src/main.jsx. Omit to disable. |
Never commit
.dev.varsor.env. Reference secrets by name only. See DEPLOYMENT.md for production secrets.
| Command | What it does |
|---|---|
npm run dev |
Vite dev server with HMR → http://localhost:5173 |
npm run build |
Production build → dist/ |
npm run preview |
Serve the built dist/ locally |
npm test |
Run the unit suite once (Vitest) |
npm run test:watch |
Vitest in watch mode |
npm run test:e2e |
Playwright end-to-end tests |
npm run dev serves only the frontend. To exercise functions/api/* (logo proxy, backup, R2, D1):
npm run build
npx wrangler pages dev distThis loads bindings from wrangler.jsonc and secrets from .dev.vars.
The web build is wrapped for iOS/Android via Capacitor (appId: com.chameleon.app).
npm run build
npm run cap:sync # copy web build into native projects
npm run cap:ios # open Xcode
npm run cap:android # open Android Studiosrc/
app/
main.jsx # bootstrap + optional analytics beacon
App.jsx # app shell, tab routing, auto-sync / auto-backup loops
styles/index.css # design tokens + global styles (see DESIGN_SYSTEM.md)
test/setup.js # Vitest/browser test setup
store/ # Zustand stores (subscription, finance, currency, settings/theme)
features/ # feature modules (finance, subscriptions, budget, trends,
# visualizations, reminders, presets, sync, settings)
shared/lib/ # pure domain logic (currencies, financeUtils, csvParser,
# bankStatementImport, sankey/treemap layout, serverStorage)
shared/hooks/ # shared hooks (useTheme)
shared/ui/ # reusable UI primitives (incl. OrangeAsterisk brand mark)
functions/api/ # Cloudflare Pages Functions (see API.md)
infra/d1/schema.sql # D1 schema (push subscriptions / notifications)
tests/e2e/ # Playwright tests
tools/scripts/ # utility scripts (VAPID keys, statement PDF conversion)
docs/design/ # source design exports and handoff assets
- Follow TDD and the coding standards in CONTRIBUTING.md.
- Style with design tokens, not raw hex — see DESIGN_SYSTEM.md.
- Treat money/sync/import code as critical-path: validate inputs and test edge cases.