pwE (Pray With Me) is a premium digital companion and private sanctuary for the practice of Lectio Divina (Prayerful Reading), built in strict adherence to Catholic Doctrine and the 73-book Biblical Canon. The project serves as my flagship showcase of advanced software engineering: a Flutter application combining modular Clean Architecture, On-Device Artificial Intelligence (Gemma 4 via LiteRT-LM), Dual AI with On-Device RAG (TFLite/MiniLM), Zero-Knowledge Security (AES-256-GCM), official liturgical ingestion from CNBB via Cloud Run Jobs on GCP, and high-maturity engineering governance guided by a committee of 16 asynchronous Google Antigravity subagents and 34 formal ADRs.
Architecture & Software Engineering
- Clean Architecture + Modular DDD: Strict boundary isolation between an agnostic Core, pure Domain layer (zero dependencies on UI, Flutter, or Firebase), DataSources, and Presentation Layer. Every feature (
lectio_divina,auth,profile,preferences,security_vault,subscription) manages its own isolated dependency injection container (GetIt), preventing cross-domain leakage and unwanted coupling (ADR 0004 and ADR 0032). - God BLoC Decomposition (ADR 0015): Evolution beyond an early monolithic BLoC by splitting it into 6 cohesive, decoupled sub-BLoCs:
LectioSessionBloc,DailyLiturgyBloc,ExegesisBloc,PrayerJournalBloc,AiOratioBloc, andSubscriptionBloc. Each handles immutable state transitions viaEquatable, preventing UI race conditions and enabling isolated unit testing. - Multi-Agent Governance & Antigravity (ADR 0034): The continuous engineering lifecycle is governed by a committee of 16 AI specialist agents categorized into 4 strategic pillars (Governance/FinOps/Doctrine, Core Engineering/Data/AI, Interface/Platform/Prayer Rhythm, and Quality/DevOps). All are implemented as native asynchronous subagents of Google Antigravity (
.agents/agents/) with standardized YAML schemas, granular execution policies, and concurrent monitoring. - Reactive Routing & Lifecycle Safeguards: Powered by
GoRouterwith 14 typed sacred routes, a reactiveauth_redirectmechanism preventing premature route changes on cold start, and protection of the first-time user experience (FTUE) across/onboardingand/profile_setup. - Functional Error Handling: Strict adherence to functional programming patterns using
dartz(Either<Failure, Success>), ensuring that unexpected exceptions never break the contemplative prayer flow.
Artificial Intelligence & Machine Learning (Edge-First)
The core technical differentiator of pwE is its hybrid AI strategy with privacy by design:
- Gemma 4 E2B (On-Device via LiteRT-LM): Local smartphone inference powered by the LiteRT-LM engine with a native Android Kotlin plugin, accelerated by GPU/NPU through
MethodChanneland safeguarded by a memory concurrency mutex (ADR 0005). The model is provisioned via an opt-in partitioned download verified with SHA256 checksums. - Dual AI & On-Device RAG: A long-term spiritual memory system that retrieves past feelings, meditations, and prayers to enrich pastoral AI prompts. Vector embeddings are generated 100% on-device via TFLite using the
all-MiniLM-L6-v2model (384 dimensions), native WordPiece tokenization (BertTokenManager), and adaptive Mean Pooling β with zero spiritual notes ever leaving the device. - Gemini Cloud Staircase (Resilient Fallback): Integration with the Google Gemini model suite (default
gemini-3.5-flash-lite, dynamically parameterized via Firebase Remote Config) equipped with Smart Retry (exponential backoff with jitter) and BLoC Session Caching to avoid redundant calls. - Transparency & Explicit Consent (ADRs 0025 and 0033): Absolute sovereignty over personal spiritual data. The interface indicates the processing origin through a Golden Shield (100% local inference) or transparent cloud processing with prior explicit consent, alongside an option to practice classic Lectio Divina completely without AI.
- Fading Scaffolding: An adaptive spiritual maturity system where the AI progressively reduces verbosity as user streak grows (Beginner β Practitioner β Contemplative), diminishing technological "scaffolding" to foster interior silence.
- Guided OCR: Physical Bible text digitization with Google ML Kit Vision, featuring adaptive pre-processing (Canvas binarization, rotation, and cropping) and lexical correction to eliminate paper noise and shadows.
Zero-Knowledge Security & Spiritual Journal
- AES-256-GCM Rest Encryption (ADR 0029): Prayer journal notes, saved exegeses, and spiritual resolutions in the Caderno Espiritual (Spiritual Notebook) are encrypted at rest in local Hive storage using AES-256-GCM, random initialization vectors (IV), and PBKDF2 key derivation.
- Hardware-Backed Key Anchoring: Keys anchored in Android Keystore and iOS Keychain, ensuring that system backups or unauthorized device physical access never expose private spiritual data.
- Security Vault & Optional Passphrase (ADR 0026 & ADR 0032): An isolated
security_vaultfeature allowing users to configure an optional vault passphrase for extra defense-in-depth on shared devices.
Cloud Infrastructure, Ingestion & Data
- Liturgical Worker on GCP (Cloud Run Jobs): Automated daily liturgy ingestion pipeline running on Cloud Run Jobs orchestrated by Cloud Scheduler, consuming directly from the official CNBB API with resilient fallback to CanΓ§Γ£o Nova and canonical verse sanitization.
- The 7 Drops of Wisdom: The liturgical pipeline precomputes and persists in Firestore deep biblical commentaries across 7 Church Tradition lenses: historical, social, philological, patristic, magisterial, theological, and ascetical.
- Ethical Monetization (Benefactors): Subscription management via RevenueCat SDK, offering a 7-day welcoming trial with full access, complete transparency, and zero disruptive ads (ADR 0009 and ADR 0017).
- Automated CI/CD: Comprehensive GitHub Actions pipelines featuring strict static analysis (
dart analyze), a 70% minimum test coverage gate, and automated release builds for Android and iOS.
Quality & Consolidated Metrics
- 931 automated tests (unit, widget, golden, and accessibility tests simulating 1.15x font scaling) across 193 test suites (
*_test.dart), exceeding 80% coverage in the core domain. - 34 formal ADRs documenting everything from state management and Edge LLM strategies to Hive box encryption, BLoC decomposition, and subagent architectures.
- 77+ releases recorded in the canonical CHANGELOG following Semantic Versioning with full PR and commit traceability.
- 16-subagent committee maintaining doctrinal fidelity, architectural hygiene, and full compliance with Apple App Store and Google Play Store guidelines.
UX & Sacred Design System
- Sacred Design System (Noble Parchment / Shalom): Solemn visual identity inspired by Catholic Tradition and Shalom spirituality, using the
SacredThemeColorspalette,CinzelandLoratypography, ornamental crosses (CrossOrnamentalDivider), and tactile micro-interactions such asHoldToSaveButton(2-second deliberate hold to seal prayers). - Universal Accessibility (a11y): Validated against layout overflow under accessibility font scaling (
textScaler >= 1.15x) on compact devices, ensuring comfort for elderly users and those with visual impairments. - Internationalization: Liturgical calendar selector supporting 18 UI languages and precomputed liturgy across 7 canonical languages.
Status: Version 0.9.77+103 β Sprint Store Readiness & Antigravity Subagents active. 931 automated tests, 34 formal ADRs, and v1.0.0 milestone preparation (October 2026).