Skip to content

Add SQLite persistence with Python server#2

Merged
snktshrma merged 7 commits into
mainfrom
cursor/sqlite-persistence-b805
Jun 16, 2026
Merged

Add SQLite persistence with Python server#2
snktshrma merged 7 commits into
mainfrom
cursor/sqlite-persistence-b805

Conversation

@snktshrma

@snktshrma snktshrma commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

Adds server-side persistence so task board data survives page refreshes and is shared across all users hitting the same server. Rebased onto latest main (ES module refactor).

  • Python + Flask server on port 8090 (matches existing hosting)
  • SQLite database at data/taskboard.db
  • REST API: GET/PUT /api/board for full board load/save
  • Frontend (src/lib/persistence.js + src/data/board-store.js) loads board on startup, debounced auto-save after edits

Architecture

Browser  →  server.py (port 8090)  →  data/taskboard.db
              ├── index.html + src/ (ES modules)
              └── /api/board

Manual deploy steps (on your server)

  1. Pull this branch
  2. pip install -r requirements.txt
  3. Run python server.py --host 0.0.0.0 --port 8090 (replace your current Python module)
  4. Ensure data/ directory is writable
  5. Set up a process manager (systemd) so it survives reboots
  6. Back up data/taskboard.db regularly

Notes

  • GitHub Pages preview still works for UI but persistence requires the Python server
  • Photos stored as base64 in DB (fine for small team)
  • No auth yet - add at reverse proxy if needed
  • Delete data/taskboard.db to reset to seed data
Open in Web Open in Cursor 

- Flask server serves index.html and /api/board endpoints
- SQLite stores full board state (people, tasks, config)
- Frontend loads on startup and auto-saves after edits
- Seed data populated on first run

Co-authored-by: Sanket Sharma <sharma.sanket272@gmail.com>
@cursor cursor Bot force-pushed the cursor/sqlite-persistence-b805 branch from 5fa6f84 to 864a5c7 Compare June 16, 2026 09:27
Fix .gitignore so /data/ only ignores the SQLite directory at repo root,
not src/data/. The missing modules caused module resolution failures in CI.

Co-authored-by: Sanket Sharma <sharma.sanket272@gmail.com>
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-16 12:53 UTC

cursoragent and others added 5 commits June 16, 2026 09:48
The persistence change left DATA empty when /api/board was unavailable
(GitHub Pages, static serve). Re-add the original sample projects as a
local fallback and only enable auto-save when the server responds.

Co-authored-by: Sanket Sharma <sharma.sanket272@gmail.com>
The persistence refactor replaced inline sample data with an async load
that could render an empty board and blocked startup with top-level await.

- Restore constants.js and main.js data/init from main
- Add board-sync.js for background load/save only
- Keep sync renderAll() + window globals like main
- Reseed SQLite when stored board is empty

Co-authored-by: Sanket Sharma <sharma.sanket272@gmail.com>
Co-authored-by: Sanket Sharma <sharma.sanket272@gmail.com>
Co-authored-by: Sanket Sharma <sharma.sanket272@gmail.com>
seed_data.make() was calling make(**child) on already-built nodes, which
corrupted the task tree (no due dates, no subtasks, zero gantt bars).

Also validate server board quality before replacing inline sample data.

Co-authored-by: Sanket Sharma <sharma.sanket272@gmail.com>
@snktshrma snktshrma marked this pull request as ready for review June 16, 2026 12:52
@snktshrma snktshrma merged commit 35e5a57 into main Jun 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants