Add git version control panel and LAN hosting support

- Git modal (⎇ Git button): commit all diagrams as JSON to diagrams/ folder,
  push to remote, view history, restore any diagram from any past commit
- Diagrams exported to diagrams/{id}_{name}.json on each commit so diffs are
  human-readable and individual diagrams can be restored independently
- backend/run.py: changed host to 0.0.0.0 for LAN access

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-24 19:48:29 -04:00
parent e4a80dc0e6
commit 01e7b5630b
7 changed files with 450 additions and 2 deletions
+8
View File
@@ -60,4 +60,12 @@ const api = {
jsonUrl: (id) => `${API_BASE}/export/${id}/json`,
formboardUrl: (id) => `${API_BASE}/export/${id}/formboard`,
},
git: {
status: () => apiFetch("/git/status"),
log: () => apiFetch("/git/log"),
commit: (message) => apiFetch("/git/commit", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ message }) }),
push: () => apiFetch("/git/push", { method: "POST" }),
history: (hash) => apiFetch(`/git/history/${hash}`),
restore: (commit_hash, filepath, name) => apiFetch("/git/restore", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ commit_hash, filepath, name }) }),
},
};