From 01e517748d0ede4f7caae562b4217f8d625e66b5 Mon Sep 17 00:00:00 2001 From: Prashant Parmar Date: Tue, 19 May 2026 20:45:15 +0530 Subject: [PATCH] feat: implement comprehensive subject management system with validation and sub-details --- database.js | 11 ++++ index.html | 28 +++++++++- js/app.js | 146 ++++++++++++++++++++++++++++++++++++++++++++++++++-- js/store.js | 97 +++++++++++++++++++++++++++++++++- server.js | 101 +++++++++++++++++++++++++++++++++--- 5 files changed, 367 insertions(+), 16 deletions(-) diff --git a/database.js b/database.js index 79a5c67..c7b0cbe 100644 --- a/database.js +++ b/database.js @@ -14,6 +14,17 @@ function initDb() { created_at DATETIME DEFAULT CURRENT_TIMESTAMP )`); + // Subject Details Table (Topics, Resources) + db.run(`CREATE TABLE IF NOT EXISTS subject_details ( + id TEXT PRIMARY KEY, + subject_id TEXT, + type TEXT NOT NULL, -- 'topic', 'link', 'note' + content TEXT NOT NULL, + is_completed INTEGER DEFAULT 0, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (subject_id) REFERENCES subjects(id) ON DELETE CASCADE + )`); + // Tasks Table db.run(`CREATE TABLE IF NOT EXISTS tasks ( id TEXT PRIMARY KEY, diff --git a/index.html b/index.html index da78416..1e0ae05 100644 --- a/index.html +++ b/index.html @@ -417,7 +417,7 @@