Add DB-backed site configuration #62

Merged
erik merged 1 commit from feat/task-6278792d-db-backed-site-config into main 2026-05-22 17:17:55 -05:00
Owner

Summary

Add a small SQLite-backed site configuration slice that lets persisted public site identity and homepage copy override src/config/site.ts while preserving file/default fallback behavior.

Task

Task: #task-6278792d

Changes

  • Add site_config migration for singleton persisted site identity/homepage fields.
  • Add readSiteConfig service with DB-first, file-default fallback behavior.
  • Wire the homepage and API metadata to persisted config when the app is started with a migrated database.
  • Add isolated database tests for migration, fallback behavior, and persisted homepage rendering.
  • Document the manual persisted-config verification path.

Testing

  • Unit tests added/updated
  • Manual testing performed: dev server checked running via make dev; route is manually testable by inserting site_config row and refreshing / or /api/v1/meta.
  • make check passes
  • ./scripts/pre-pr.sh passes

Checklist

  • ./scripts/pre-pr.sh passes
  • Documentation updated (if needed)
  • No unrelated changes included
## Summary Add a small SQLite-backed site configuration slice that lets persisted public site identity and homepage copy override `src/config/site.ts` while preserving file/default fallback behavior. ## Task Task: #task-6278792d ## Changes - Add `site_config` migration for singleton persisted site identity/homepage fields. - Add `readSiteConfig` service with DB-first, file-default fallback behavior. - Wire the homepage and API metadata to persisted config when the app is started with a migrated database. - Add isolated database tests for migration, fallback behavior, and persisted homepage rendering. - Document the manual persisted-config verification path. ## Testing - [x] Unit tests added/updated - [x] Manual testing performed: dev server checked running via `make dev`; route is manually testable by inserting `site_config` row and refreshing `/` or `/api/v1/meta`. - [x] `make check` passes - [x] `./scripts/pre-pr.sh` passes ## Checklist - [x] `./scripts/pre-pr.sh` passes - [x] Documentation updated (if needed) - [x] No unrelated changes included
feat: add db-backed site config
All checks were successful
CI / build-lint-test (pull_request) Successful in 26s
1223eebe70
Task: #task-6278792d
Author
Owner

PR Review: Approved

Summary

Reviewed PR #62 at commit 1223eeb. The PR adds a small site_config migration, a DB-first/file-fallback site config reader, homepage and API metadata wiring for migrated runtime databases, isolated tests, and documentation for manually verifying persisted config reads.

Acceptance Criteria

  • Migration creates the persisted site configuration table from scratch: met — 003_site_config.sql creates site_config, and migration tests assert the table exists after applying template migrations from an empty database.
  • Tests use isolated databases: met — new config and app tests use in-memory SQLite databases with migrations applied per test and closed in afterEach.
  • Persisted config can be read through a manually testable path: met — homepage rendering uses persisted site identity/homepage fields when a site_config row exists; README documents checking / or /api/v1/meta.
  • File/default config still works when no DB config exists: met — readSiteConfig returns src/config/site.ts defaults without a DB or without a persisted row, with tests covering both paths.
  • Relevant lint/test checks pass: met — make check, ./scripts/pre-pr.sh, and Forgejo CI passed.

Blocking Issues

None.

Warnings

None.

Verdict

Approved for merge after explicit human approval.

## PR Review: Approved ### Summary Reviewed PR #62 at commit `1223eeb`. The PR adds a small `site_config` migration, a DB-first/file-fallback site config reader, homepage and API metadata wiring for migrated runtime databases, isolated tests, and documentation for manually verifying persisted config reads. ### Acceptance Criteria - [x] Migration creates the persisted site configuration table from scratch: met — `003_site_config.sql` creates `site_config`, and migration tests assert the table exists after applying template migrations from an empty database. - [x] Tests use isolated databases: met — new config and app tests use in-memory SQLite databases with migrations applied per test and closed in `afterEach`. - [x] Persisted config can be read through a manually testable path: met — homepage rendering uses persisted site identity/homepage fields when a `site_config` row exists; README documents checking `/` or `/api/v1/meta`. - [x] File/default config still works when no DB config exists: met — `readSiteConfig` returns `src/config/site.ts` defaults without a DB or without a persisted row, with tests covering both paths. - [x] Relevant lint/test checks pass: met — `make check`, `./scripts/pre-pr.sh`, and Forgejo CI passed. ### Blocking Issues None. ### Warnings None. ### Verdict Approved for merge after explicit human approval.
erik merged commit a6d9418e66 into main 2026-05-22 17:17:55 -05:00
erik deleted branch feat/task-6278792d-db-backed-site-config 2026-05-22 17:17:55 -05:00
Sign in to join this conversation.
No description provided.