Skip to content

feat: add self-hosted SQL backend as an opt-in storage mode#183

Open
AdamJ wants to merge 2 commits into
mainfrom
claude/local-database-config-eb1zpm
Open

feat: add self-hosted SQL backend as an opt-in storage mode#183
AdamJ wants to merge 2 commits into
mainfrom
claude/local-database-config-eb1zpm

Conversation

@AdamJ

@AdamJ AdamJ commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a small Express + Knex REST API (server/) so local deployments can use their own PostgreSQL or MySQL database instead of Supabase or localStorage.
  • Fully opt-in via VITE_DATA_BACKEND=sql — Supabase and localStorage behavior is unchanged when unset.
  • Browsers can't open a raw SQL connection, so this introduces one new deployable component (the server/ API); the frontend talks to it over fetch via src/services/sqlApiService.ts.
  • Includes idempotent schema (pnpm db:migrate) and seed (pnpm db:seed) scripts, single-tenant data model (no user_id/RLS, mirroring guest-mode semantics), and full doc coverage (docs/SQL_BACKEND.md, updated README.md/README-EXT.md/AGENTS.md/CHANGELOG.md).

Test plan

  • pnpm lint — clean
  • pnpm build — clean (also verified with VITE_DATA_BACKEND=sql set, confirming env vars inline correctly)
  • pnpm test — 187/187 passing
  • End-to-end smoke test against a real local Postgres instance: ran db:migrate + db:seed, started the server, and exercised every REST endpoint (current-day, archived-days, projects, clients, categories, todos, planned-tasks) including writes/upserts/deletes
  • Manual smoke test against a real MySQL instance (only Postgres was available to test in this environment)

https://claude.ai/code/session_01BKo7ta6PPHvHKb9L1Jt6UZ


Generated by Claude Code

claude added 2 commits June 17, 2026 19:23
Adds a small Express + Knex REST API (server/) so local deployments can
use their own PostgreSQL or MySQL database instead of Supabase or
localStorage. Opt in via VITE_DATA_BACKEND=sql; Supabase and localStorage
behavior is unchanged when unset. Includes idempotent schema/seed scripts
(pnpm run db:migrate / db:seed), a frontend DataService implementation
(sqlApiService.ts), and docs/SQL_BACKEND.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BKo7ta6PPHvHKb9L1Jt6UZ
@github-actions github-actions Bot added automation For items related to release/documentation/workflow automations documentation Improvements or additions to documentation labels Jun 17, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying timetrackerpro with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4f63643
Status: ✅  Deploy successful!
Preview URL: https://39c1e408.timetrackerpro.pages.dev
Branch Preview URL: https://claude-local-database-config.timetrackerpro.pages.dev

View logs

@AdamJ AdamJ added this to Timetraked Jun 17, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in Timetraked Jun 17, 2026
@AdamJ AdamJ added enhancement New feature or request and removed automation For items related to release/documentation/workflow automations labels Jun 17, 2026
@AdamJ AdamJ moved this from Backlog to In review in Timetraked Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

2 participants