feat: add notifications and project shares features

- Backend: notifications + shares routes, DB tables, SqliteAdapter methods
- Frontend: NotificationPanel (bell icon + dropdown), ShareDialog, Dashboard integration
- Styles: notification + share dialog CSS
This commit is contained in:
2026-06-28 13:52:54 +02:00
parent a4371ca3ce
commit 20432f4b47
11 changed files with 655 additions and 7 deletions
+28
View File
@@ -105,3 +105,31 @@ CREATE INDEX IF NOT EXISTS idx_layers_drawing ON layers(drawing_id);
CREATE INDEX IF NOT EXISTS idx_elements_drawing ON elements(drawing_id);
CREATE INDEX IF NOT EXISTS idx_elements_layer ON elements(layer_id);
CREATE INDEX IF NOT EXISTS idx_blocks_drawing ON blocks(drawing_id);
-- ─── Notifications ───────────────────────────────────
CREATE TABLE IF NOT EXISTS notifications (
id TEXT PRIMARY KEY,
user_id TEXT NOT NULL,
type TEXT NOT NULL DEFAULT 'info',
title TEXT NOT NULL,
message TEXT NOT NULL,
read INTEGER NOT NULL DEFAULT 0,
created_at TEXT NOT NULL DEFAULT (datetime('now')),
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
-- ─── Project Shares ──────────────────────────────────
CREATE TABLE IF NOT EXISTS project_shares (
id TEXT PRIMARY KEY,
project_id TEXT NOT NULL,
shared_with_email TEXT NOT NULL,
shared_by TEXT NOT NULL,
permission TEXT NOT NULL DEFAULT 'view' CHECK(permission IN ('view','edit','admin')),
share_token TEXT UNIQUE,
created_at TEXT NOT NULL DEFAULT (datetime('now')),
FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE,
FOREIGN KEY (shared_by) REFERENCES users(id) ON DELETE CASCADE
);
CREATE INDEX IF NOT EXISTS idx_notifications_user ON notifications(user_id);
CREATE INDEX IF NOT EXISTS idx_shares_project ON project_shares(project_id);