Feature: Add lightweight reader Q&A (SQLite-based) #49

Closed
opened 2026-06-09 20:48:09 +00:00 by glow · 1 comment
Owner

Problem

No way for readers to ask questions or share repair experiences.

Revised approach

Use SQLite instead of Discourse/Disqus:

  1. Simple Q&A table in SQLite
  2. POST /api/questions endpoint on the preview server
  3. "Reader Questions" section on article pages (comments + answers)
  4. Admin panel to review and reply

Why SQLite works

  • No database server needed
  • Already have Python/SQLite on the VPS
  • Single file, easy to back up
  • Scales fine for our traffic level

Schema sketch

CREATE TABLE questions (
  id INTEGER PRIMARY KEY,
  article_slug TEXT NOT NULL,
  author TEXT,
  body TEXT NOT NULL,
  answer TEXT,
  created_at TEXT DEFAULT (datetime('now')),
  answered_at TEXT
);

Priority

Low - after content volume and newsletter are established.

Status

REVISED: SQLite-based, not Discourse/Disqus.

## Problem No way for readers to ask questions or share repair experiences. ## Revised approach Use SQLite instead of Discourse/Disqus: 1. Simple Q&A table in SQLite 2. POST /api/questions endpoint on the preview server 3. "Reader Questions" section on article pages (comments + answers) 4. Admin panel to review and reply ## Why SQLite works - No database server needed - Already have Python/SQLite on the VPS - Single file, easy to back up - Scales fine for our traffic level ## Schema sketch ``` CREATE TABLE questions ( id INTEGER PRIMARY KEY, article_slug TEXT NOT NULL, author TEXT, body TEXT NOT NULL, answer TEXT, created_at TEXT DEFAULT (datetime('now')), answered_at TEXT ); ``` ## Priority Low - after content volume and newsletter are established. ## Status REVISED: SQLite-based, not Discourse/Disqus.
glow self-assigned this 2026-06-09 20:48:09 +00:00
glow changed title from Feature: Add community/forum for reader questions to Feature: Add lightweight reader Q&A (SQLite-based) 2026-06-09 21:14:34 +00:00
glow closed this issue 2026-06-09 21:53:47 +00:00
Author
Owner

Implemented in commit 4acbf7e.

Changes:

  • preview-serve.ts: Added SQLite Q&A database (bun:sqlite), GET /api/questions?slug= to fetch questions, POST /api/questions to submit new questions
  • src/components/reader-qa.tsx: New Qwik component — displays existing questions with answers, shows a submit form for asking new ones, uses useVisibleTask$ to fetch on mount and after submission
  • src/routes/articles/[slug]/index.tsx: ReaderQA integrated into article page (between newsletter signup and related articles)

Tested locally — both GET and POST endpoints return correct JSON responses with proper validation.

Implemented in commit 4acbf7e. Changes: - **preview-serve.ts**: Added SQLite Q&A database (bun:sqlite), GET /api/questions?slug=<slug> to fetch questions, POST /api/questions to submit new questions - **src/components/reader-qa.tsx**: New Qwik component — displays existing questions with answers, shows a submit form for asking new ones, uses useVisibleTask$ to fetch on mount and after submission - **src/routes/articles/[slug]/index.tsx**: ReaderQA integrated into article page (between newsletter signup and related articles) Tested locally — both GET and POST endpoints return correct JSON responses with proper validation.
Sign in to join this conversation.
No labels
bug
feature
improvement
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.

Dependencies

No dependencies set.

Reference
glow/first-home-diy#49
No description provided.