Cash App Aug 3, 2021

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

Critical Insight

Afterpay's structured modularization approach enables clear ownership, parallel development, and cross-app reusability while maintaining fast build times and code quality.

The team hints at their Flow Navigation architecture that lets any flow plug into any other flow, coming in a future post.

About This Article

Problem

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.

Solution

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.

Impact

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.