openreader/docs-site/docs/configure/database.md
Richard R 82f82a990e feat: add user preferences and document progress syncing
- Implemented user preferences management with a new API for GET and PUT requests.
- Added user document progress tracking with a new API for retrieving and updating progress.
- Introduced database schema changes for user preferences and document progress.
- Enhanced EPUB and TTS contexts to support syncing user preferences and document progress.
- Added functions to handle transferring user preferences and progress during account linking.
- Updated client-side logic to schedule syncing of user preferences and document progress.
2026-02-11 13:58:16 -07:00

1.2 KiB

title
Database

This page covers database mode selection for OpenReader WebUI.

Database mode

  • SQLite (default): embedded DB at docstore/sqlite3.db; good for local/self-host single-instance setups.
  • Postgres: enabled when POSTGRES_URL is set; recommended for production/distributed deployments.

What the database stores

  • Document and audiobook metadata/state used by server routes.
  • Auth/session tables when auth is enabled.
  • TTS character usage counters (user_tts_chars) for daily rate limiting (when enabled).
  • User settings preferences (user_preferences) when auth is enabled.
  • User reading progress (user_document_progress) when auth is enabled.
  • POSTGRES_URL

For database variable behavior, see Environment Variables.

State sync summary

  • With auth enabled, settings and reading progress are stored in SQL and synced from the app.
  • With auth disabled, settings and reading progress remain local in the browser.
  • Sync is currently request-based (not realtime push invalidation).