steps 4-6 + doc overhaul: files, notes, GUI, plugins docs
DOCUMENTATION (shift from personal to universal product): - README.md: rewritten with 'one product, different doors' framing, universal entities table, audience segments - 01_Product_Spec.md: removed personal references (sshkeeper, Godot, DokuWiki, servers), added audience segments (freelancer, repairmaster, developer, maker, consultant), universal scenarios - 02_Architecture.md: added 'Plugins (Extensibility)' section with calendar/kanban/importer/template examples - 03_Data_Model_Storage.md: added section 6 on plugin extensibility (node_meta, type registry, SQL migrations per plugin) - 09_Extensibility.md (NEW): full plugin architecture — Lua runtime, plugin.json, hooks, sandbox, templates, registry - PLAN.md: added step 16 (plugins), updated status table - 00_README.md: rewritten product index with plugin principle CODE — STEP 4 (Files): - migration 002: files table (id, node_id, filename, path, storage_mode, size, sha256, mime, ...) - FileService: AddExternal, CopyIntoVault, Get, ListByNode, MarkMissing, DeleteToTrash, Open (xdg-open) - file_test.go: 5 tests (external, copy-vault, list-node, delete-trash, MIME guess) CODE — STEP 5 (Notes): - migration 003: notes table (node_id PK, file_id, format, original_format, encrypted) - NoteService: Create (node+file+link), Read, Save (with backup to .verstak/history/), Delete, Load - note_test.go: 3 tests (create-read, save-backup, delete) CODE — STEP 6 (GUI): - cmd/verstak-gui/main.go: launches GUI server, opens browser - internal/gui/server.go: HTTP API for nodes/notes/files/search - internal/gui/index.html.go: full inline SPA frontend (dark theme, sidebar tree, cards grid, note editor, search, create modals) - Navigation: sidebar tree → click node → detail view with children + files cards → tab switch (overview/notes/files) → create node/note via modal → edit note in fullscreen textarea → save (with history backup) Acceptance: go build ./... pass, go build -tags gui ./cmd/verstak-gui pass, go test ./... pass (20+ tests). GUI serves on random port, opens browser. API returns JSON for all resource types.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package storage
|
||||
|
||||
// migration002 — files table for vault file tracking.
|
||||
const migration002 = `
|
||||
CREATE TABLE IF NOT EXISTS files (
|
||||
id TEXT PRIMARY KEY,
|
||||
node_id TEXT NOT NULL REFERENCES nodes(id),
|
||||
filename TEXT NOT NULL,
|
||||
path TEXT NOT NULL,
|
||||
storage_mode TEXT NOT NULL DEFAULT 'vault',
|
||||
size INTEGER NOT NULL DEFAULT 0,
|
||||
sha256 TEXT NULL,
|
||||
mime TEXT NULL,
|
||||
created_at TEXT NOT NULL,
|
||||
updated_at TEXT NOT NULL,
|
||||
last_seen_at TEXT NULL,
|
||||
missing INTEGER NOT NULL DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_files_node ON files(node_id);
|
||||
`
|
||||
@@ -0,0 +1,12 @@
|
||||
package storage
|
||||
|
||||
// migration003 — notes table.
|
||||
const migration003 = `
|
||||
CREATE TABLE IF NOT EXISTS notes (
|
||||
node_id TEXT PRIMARY KEY REFERENCES nodes(id),
|
||||
file_id TEXT NOT NULL REFERENCES files(id),
|
||||
format TEXT NOT NULL DEFAULT 'markdown',
|
||||
original_format TEXT NULL,
|
||||
encrypted INTEGER NOT NULL DEFAULT 0
|
||||
);
|
||||
`
|
||||
@@ -58,7 +58,9 @@ CREATE TABLE IF NOT EXISTS _schema_ver (
|
||||
|
||||
var migrationFiles = map[int]string{
|
||||
1: migration001,
|
||||
// 2: migration002, etc.
|
||||
2: migration002,
|
||||
3: migration003,
|
||||
// 4: migration004, etc.
|
||||
}
|
||||
|
||||
func (db *DB) runInitialSchema() error {
|
||||
|
||||
Reference in New Issue
Block a user