Architecture¶
BillTracker is a single Node.js service. Express serves a built React SPA and a JSON API from the same origin.
Browser
|
+-- React 19 SPA (Vite, Tailwind, shadcn/ui-style primitives, TanStack Query, framer-motion)
|
+-- Express API
|
+-- route handlers
+-- business services
+-- background workers
+-- SQLite through better-sqlite3
Project Layout¶
| Path | Responsibility |
|---|---|
client/ |
React pages, components, hooks, API wrappers, and styles |
routes/ |
Express request handlers |
services/ |
Business logic, auth, sync, backups, cleanup, and status |
middleware/ |
Auth, CSRF, rate limiting, response headers, and errors |
workers/ |
Daily background worker |
db/ |
SQLite schema and migration logic |
scripts/ |
Migrations, smoke checks, setup, and deployment helpers |
legacy/ |
Static legacy interface served at /legacy |
mkdocs/ |
This documentation site |
Startup¶
- Docker optionally runs
node scripts/migrate-db.js. server.jsopens the SQLite database and applies schema migrations.- The server creates the first admin if bootstrap variables are present.
- Expired sessions are cleaned up.
- Express begins listening.
- The SimpleFIN sync worker and daily worker start.
The daily worker runs once during startup and then at 6:00 AM server-local time. It updates autopay state, sends configured reminders, prunes sessions, and runs maintenance cleanup.
Continue Reading¶
- Data Flows explains request, tracker, SimpleFIN, import, export, and backup lifecycles.
- API Reference is the route inventory; API Reference (v0.37) covers the new endpoints shipped in v0.35-v0.37 with examples.
- Database Reference lists every persistent table and the migration families that created them.
- Operations Runbook provides deploy and incident procedures.
- Testing and Verification documents the current safety net.
- Engineering Log records the current baseline and major technical decisions.