Android Architecture for the Rocketship - Part 1: Modularisation
Article Summary
Huan Nguyen from Afterpay reveals how they architected their Android rewrite to support hundreds of future developers. The secret? A three-tiered modular structure that makes parallel development actually work.
Eight months into rewriting their React Native apps in native Android, Afterpay's team designed a modularization strategy to solve a critical problem: how to scale from a small team to hundreds of mobile developers without chaos. They built a framework with core, service, and feature modules, each split into api, impl, wiring, fakes, and demo sub-modules.
Key Takeaways
- Every module splits into 5 sub-modules: api, impl, wiring, fakes, and demo
- Single responsibility rule: describe each module's purpose in one simple sentence
- Demo apps enable parallel feature development and isolated UI testing
- Tech stack agnostic design allows modules to work in any app architecture
- Kotlin scripts automate new module setup to keep developers focused on logic
Afterpay's structured modularization approach enables clear ownership, parallel development, and cross-app reusability while maintaining fast build times and code quality.
About This Article
Afterpay was growing fast. They needed to scale their Android architecture from a small team to hundreds of developers while keeping code quality high and preventing conflicts when multiple teams worked on features at the same time.
Huan Nguyen's team built a three-tiered module hierarchy with dependency rules that stopped lower-level modules from depending on higher-level ones. This prevented circular dependencies and let developers work on features independently.
After nine months, the team saw real improvements. Build times got faster and the clear separation between modules meant developers could move quicker without running into architectural problems.