WhoBuilt

React Native MicroApp Architecture

Sep 22, 2022· 17 min· 3.3K views·Watch on YouTube

Speakers

Dilara Kırnapcı, a software developer on Trendyol’s Seller Center Mobile Core team, and Batuhan Tozun, an engineering team lead on its Seller Center Web Core team, explain their micro-app architecture at React Native EU 2022.

Why the monolith became hard to scale

Trendyol’s Seller Center is a React Native platform where sellers manage products, orders, stores, and finances. As the organization grew, multiple teams sharing a large codebase and pipeline faced different development and testing practices, unclear ownership, and difficulty isolating changes.

How the core app and micro-apps fit together

The architecture divides the application into a core app and team-owned micro-apps. The core app contains the Android and iOS projects, native libraries, and entry point; it loads micro-apps from a config file. Micro-apps contain JavaScript business logic and UI, and use the core as a dependency.

Contracts, shared libraries, and developer builds

Each micro-app exports items such as navigation stacks, tabs, deep links, components, and methods through a `microapp.js` contract. The core collects the routing structure, and micro-apps can access one another’s exported methods through the core. Shared components and utilities are published as npm packages, while core-provided debug builds let teams develop alongside other modules; Dilara reports iOS app load time dropping from over a minute to under 10 seconds.

Testing and release workflow

Each micro-app has a separate Jest and React Native Testing Library environment. Dilara compares almost 350 seconds to run tests in the monolithic app with almost 50 seconds for the account app. Teams run tests in a pipeline, mark modules ready for testing or deployment, build the main application with selected modules, and distribute it for internal review or store beta testing before QA smoke tests and release.

Team model and reported outcomes

Trendyol had 15 product teams, with JavaScript developers building features using shared infrastructure APIs. A platform team maintained the infrastructure while product teams focused on features. Dilara says the approach sped up development cycles and made builds and tests faster.

Takeaways

  • Give each team clear ownership of a bounded module and its development process.
  • Keep native capabilities and shared infrastructure in a core platform so feature teams can work in JavaScript.
  • Use explicit module contracts for routing and cross-module methods.
  • Run tests per module to shorten feedback loops; the account app’s tests took almost 50 seconds versus almost 350 seconds for the monolith.
  • Let teams validate modules together in a composed app before beta distribution and release.

Mentioned in this talk

Search inside this talk

What was claimed 15

Related talks