A living reference architecture for building fault-tolerant, secure, and scalable mobile applications.
This repository is not just another "To-Do App" example. It is the practical implementation of my article series: "Engineering Production-Ready Flutter Apps".
I am documenting the journey of solving real-world production nightmares—silent crashes, memory leaks, security vulnerabilities, and invisible user journeys—by engineering robust solutions from the ground up.
My Philosophy: I don't just "patch" bugs; I architect resilience.
To provide the community with a battle-tested reference for:
- Resilience: Systems that degrade gracefully instead of crashing (Circuit Breakers).
- Security: Storing sensitive data using hardware-backed encryption, and sanitizing analytics strictly.
- Performance: Zero-overhead pipelines, isolate batching, and zero-copy operations.
- Scale: A Clean Architecture that survives team growth, library swaps, and feature bloat.
This codebase evolves alongside the articles. Each part introduces a new, production-grade architectural layer.
| Part | Title | Focus | Status |
|---|---|---|---|
| 01 | When SharedPreferences Fails | Resilience, Circuit Breakers, LRU Eviction | ✅ Published |
| 02 | The JWT Token Incident | Security, Keychain, Keystore, Encryption | ✅ Published |
| 03 | From 0.3% Crash Rate to Zero | Performance, Batching, Concurrency | ✅ Published |
| Part | Title | Focus | Status |
|---|---|---|---|
| 04 | Building a Production-Ready Navigation Observability System | Clean Architecture, Zero-Overhead, Privacy | ✅ Published |
(Links are updated as articles go live)
Current Version: v0.1.0-alpha (Navigation Observability Merge)
- It serves as a Reference Architecture, not a drop-in package (yet).
- The code reflects the current state of the article series.
- Breaking changes may occur as new layers (Networking, State Management, etc.) are introduced.
I am sharing this early to build in public and learn together.
- ✅ Clean Architecture Core: Strict separation of Domain, Data, Infrastructure, and Presentation.
- ✅ Navigation Observability (NEW):
- Zero-Overhead Event Bus: O(1) event routing with early returns.
- Strict Privacy by Default: Auto-redaction of PII/Sensitive data via zero-copy sanitization.
- Router-Agnostic: Adapter pattern implementation (currently using
auto_route).
- ✅ Advanced Caching Strategy:
- LRU Eviction Policy: To manage memory usage efficiently.
- 2-Layer Cache: Memory (Fast) + Disk (Persistent).
- ✅ Fault Tolerance & Security:
- Circuit Breaker Pattern: To isolate failures and prevent cascading crashes.
- Abstracted wrappers for iOS Keychain and Android KeyStore.
I am building this for the community, and I'd love your input!
- Found a bug? Please open an Issue.
- Have an architectural suggestion? Discussions are open.
- Want to contribute? PRs are welcome! Please match the existing architectural style.
Let's build better Flutter apps, together. ❤️
Author: Mahmoud Alatrash