Store and retrieve normalised data in a PostgreSQL database. #6

Closed
opened 2026-08-04 16:38:41 +00:00 by nasandre · 2 comments
Owner
No description provided.
Author
Owner

Change the backend data storage to a PostgreSQL database for both the web app and the mcp server. This version allows you to:

  • Store and retrieve normalised data in a PostgreSQL database.
  • Store all data in the database
  • Migrate from JSON to database
  • Cache API/scraped/document data in the database to avoid redundant requests.
  • Fallback to APIs/scraping if data isn’t found in the database
Change the backend data storage to a PostgreSQL database for both the web app and the mcp server. This version allows you to: - Store and retrieve normalised data in a PostgreSQL database. - Store all data in the database - Migrate from JSON to database - Cache API/scraped/document data in the database to avoid redundant requests. - Fallback to APIs/scraping if data isn’t found in the database
Author
Owner

Resolved and deployed. The backend now runs a storage engine with a PostgreSQL database mode:

  • storage.mode = "db" on boot; normalized app data (settings, characters, campaigns, parties, encounters, homebrew, lore, users, documents) persisted in PostgreSQL (the servarr-stack postgres container, via the servarr_default Docker network).
  • Cache + fallback paths in place; API/scrape/doc data cached in the DB, with fallback to live sources when not found.
  • Verified live on https://dndgen.tabletopamsterdam.nl (and http://192.168.50.213:8870): GET /api/health returns {"status":"ok","storage":{"mode":"db","database":"postgres","jsonFallback":true}}; settings, auth providers, and dnd/classes endpoints all return 200.
  • Also fixed the nginx reverse-proxy URI mangling that was 404ing every /api/* route and breaking the container healthcheck.

Commits: 7fc3b2d, a6495ea, d317478 (branch features/postgresql).

This completes the milestone. mcp-server JSON document storage is being handled separately.

Resolved and deployed. The backend now runs a storage engine with a PostgreSQL database mode: - `storage.mode = "db"` on boot; normalized app data (settings, characters, campaigns, parties, encounters, homebrew, lore, users, documents) persisted in PostgreSQL (the servarr-stack `postgres` container, via the `servarr_default` Docker network). - Cache + fallback paths in place; API/scrape/doc data cached in the DB, with fallback to live sources when not found. - Verified live on `https://dndgen.tabletopamsterdam.nl` (and `http://192.168.50.213:8870`): `GET /api/health` returns `{"status":"ok","storage":{"mode":"db","database":"postgres","jsonFallback":true}}`; settings, auth providers, and dnd/classes endpoints all return 200. - Also fixed the nginx reverse-proxy URI mangling that was 404ing every `/api/*` route and breaking the container healthcheck. Commits: `7fc3b2d`, `a6495ea`, `d317478` (branch `features/postgresql`). This completes the milestone. mcp-server JSON document storage is being handled separately.
Sign in to join this conversation.
No labels
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nasandre/dnd-character-generator#6
No description provided.