From 03234126ba1d7359da6ae3a61818e42cc1611758 Mon Sep 17 00:00:00 2001 From: StirGpea Date: Fri, 21 Aug 2026 08:12:40 +0000 Subject: [PATCH 1/4] feat: add initial project structure and .gitignore --- .gitignore | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a5a3e68 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +/bin/ +/vendor/ +*.exe +*.exe~ +*.dll +*.so +*.dylib +*.test +*.out +/storage/*.db +/storage/*.db-journal +.env +.idea/ +.vscode/ +*.swp +*.swo +.DS_Store -- 2.45.3 From 0443e8d21daa0f6dede21ea43bec4300c2f8267e Mon Sep 17 00:00:00 2001 From: StirGpea Date: Fri, 21 Aug 2026 08:27:02 +0000 Subject: [PATCH 2/4] style: add trailing newline to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a5a3e68..c96435d 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ *.swp *.swo .DS_Store + -- 2.45.3 From 32321e91672edea12eb262aa4f82688b190f7767 Mon Sep 17 00:00:00 2001 From: StirGpea Date: Fri, 21 Aug 2026 11:32:22 +0000 Subject: [PATCH 3/4] feat: add SQLite database schema --- internal/storage/schema.sql | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 internal/storage/schema.sql diff --git a/internal/storage/schema.sql b/internal/storage/schema.sql new file mode 100644 index 0000000..97b8f8f --- /dev/null +++ b/internal/storage/schema.sql @@ -0,0 +1,25 @@ +-- PieVR Database Schema + +CREATE TABLE IF NOT EXISTS questions ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + type TEXT NOT NULL, + question_text TEXT NOT NULL, + payload TEXT NOT NULL, + active BOOLEAN DEFAULT 1, + last_asked_at DATETIME, + streak INTEGER DEFAULT 0, + times_asked INTEGER DEFAULT 0, + times_correct INTEGER DEFAULT 0, + created_at DATETIME DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS tags ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT UNIQUE NOT NULL +); + +CREATE TABLE IF NOT EXISTS question_tags ( + question_id INTEGER REFERENCES questions(id) ON DELETE CASCADE, + tag_id INTEGER REFERENCES tags(id) ON DELETE CASCADE, + PRIMARY KEY (question_id, tag_id) +); -- 2.45.3 From 49c42f76aff8aec669aead7d96d3c0c0689a6eb2 Mon Sep 17 00:00:00 2001 From: StirGpea Date: Fri, 21 Aug 2026 11:32:25 +0000 Subject: [PATCH 4/4] docs: update README with database schema and priority calculation strategy --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 9480679..e4ddcbc 100644 --- a/README.md +++ b/README.md @@ -1 +1,9 @@ # PieVR + +## Database Schema & Core Concepts +- **Storage:** SQLite (`storage/` directory, ignored in `.gitignore`). +- **Tables:** + - `questions`: stores core question data (`id`, `type`, `question_text`, `payload` as JSON, `active`, `last_asked_at`, `streak`, `times_asked`, `times_correct`, `created_at`). + - `tags`: tags for granular and cross-cutting topic selection (`id`, `name`). + - `question_tags`: many-to-many relationship between questions and tags. +- **Priority & Spaced Repetition:** No hardcoded calendar intervals. Priorities and scheduling metrics are stored as raw counters (`streak`, `times_asked`, `last_asked_at`) in the database, while complex priority/decay formulas are calculated dynamically on the fly in Go. -- 2.45.3