Decision: User model — single user vs multi-user with auth #6

Closed
opened 2026-08-20 13:59:24 +02:00 by gaetan · 1 comment
Owner

Part of #1

Question

Should the app support a single hardcoded user or proper authentication from day one?

Options:

  • Single user, no auth: Simplest path. User data stored in a single DB. No login flow.
  • Single user with auth: One account, but proper login/signup flow. Leaves room for multi-user later.
  • Multi-user from day one: Full auth, user isolation, more complex.

Considerations:

  • "Small web app" + "single-user" in the destination suggests no auth needed
  • But auth infrastructure, if built, is non-trivial (password hashing, sessions, CSRF)
  • Does the user want to share progress across devices?
  • Content is curated by the app — no user accounts needed for content management

This decision significantly impacts scope and complexity.

Part of #1 ## Question Should the app support a single hardcoded user or proper authentication from day one? Options: - **Single user, no auth**: Simplest path. User data stored in a single DB. No login flow. - **Single user with auth**: One account, but proper login/signup flow. Leaves room for multi-user later. - **Multi-user from day one**: Full auth, user isolation, more complex. Considerations: - "Small web app" + "single-user" in the destination suggests no auth needed - But auth infrastructure, if built, is non-trivial (password hashing, sessions, CSRF) - Does the user want to share progress across devices? - Content is curated by the app — no user accounts needed for content management This decision significantly impacts scope and complexity.
gaetan self-assigned this 2026-08-20 14:30:11 +02:00
Author
Owner

Resolution

User model decided:

Auth: None. Single implicit user. No login flow.

Progress storage: SQLite file (knowledgify.db). Single file, zero config, pure Go driver (modernc.org/sqlite).

Progress data model (per card):

  • next_review (datetime) — when to show next
  • interval (float64, days) — current interval
  • ease_factor (float64) — starts at 2.5, adjusts per answer
  • repetitions (int) — consecutive correct answers
  • last_review (datetime, nullable) — last time shown

Decks: None at launch. Categories are the only organizational unit.

DB schema:

CREATE TABLE cards (
  id INTEGER PRIMARY KEY,
  type TEXT NOT NULL CHECK(type IN ('qa', 'vf')),
  question TEXT NOT NULL,
  answer TEXT NOT NULL,
  explanation TEXT,
  category TEXT NOT NULL,
  tags TEXT,
  content_path TEXT NOT NULL,
  content_id INTEGER NOT NULL
);

CREATE TABLE progress (
  card_id INTEGER PRIMARY KEY,
  next_review DATETIME NOT NULL,
  interval REAL NOT NULL DEFAULT 0,
  ease_factor REAL NOT NULL DEFAULT 2.5,
  repetitions INTEGER NOT NULL DEFAULT 0,
  last_review DATETIME,
  FOREIGN KEY (card_id) REFERENCES cards(id)
);
## Resolution User model decided: **Auth**: None. Single implicit user. No login flow. **Progress storage**: SQLite file (`knowledgify.db`). Single file, zero config, pure Go driver (`modernc.org/sqlite`). **Progress data model** (per card): - `next_review` (datetime) — when to show next - `interval` (float64, days) — current interval - `ease_factor` (float64) — starts at 2.5, adjusts per answer - `repetitions` (int) — consecutive correct answers - `last_review` (datetime, nullable) — last time shown **Decks**: None at launch. Categories are the only organizational unit. **DB schema**: ```sql CREATE TABLE cards ( id INTEGER PRIMARY KEY, type TEXT NOT NULL CHECK(type IN ('qa', 'vf')), question TEXT NOT NULL, answer TEXT NOT NULL, explanation TEXT, category TEXT NOT NULL, tags TEXT, content_path TEXT NOT NULL, content_id INTEGER NOT NULL ); CREATE TABLE progress ( card_id INTEGER PRIMARY KEY, next_review DATETIME NOT NULL, interval REAL NOT NULL DEFAULT 0, ease_factor REAL NOT NULL DEFAULT 2.5, repetitions INTEGER NOT NULL DEFAULT 0, last_review DATETIME, FOREIGN KEY (card_id) REFERENCES cards(id) ); ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
gaetan/knowledgify#6
No description provided.