947 B
947 B
Context
The platform needs a simple key-value configuration system for user preferences like theme, editor, and git identity.
Goals / Non-Goals
Goals:
- Store user config as JSONB in PostgreSQL
- Support partial updates (PATCH semantics)
- Apply theme in frontend on load
- Provide settings UI
Non-Goals:
- Complex nested config structures
- Config validation beyond type checking
- Per-project config (global only)
Decisions
-
JSONB column for flexibility
- Rationale: Simple key-value, no schema migrations for new keys
-
Merge semantics for updates
- Rationale: Frontend can update single key without sending entire config
-
Lazy creation
- Rationale: Config row created on first write, not on user creation
Risks
- [JSONB query performance] → Only querying by user_id, not by config keys
- [No schema validation] → Frontend validates known keys, backend accepts any JSON