feat: add self-hosted SQL backend as an opt-in storage mode#183
Open
AdamJ wants to merge 2 commits into
Open
Conversation
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
Deploying timetrackerpro with
|
| Latest commit: |
4f63643
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://39c1e408.timetrackerpro.pages.dev |
| Branch Preview URL: | https://claude-local-database-config.timetrackerpro.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
server/) so local deployments can use their own PostgreSQL or MySQL database instead of Supabase orlocalStorage.VITE_DATA_BACKEND=sql— Supabase andlocalStoragebehavior is unchanged when unset.server/API); the frontend talks to it overfetchviasrc/services/sqlApiService.ts.pnpm db:migrate) and seed (pnpm db:seed) scripts, single-tenant data model (nouser_id/RLS, mirroring guest-mode semantics), and full doc coverage (docs/SQL_BACKEND.md, updatedREADME.md/README-EXT.md/AGENTS.md/CHANGELOG.md).Test plan
pnpm lint— cleanpnpm build— clean (also verified withVITE_DATA_BACKEND=sqlset, confirming env vars inline correctly)pnpm test— 187/187 passingdb:migrate+db:seed, started the server, and exercised every REST endpoint (current-day, archived-days, projects, clients, categories, todos, planned-tasks) including writes/upserts/deleteshttps://claude.ai/code/session_01BKo7ta6PPHvHKb9L1Jt6UZ
Generated by Claude Code