Configuration
Strata runs on the same machine in two distinct modes. This page documents the differences.
Dev vs Production at a Glance
Section titled “Dev vs Production at a Glance”| Development | Production | |
|---|---|---|
| Command | npm run docker:dev | npm run docker:prod |
| DB file | backend/.data/strata-dev.db | backend/.data/strata.db |
| NODE_ENV | development | production |
| Swagger UI | ✅ http://localhost:3000/swagger | ✅ http://localhost:3000/swagger |
| Seed data | Full demo dataset seeded on first start | Reference data (asset types + categories) seeded on first start |
| Version badge | Shows DEV badge | Shows clean version number |
| Docker restart policy | none | always |
| Reset DB | npm run docker:reset | ⚠️ Manual only — backup first! |
| Desktop app data dir | backend/.data/ | backend/.data/ |
How to Access Strata
Section titled “How to Access Strata”In development mode (npm run docker:dev), you can access the app in two ways:
| Access method | Where | When to use |
|---|---|---|
| Web browser | http://localhost:6543 | Day-to-day dev — fast reload, browser devtools, React hot update |
| Tauri Desktop App | ./scripts/tauri-dev.sh | Test 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.shto build the Tauri.appbundle — the full native experience with your real data inbackend/.data/strata.db - Or use
docker:prodif you want a headless server scenario (e.g., running on a NAS or cloud VM)
Environment Variables
Section titled “Environment Variables”| Variable | Description | Dev default | Prod default |
|---|---|---|---|
NODE_ENV | Runtime mode | development | production |
DATABASE_URL | Prisma connection string | file:../backend/.data/strata-dev.db | file:../backend/.data/strata.db |
DB_FILE | DB filename inside .data/ | strata-dev.db | strata.db |
PUBLIC_API_URL | Frontend build-time API base URL | http://localhost:3000/api/v1 | http://localhost:3000/api/v1 |
ENABLE_SWAGGER | Set to false to disable Swagger UI | (on by default) | (on by default) |
PUBLIC_API_URLis 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.
Two Database Files, Never Mixed
Section titled “Two Database Files, Never Mixed”The most important rule in Strata operations: dev and prod data never mix.
| File | Purpose |
|---|---|
backend/.data/strata-dev.db | Development & demo data. Safe to wipe at any time. |
backend/.data/strata.db | Your 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 Data
Section titled “Seed Data”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:
cd backendSTRATA_SEED_PROFILE=development npx prisma db seedResetting the Dev Environment
Section titled “Resetting the Dev Environment”npm run docker:resetThis 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.