Skip to content

Architecture

Architecture

Updated Verified against 05086f5 on 2026-09-27

Page actions

ChatGPT and Claude are third-party services. The link gives them this page's public address and a short instruction. This site records nothing.

How the SGGS Knowledge Base is built: three repositories, one read-only API in five bounded contexts, a pinned database, and the surfaces that show the verbatim text.

The system does one thing and is built around it: it shows Sri Guru Granth Sahib Ji exactly as printed, cited by Ang, and proves at every step that nothing changed. Everything else — search, verification, the insights, the app — is read-only around that text.

In three sentences:

  • Three repositories, joined by pins. sggs-data builds the database from the source Bir and proves it character for character; this repository pins that exact database and serves it; the Gurbani Soul app pins the same database and this repository’s golden contract.
  • One read-only API, five bounded contexts. Reader, search, verify, insights and knowledge — each declares the tables it reads, runs as its own Vercel function (or all together), and opens SQLite read-only and immutable. The website and the wiki call it on the same origin.
  • Every deploy is gated and proven by commit. Nothing reaches production except through CI, and production is re-checked against the pin every six hours.
System landscape The people (sangat and students, Granthis and scholars, engineers), the three surfaces they use (website, iOS app, wiki), the read-only API running as Vercel functions and the pinned database behind it, sggs-data that turns the source Bir PDF into that database, the labelled English layer, and CI as the only way anything reaches production. 01 · System landscape Who uses the SGGS Knowledge Base, what they touch, and where the text comes from SurfacesPlatform Sangat · students — read, search, studySangat · studentsread, search, studyGranthi · scholar — reviews, never editsGranthi · scholarreviews, never editsEngineers · interns — change it by PRsEngineers · internschange it by PRsWebsite — gurbanisoul.com — frontend/Websitegurbanisoul.comfrontend/Gurbani Soul (iOS) — offline, own DB copyGurbani Soul (iOS)offline, own DB copyThis wiki — docs.gurbanisoul.comThis wikidocs.gurbanisoul.com/api/*live widgetsThe API, Python stdlib — Vercel functions, same origin — 29 routes · 5 contextsThe API, Python stdlibVercel functions, same origin29 routes · 5 contextsdb/sggs.sqlite — 60,658 lines · 1,430 Angs — installed by pin, verifieddb/sggs.sqlite60,658 lines · 1,430 Angsinstalled by pin, verifiedby pintranslationsShabadOS / BaniDB — English, a labelled layer — never blended inShabadOS / BaniDBEnglish, a labelled layernever blended insggs-data — source PDF → database — reconciled, gated, ledgeredsggs-datasource PDF → databasereconciled, gated, ledgereddeploysCI gates — tests · contract · integrity — the only way to deployCI gatestests · contract · integritythe only way to deployVercel — the web + the API functions — Render kept on standbyVercelthe web + the API functionsRender kept on standby a personcomponent in this projectdata at restexternal systemgate: fails the build or the deployflow: data or control moves this wayreference: pins, reads or derives from Source of truth: docs/architecture/overview.md · webapp/serve.py ·gateway/routes.json · dataset.lock.json ·.github/workflows/deploy-production.yml v1.3.10 · verified 2026-09-27 · d2f2e41Sri Guru Granth Sahib Ji — Knowledge Base · engineering wiki
Poster 01 — the system landscape: the people, the three surfaces, the one read-only API, the pinned database, and where the verbatim text comes from · open full size

The pages

  • The system on one pagewho uses it, the containers across the three repositories, how production runs, the five data layers.
  • Request lifecycleone request from the browser to SQLite and back, in the order the code does it (poster 08).
  • Bounded contexts and the gatewaythe five contexts, how a function serves a slice of the database, and how routing is generated so it cannot drift (poster 09).
  • Three repositories and pinsevery hand-off between data, platform and app as a reviewed lock file (poster 02).
  • Search waterfallhow a query becomes results, tier by tier (poster 05); part of Search & verification.
  • The insights contexttheme networks, author and raag emphasis, Vaars and related verses: every number precomputed, descriptive only.
  • The knowledge contextraag-timing claims credited to their sources, disagreement kept, and forms taken only from headings.
  • The websitea static Astro site with no framework runtime, two layouts, and the API on the same origin.
  • Security and privacythe defences at each layer, what is collected about readers, and the known gaps.
  • Quality and observabilityeach quality, how it is measured and gated, how production is watched, and what is not yet wired.
  • Microservices roadmaphow the monolith became modules, then functions, and what is left.

The decisions behind this shape are the ADRs — especially three repositories (ADR-0007), the dataset by pin (ADR-0008) and the API as functions (ADR-0011). How the text is kept whole end to end is the integrity chain.