Compare commits

...
Sign in to create a new pull request.

4 commits

Author SHA1 Message Date
StirGpea
49c42f76af docs: update README with database schema and priority calculation strategy 2026-08-21 11:32:25 +00:00
StirGpea
32321e9167 feat: add SQLite database schema 2026-08-21 11:32:22 +00:00
StirGpea
0443e8d21d style: add trailing newline to .gitignore 2026-08-21 08:27:02 +00:00
StirGpea
03234126ba feat: add initial project structure and .gitignore 2026-08-21 08:12:40 +00:00
3 changed files with 51 additions and 0 deletions

18
.gitignore vendored Normal file
View file

@ -0,0 +1,18 @@
/bin/
/vendor/
*.exe
*.exe~
*.dll
*.so
*.dylib
*.test
*.out
/storage/*.db
/storage/*.db-journal
.env
.idea/
.vscode/
*.swp
*.swo
.DS_Store

View file

@ -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.

View file

@ -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)
);