Back to all projects
SearchContent sitein development

ib.ru — website of the Russian Bible Students

A Russian-language site on the teachings of the Bible Students of 1872–1917. The materials are translations from English, so the English original lives inside the Russian pages: each translated paragraph stands next to its original. The site is built for long reading and for editors who work without a programmer.

My role: Author: architecture, backend, front-end integration, editorial tools.

638
tests
18
Django apps
≈23,000
lines of Python, migrations excluded
up to 96%
lighter responses when moving around the site
The site: the Topics page with an engraving in the section header
The site: the Topics page with an engraving in the section header
The Wagtail admin: the article editor in Russian, with field hints
The Wagtail admin: the article editor in Russian, with field hints

The task

The site needs to make texts from the late 19th and early 20th century easy to read: long chapters, hundreds of “translation — original” paragraph pairs, scripture references and reprint numbers in every text. A reader should quickly find material by topic, year, number or verse.

Content is entered by editors, not by a developer. Hence the requirements: a clear admin in Russian, checks on save, pasting long texts in one go, protection against accidental deletion. And no external CDNs or trackers: readers' addresses go nowhere.

Architecture

A Django and Wagtail monolith: 18 apps, one per site section, over one PostgreSQL database. Pages are server-rendered, and htmx swaps only <main>, so the header, footer and styles are not reloaded on navigation. In front of Django sit nginx with rate limits and a Redis page cache.

  1. Who uses it
    Readersa browser, no external scripts or cookies
    Editorsthe Wagtail admin in Russian
  2. Entry
    nginxHTTPS, rate limits, own domains only
    Middlewarepage cache, CSP, Vary for htmx
  3. Site apps
    Materialsarticles, library, reprints, manna, blog, lectures
    BibleSynodal text, verse tooltips, verse index
    SearchPostgreSQL FTS, one config for two languages
    Editorialtext pasting, checks, questions, help
  4. Data and deployment
    PostgreSQL 17data, full-text index
    Redispage and data cache
    Dockergunicorn, whitenoise, nginx, certbot
    GitHub Actionslint, types, tests, image build

Key decisions

htmx with progressive enhancement

All navigation, filters and list pages swap only <main>, and the address is updated. Links and forms stay ordinary: without JavaScript the server returns the full page.

Why
Responses are 89–96% lighter than full pages, and the site stays plain HTML for search engines and old browsers.
Trade-off
Every page type has two templates, full and fragment. A test checks every type so the second is never forgotten.

Full-page cache, but only for marked pages

A returning reader is served from Redis without touching the database. Only Wagtail pages without a session or a CSRF token are cached; the key includes the current day, because the home page shows today's manna. Publishing bumps the cache version.

Why
The site handles load on a small server, and editors see their changes right away.
Trade-off
The subscribe form is on every page, so it has no CSRF token; that is safe because subscription is double opt-in and email frequency is limited.

Own verse tooltips

The Synodal Bible — 31,169 verses — is stored in the database. References like “John 3:16” are marked up on the server, and the tooltip loads the verse on hover. The index stores a verse as one number, chapter × 1000 + verse, so a verse inside a long reference is found with one condition.

Why
No external service: readers' IPs go nowhere, and “where on the site is this verse discussed” is one query.
Trade-off
Numbering is Synodal: if a translator gave a reference by KJV numbering, the tooltip shows the neighbouring verse.

One search for two languages

PostgreSQL full-text search with the russian config: Cyrillic is stemmed as Russian, Latin as English. One query searches seven material types, and tabs and counts are computed from the same result.

Why
No separate Elasticsearch to run, and English originals are found because they live inside the Russian pages.
Trade-off
Ranking is simpler than a search engine's; promoted results are set by editors.

Analytics without personal data

The browser sends the page number via sendBeacon, and the server bumps a daily counter with one INSERT … ON CONFLICT. No IP, cookies or visitor ID; bots and editors are not counted. Reports live in the admin.

Why
No external scripts and no cookie consent needed, and editors see what is read and what is searched without results.
Trade-off
It counts views, not people, and the history starts at launch.

Tools for long texts

An editor pastes the translation and the original in one go, and the site lays them out into paragraph pairs. If the paragraph counts differ, nothing is written: a table shows where they diverge. Changes are saved as a draft.

Why
A reprint has hundreds of paragraph pairs; entering them one form at a time is impossible, and silently shifted pairs are worse than an error.
Trade-off
Pasting plain text loses italics, so there is a second path: splitting already formatted text into paragraphs.

Hard parts

A section deleted together with its articles

An editor meant to delete an article but clicked “Delete” in the menu of the section itself — the section and both articles were gone, and Wagtail has no trash. Now a non-empty section cannot be deleted, and deleting several pages requires typing the word “DELETE”.

Importing the manna from old markup

The texts for 366 days came from windows-1251 pages hand-marked in different years, in three variants. Only bold type tells the verse from the comment, so the parser relies on it, and all variants are pinned in test fixtures.

Hidden N+1 queries

Per-page query budgets missed problems because the tests had one item. Growth tests were added: a page with five items must make as many queries as with one.

Migrations nobody created

Changing a StreamField block changes the migrations of every model that uses it, and four such migrations once went unnoticed. Now CI runs makemigrations --check.

What's next

The site is in development: the sections and editorial tools work, the launch is ahead.

Launch

Deployment to the server, cron for the newsletter and backups, verifying the site in Yandex Webmaster and Google Search Console.

Security

Switch CSP from Report-Only to enforcing after checking the console on every page type.

Legal texts

A lawyer reviews the drafts of the privacy policy and consents under Russian law 152-FZ.

Content

The Tabernacle on the Chart of the Ages, a font for Greek text.

What I would do differently

  • Not create the English locale in advance. The English tree is empty, yet every query must filter by language — more than twenty places in the code — and uniqueness constraints have to be designed with a future translation in mind.
  • Render <main> from the same template with template partials (the django-template-partials package; built into Django 6) instead of 27 separate fragment files and a test that makes sure none is forgotten.
  • Cover the front end with browser tests. The 638 tests are in Python, while about 1,300 lines of own JavaScript — focus after an htmx swap, reading position, tooltips, the cookie window — are checked by hand; a dozen Playwright scenarios in CI would be enough.
  • Record decisions in ADRs and a README for people. Today they are collected in one 1,700-line file, and the README is 40 lines; a new developer starts more easily with short documents.

Stack

Backend
Python 3.13, Django 5.2 LTS, Wagtail 8, wagtail-localize
Data
PostgreSQL 17 (psycopg 3, full-text search), Redis
Front end
Django templates, own CSS on variables, htmx, local fonts
Deployment
Docker, gunicorn, whitenoise, nginx, certbot
Quality
pytest, Ruff, basedpyright, djlint, pre-commit, GitHub Actions

Need a similar system?

Tell me about the task — I reply within a day in RU, RO or EN.