Offline Bibles
The Bible reader works without a network. Each translation is a SQLite file built on the backend, downloaded once by the app, and queried locally.
Backend side
- Files are committed under
bibles/storage/<VERSION>/(16 versions) and registered asBibleBuildrows withmanage.py register_bible_build, which marks the current build the manifest serves. - Built with
build_sqlite_from_csv(frommedia/bibles/*.csv) orbuild_bible_sqlite(from the legacy SQL tables). - Endpoints:
rest/bibles/manifest/,rest/bibles/<translation>/<build>/download, pluscompare/,<version>/<book_id>/<chapter>/and<version>/search/for clients that read online.
App side (utils/bibleDownload.js, bibles/sqliteService.js)
ensureBibleInstalled(key)downloads when missing or when a newer build appears; the version is re-checked at most once a day; a stale build file is deleted once the new one is in place.- Offline-first: if the manifest or download fails, an installed copy is still used;
listInstalledTranslations()builds the version list from what is on disk. - Schema: table
verse(book,book_id,chapter,verse,text) and FTS5 tableverse_ftsfor keyword search (the offline fallback for semantic search). - Downloads do not work on Expo Web or under remote JS debugging (
BibleStorageUnavailableError).
Bundled metadata
constants/bibleData/version_list.json (ASV, ALBB, ESV, KJV, LSB, LU17, NET, NIV, …) and one JSON per version with the book and chapter structure, indexed by bibleSchemas.js. These are exported from the backend with export_version_list and create_version_schema; regenerate them when a version is added.
Related UI
CompareVersionsModal downloads versions on demand; DefaultVersionSelector, BibleVersionSwitcher and VersionPicker handle version choice; the default version is stored under defaultBibleVersion.
Adding a translation
- Backend: build the SQLite file, register the build, mark it current, export the version list and schema JSON.
- App: add the schema JSON under
constants/bibleData/, updateversion_list.json, ship a JS update (no native change needed).