Skip to content
Strata v1.6.3

Configuration

Strata runs on the same machine in two distinct modes. This page documents the differences.

DevelopmentProduction
Commandnpm run docker:devnpm run docker:prod
DB filebackend/.data/strata-dev.dbbackend/.data/strata.db
NODE_ENVdevelopmentproduction
Swagger UI✅ http://localhost:3000/swagger✅ http://localhost:3000/swagger
Seed dataFull demo dataset seeded on first startReference data (asset types + categories) seeded on first start
Version badgeShows DEV badgeShows clean version number
Docker restart policynonealways
Reset DBnpm run docker:reset⚠️ Manual only — backup first!
Desktop app data dirbackend/.data/backend/.data/

In development mode (npm run docker:dev), you can access the app in two ways:

Access methodWhereWhen to use
Web browserhttp://localhost:6543Day-to-day dev — fast reload, browser devtools, React hot update
Tauri Desktop App./scripts/tauri-dev.shTest native macOS window/menu bar while sharing dev DB

Web browser mode uses backend on http://localhost:3000/api/v1 (Docker). tauri:dev runs a desktop-auth-protected backend sidecar on http://localhost:3456/api/v1 and uses bundled frontend assets (no localhost frontend URL). Web mode still uses Docker backend on http://localhost:3000/api/v1.

In production mode (npm run docker:prod):

  • Use ./scripts/tauri-build.sh to build the Tauri .app bundle — the full native experience with your real data in backend/.data/strata.db
  • Or use docker:prod if you want a headless server scenario (e.g., running on a NAS or cloud VM)
VariableDescriptionDev defaultProd default
NODE_ENVRuntime modedevelopmentproduction
DATABASE_URLPrisma connection stringfile:../backend/.data/strata-dev.dbfile:../backend/.data/strata.db
DB_FILEDB filename inside .data/strata-dev.dbstrata.db
PUBLIC_API_URLFrontend build-time API base URLhttp://localhost:3000/api/v1http://localhost:3000/api/v1
ENABLE_SWAGGERSet to false to disable Swagger UI(on by default)(on by default)

PUBLIC_API_URL is a build-time variable — it is baked into the Astro frontend at build time. Rebuilding the frontend image is required if the API URL changes.

The most important rule in Strata operations: dev and prod data never mix.

FilePurpose
backend/.data/strata-dev.dbDevelopment & demo data. Safe to wipe at any time.
backend/.data/strata.dbYour real personal financial data. Never auto-wiped.

Both files are git-ignored. The .data/ directory must exist before running Docker (it is created automatically if missing).

See ADR-003: Database Strategy for the full rationale.

Seed content now depends on the database profile:

  • Development (strata-dev.db) creates:
    • 13 asset types
    • hierarchical categories
    • tags
    • 8 demo assets (banking, real estate, loan, vehicles, stocks, crypto)
    • seeded portfolio/snapshot history for immediate chart usage (10 years, 3 snapshots/year, deterministic values)
    • loan demo asset snapshot history is strictly declining (outstanding balance payoff)
  • Production (strata.db) creates:
    • 13 asset types
    • hierarchical categories
    • no demo assets, no seeded snapshots

All seed paths are idempotent — running twice does not duplicate records.

For existing dev databases:

  • Cleanup known e2e/test leftovers manually with npm run devdb:clean-e2e (repo root).
  • Backfill the current demo snapshot model with:
Terminal window
cd backend
STRATA_SEED_PROFILE=development npx prisma db seed
Terminal window
npm run docker:reset

This deletes strata-dev.db, rebuilds Docker images with --no-cache, applies migrations, and re-seeds. Use this after migrations or when the dev DB state is unknown.

Your production data in strata.db is never touched by docker:reset.