Skip to content

Tech Stack

Status: Backend stack superseded by ADR-0001: Backend Architecture (proposed 2026-06-25). The mobile + voice choices below stand from the original client-facing recommendation.

Per .context/00-constraints.md non-negotiable #4, the overall stack is still proposed, not client-confirmed. ADR-0001 changes the backend half of that proposal and the client should be informed before locking.

Backend

Layer Choice Notes
Framework Django 5.x + Django Ninja FastAPI-style API ergonomics on the Django stack; auto-OpenAPI for the Flutter contract
CMS Wagtail StreamField (block-based rich content), Draftail editor, page tree fits Journey/Portal, scheduled publishing, workflows
Database Postgres 18 (Django ORM) GIN indexes on tag arrays for overlap queries
Search / ranking Postgres GIN at MVP → Meilisearch swap-in for Phase 2 Corpus stays <10K at MVP; Ranker interface keeps the swap mechanical
Cache + broker Redis 8 Response cache, rate limit, Celery broker, JWT denylist, sessions
Background jobs Celery + Redis AI tag drafting, ElevenLabs audio pre-gen, Substack sync
Object storage S3 + CloudFront (media only at MVP) API stays Redis-cached at origin until load demands edge cache
Auth (V1) django-allauth (headless) + Apple/Google Sign-In + JWT Accounts in V1; App Store requires Apple Sign-In + account deletion
Hosting AWS ECS Fargate Containerised web + Celery worker services
Observability (Phase 1) Sentry + structured logs Metrics tooling deferred to Phase 2

See ADR-0001 for considered alternatives, decision drivers, consequences, and the open items that depend on this ADR.

Mobile

Layer Choice Reason
Mobile Flutter (cross-platform iOS + Android) Single codebase; timeline constraint (14 weeks, both platforms)

Voice / TTS

Layer Choice Reason
Voice / TTS ElevenLabs — CS Lewis cloned voice Pre-generated at build time; instant playback; no per-request cost/latency

Content tagging

AI at ingest (build-time), editor QA before publish via Wagtail's workflow feature. Accuracy + human oversight; tags are load-bearing for traversal (see 00-constraints.md non-negotiable #2).

Integrations

  • ElevenLabs — TTS audio pre-generated and stored in S3 (not on-demand)
  • Substack — article sync into CMS via Celery polling job
  • Bookstore affiliate links — on source ladder, via CMS field
  • HarperCollins exclusivity note: No Narnia audiobook audio; Narnia skips the chapter rung on the source ladder

CMS capabilities at launch

  • Content types: Passage, Letter, Essay, Podcast (stub), Work, Author, Prompt, Journey/Chapter, Theme (see docs/cms-architecture.md for canonical schema)
  • All tag axes + controlled vocabulary management
  • Media + asset management (audio hosting via S3 + CloudFront, AI-image pipeline)
  • Admin roles: editor / admin / viewer; client team onboarded
  • Draft + preview mode (native Wagtail)
  • Scheduled publishing (native Wagtail)
  • Headless content API via Django Ninja (Redis cache, rate limits — see ADR-0001)
  • Substack article sync via Celery

Phase 2 CMS additions are tracked in 04-mvp-scope.md.