1.3 KiB
1.3 KiB
DECISIONS.md — Architecture Decision Log
Record any choice that deviates from or fills a gap in the docs. Newest at the bottom.
Format:
## D-NNN: Title
- Date:
- Context: (what problem / ambiguity)
- Decision: (what you chose)
- Alternatives considered:
- Consequences:
D-001: SQLite + better-sqlite3 as the datastore
- Date: (project start)
- Context: Needs persistent accounts and game state with zero setup for a local build.
- Decision: SQLite file in
data/, synchronous driver, WAL mode. - Alternatives considered: Postgres (heavier setup), JSON files (no integrity/transactions).
- Consequences: Single-process deployment; synchronous transactions give simple double-spend protection. Migrate to Postgres only if scaling beyond one server.
D-002: Lazy time evaluation instead of tick loops
- Date: (project start)
- Context: Game must progress while players are offline.
- Decision: Store timestamps; compute energy/timers on demand.
- Consequences: No background workers, trivially testable with injected clocks.
D-003: Vanilla frontend, no build step
- Date: (project start)
- Context: Reduce tooling surface area for a local-model build.
- Decision: Static HTML/CSS/JS served by Express.
- Consequences: Slightly more DOM boilerplate; far fewer moving parts.