Problem: Bible readers want to jot down thoughts, insights, or questions about specific verses — and find them again later when they return to that passage.
Solution: A note system that attaches user-written notes to individual verses. Notes are created via the verse context menu and appear as subtle indicators in the reader text.
Not included: Rich text formatting (bold, italic, links) in notes. Notes are plain text only.
Users can create, edit, and delete notes on any verse. Notes are saved immediately and persist across sessions.
User flow:
Edge cases:
Note editor:
Note indicator: Dashed underline on first 5 words of noted verses (see Verse Note Indicators feature).
DB table: user_notes
id (PK), userId, type ('verse'), bookId, chapter, verse, content, createdAt, updatedAtuserIdAPI:
POST /api/notes — create (enforces free tier limit of 5)PATCH /api/notes/[id] — update (ownership enforced)DELETE /api/notes/[id] — delete (ownership enforced)GET /api/notes — fetch all user notesClient store (notes.svelte.ts):
$stateMap<"bookId:chapter:verse", VerseNote> index for O(1) lookupinitNotes() fetches all notes on mountComponent: NoteEditor.svelte — fixed overlay with auto-resizing textarea, Ctrl+S save, Escape cancel.
Tier limits (tier.ts): Free = max 5 notes, Pro = unlimited.
Files:
apps/web/src/routes/api/notes/+server.ts — POST (create)apps/web/src/routes/api/notes/[id]/+server.ts — PATCH, DELETEapps/web/src/lib/server/queries/notes.ts — CRUD functionsapps/web/src/lib/stores/notes.svelte.ts — client storeapps/web/src/lib/components/bible/NoteEditor.svelte — editor UICurrent: DONE Milestone: v1 Priority: Core — fundamental study feature
History:
Dependencies: