Projects BibleWeb Commentaries Matthew Henry commentary
Done

Matthew Henry commentary

Area: Commentaries Milestone: v2

Context

Problem: Bible readers benefit enormously from commentary — scholarly explanations that illuminate the meaning and context of verses. Matthew Henry's Complete Commentary (1706) is one of the most beloved and comprehensive Protestant commentaries ever written, still widely read three centuries later.

Solution: BibleWeb includes the full Matthew Henry commentary as one of three tabbed commentary sources accessible from any verse. Users can read verse-by-verse exposition alongside the Bible text.

Not included: Abridged or modern-language versions of Matthew Henry. This is the complete, original text.

Functional

When a user opens the commentary for any verse, they can read Matthew Henry's exposition on that passage. The commentary appears in a right-side drawer with tabs for switching between available commentary sources.

User flow:

  1. User clicks a verse in the reader → context menu appears
  2. Clicks "Commentary" → commentary drawer opens on the right
  3. Matthew Henry tab is selected by default (first tab)
  4. User reads the verse-by-verse commentary
  5. Can switch to John Gill or Kanttekeningen tabs
  6. Drawer can be closed with the X button

Edge cases:

  • Not every verse has a Matthew Henry entry — some verses are covered as part of a group
  • 4,123 verse-level entries in the database (the smallest of the three sources)
  • Long entries (some are thousands of words) render in a scrollable area

UX & Design

Tab interface:

  • Three tabs: Matthew Henry | John Gill | Kanttekeningen
  • Matthew Henry is the first/default tab
  • Active tab: underlined, primary text color
  • Inactive tabs: muted text color

Drawer:

  • Position: right side of screen
  • Width: 400px
  • Full height of viewport
  • Scrollable content area
  • Close button (X) in top-right corner

Text rendering:

  • Commentary text split by newline characters into paragraphs
  • Empty lines filtered out
  • Standard reading typography

Technical

Data:

  • DB table: commentaries — columns: id (PK), verse_id (FK → verses.id), source (text), text (text), text_nl (text, nullable)
  • Source value: 'matthew_henry'
  • Row count: 4,123 entries
  • Index: idx_commentaries_verse on verse_id

Data source: Imported from BibleGame source database (~/Code/BibleGame/Data/output/bible.db) via scripts/seed-commentaries.ts. Originally collected by BibleGame's 12_import_commentaries.py Python script.

API:

  • GET /api/commentaries/[bookId]/[chapter]/[verse] — returns all commentary sources for a verse
  • Requires tier: commentaries (Pro+)
  • Cache: max-age=86400 (24 hours)

Query: getCommentaries(verseId) in apps/web/src/lib/server/queries/commentaries.ts

Component: CommentaryDrawer.svelte — fetches API, groups by source, renders tabs. Tab order defined in SOURCE_ORDER: Matthew Henry → John Gill → Kanttekeningen.

Files:

  • apps/web/src/lib/components/bible/CommentaryDrawer.svelte — drawer + tabs
  • apps/web/src/routes/api/commentaries/[bookId]/[chapter]/[verse]/+server.ts — API endpoint
  • apps/web/src/lib/server/queries/commentaries.ts — DB queries
  • scripts/seed-commentaries.ts — import script from BibleGame DB

Status

Current: DONE Milestone: v2 Priority: High — cornerstone study feature

History:

  • Matthew Henry's Complete Commentary was one of the first study resources added to BibleGame
  • Imported from a public domain digital edition
  • The commentary was ported from BibleGame's SQLite DB directly (verse IDs match between projects)

Dependencies:

  • Requires: verse database (DONE), commentary drawer (DONE), tier system (DONE)
  • Used by: AI chat RAG pipeline (commentaries are retrieved as context for AI answers)

Screenshots

Feature screenshot