# expensify/app architecture

> Architecture diagram of the GitHub repository expensify/app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/expensify/app
- Repository: https://github.com/expensify/app

## Overview

New Expensify is a cross-platform chat and payments application. The principal user journey is entering the app, navigating conversations, and initiating expense or payment workflows; the README describes the product as payments built on chat. The graph also preserves routing, shared state, HTML message rendering, onboarding, and native integrations. Many application areas are represented by directories because their implementation was not sampled; dashed, uncited edges indicate plausible but unverified flow rather than inspected calls.

Main entry points: [`src/Expensify.tsx`](https://github.com/expensify/app/blob/main/src/Expensify.tsx) (App composition), [`src/components/HTMLEngineProvider`](https://github.com/expensify/app/tree/main/src/components/HTMLEngineProvider) (Message rendering), [`src/libs/actions/Card.ts`](https://github.com/expensify/app/blob/main/src/libs/actions/Card.ts) (Transaction actions), [`src/App.tsx`](https://github.com/expensify/app/blob/main/src/App.tsx) (Application shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_application["Application shell<br/>[App.tsx]"]
  node_expensify["App composition<br/>[Expensify.tsx]"]
  node_onboarding["Onboarding flow<br/>[OnboardingFlow.ts]"]
end

subgraph group_chat["Chat and navigation"]
  node_routes["Route definitions<br/>[ROUTES.ts]"]
  node_screens["Screen definitions<br/>[SCREENS.ts]"]
  node_chat_ui["Conversation UI"]
  node_html_rendering["Message rendering"]
  node_anchor_renderer["Link renderer"]
  node_image_renderer["Image renderer"]
  node_mention_renderer["Mention renderer"]
end

subgraph group_money["Expenses and payments"]
  node_transactions["Transaction actions<br/>[Card.ts]"]
  node_transaction_threads["Transaction threads"]
  node_requests["Expense requests<br/>[Request.ts]"]
  node_policies["Workspace policies<br/>[Policy.ts]"]
end

subgraph group_platform["Native capabilities"]
  node_android_native["Android integration"]
  node_ios_native["iOS integration"]
  node_hybrid_module["Hybrid app module"]
  node_native_utils["Native utility modules"]
end

subgraph group_shared["Shared foundations"]
  node_state_keys["State key catalog<br/>[ONYXKEYS.ts]"]
  node_search_results["Search result types<br/>[SearchResults.ts]"]
  node_html_context["Popover context<br/>[ContentContext.ts]"]
  node_popover_controller["Popover controller"]
  node_styles["Style system<br/>[index.ts]"]
end

node_user(("User"))

node_user -.->|"opens"| node_application
node_application -.->|"starts"| node_expensify
node_expensify -.->|"navigates via"| node_routes
node_routes -->|"selects"| node_screens
node_user -.->|"chats"| node_chat_ui
node_chat_ui -.->|"renders messages"| node_html_rendering
node_html_rendering -->|"dispatches links"| node_anchor_renderer
node_html_rendering -->|"dispatches images"| node_image_renderer
node_html_rendering -->|"dispatches mentions"| node_mention_renderer
node_user -.->|"initiates expenses"| node_transactions
node_transactions -.->|"opens thread"| node_transaction_threads
node_transactions -.->|"creates requests"| node_requests
node_user -.->|"onboards"| node_onboarding
node_onboarding -.->|"tracks state"| node_state_keys
node_popover_controller -->|"uses context"| node_html_context
node_expensify -.->|"uses native bridge"| node_android_native
node_expensify -.->|"uses native bridge"| node_ios_native
node_expensify -.->|"integrates hybrid app"| node_hybrid_module
node_expensify -.->|"uses native utilities"| node_native_utils

click node_application "https://github.com/expensify/app/blob/main/src/App.tsx"
click node_expensify "https://github.com/expensify/app/blob/main/src/Expensify.tsx"
click node_routes "https://github.com/expensify/app/blob/main/src/ROUTES.ts"
click node_screens "https://github.com/expensify/app/blob/main/src/SCREENS.ts"
click node_chat_ui "https://github.com/expensify/app/tree/main/src/pages"
click node_html_rendering "https://github.com/expensify/app/tree/main/src/components/HTMLEngineProvider"
click node_anchor_renderer "https://github.com/expensify/app/tree/main/src/components/HTMLEngineProvider/HTMLRenderers"
click node_image_renderer "https://github.com/expensify/app/tree/main/src/components/HTMLEngineProvider/HTMLRenderers"
click node_mention_renderer "https://github.com/expensify/app/tree/main/src/components/HTMLEngineProvider/HTMLRenderers"
click node_transactions "https://github.com/expensify/app/blob/main/src/libs/actions/Card.ts"
click node_transaction_threads "https://github.com/expensify/app/blob/main/src/libs/TransactionThreadNavigationUtils.ts"
click node_requests "https://github.com/expensify/app/blob/main/src/types/onyx/Request.ts"
click node_policies "https://github.com/expensify/app/blob/main/src/types/onyx/Policy.ts"
click node_onboarding "https://github.com/expensify/app/blob/main/src/libs/actions/Welcome/OnboardingFlow.ts"
click node_state_keys "https://github.com/expensify/app/blob/main/src/ONYXKEYS.ts"
click node_search_results "https://github.com/expensify/app/blob/main/src/types/onyx/SearchResults.ts"
click node_html_context "https://github.com/expensify/app/blob/main/src/components/PopoverMenu/v2/content/ContentContext.ts"
click node_popover_controller "https://github.com/expensify/app/blob/main/src/components/PopoverMenu/v2/content/useContentController.ts"
click node_styles "https://github.com/expensify/app/blob/main/src/styles/index.ts"
click node_android_native "https://github.com/expensify/app/tree/main/android/app/src/main/java/com/expensify/chat"
click node_ios_native "https://github.com/expensify/app/tree/main/ios"
click node_hybrid_module "https://github.com/expensify/app/tree/main/modules/hybrid-app/src"
click node_native_utils "https://github.com/expensify/app/tree/main/modules/ExpensifyNitroUtils/src"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_application,node_expensify,node_onboarding,node_user toneBlue
class node_routes,node_screens,node_chat_ui,node_html_rendering,node_anchor_renderer,node_image_renderer,node_mention_renderer toneAmber
class node_transactions,node_transaction_threads,node_requests,node_policies toneMint
class node_android_native,node_ios_native,node_hybrid_module,node_native_utils toneRose
class node_state_keys,node_search_results,node_html_context,node_popover_controller,node_styles toneIndigo
```

## Components

### App experience

- [Application shell](https://github.com/expensify/app/blob/main/src/App.tsx): `src/App.tsx`
- [App composition](https://github.com/expensify/app/blob/main/src/Expensify.tsx): `src/Expensify.tsx`
- [Onboarding flow](https://github.com/expensify/app/blob/main/src/libs/actions/Welcome/OnboardingFlow.ts): `src/libs/actions/Welcome/OnboardingFlow.ts`

### Chat and navigation

- [Route definitions](https://github.com/expensify/app/blob/main/src/ROUTES.ts): `src/ROUTES.ts`
- [Screen definitions](https://github.com/expensify/app/blob/main/src/SCREENS.ts): `src/SCREENS.ts`
- [Conversation UI](https://github.com/expensify/app/tree/main/src/pages): `src/pages`
- [Message rendering](https://github.com/expensify/app/tree/main/src/components/HTMLEngineProvider): `src/components/HTMLEngineProvider`
- [Link renderer](https://github.com/expensify/app/tree/main/src/components/HTMLEngineProvider/HTMLRenderers): `src/components/HTMLEngineProvider/HTMLRenderers`
- [Image renderer](https://github.com/expensify/app/tree/main/src/components/HTMLEngineProvider/HTMLRenderers): `src/components/HTMLEngineProvider/HTMLRenderers`
- [Mention renderer](https://github.com/expensify/app/tree/main/src/components/HTMLEngineProvider/HTMLRenderers): `src/components/HTMLEngineProvider/HTMLRenderers`

### Expenses and payments

- [Transaction actions](https://github.com/expensify/app/blob/main/src/libs/actions/Card.ts): `src/libs/actions/Card.ts`
- [Transaction threads](https://github.com/expensify/app/blob/main/src/libs/TransactionThreadNavigationUtils.ts): `src/libs/TransactionThreadNavigationUtils.ts`
- [Expense requests](https://github.com/expensify/app/blob/main/src/types/onyx/Request.ts): `src/types/onyx/Request.ts`
- [Workspace policies](https://github.com/expensify/app/blob/main/src/types/onyx/Policy.ts): `src/types/onyx/Policy.ts`

### Native capabilities

- [Android integration](https://github.com/expensify/app/tree/main/android/app/src/main/java/com/expensify/chat): `android/app/src/main/java/com/expensify/chat`
- [iOS integration](https://github.com/expensify/app/tree/main/ios): `ios`
- [Hybrid app module](https://github.com/expensify/app/tree/main/modules/hybrid-app/src): `modules/hybrid-app/src`
- [Native utility modules](https://github.com/expensify/app/tree/main/modules/ExpensifyNitroUtils/src): `modules/ExpensifyNitroUtils/src`

### Shared foundations

- [State key catalog](https://github.com/expensify/app/blob/main/src/ONYXKEYS.ts): `src/ONYXKEYS.ts`
- [Search result types](https://github.com/expensify/app/blob/main/src/types/onyx/SearchResults.ts): `src/types/onyx/SearchResults.ts`
- [Popover context](https://github.com/expensify/app/blob/main/src/components/PopoverMenu/v2/content/ContentContext.ts): `src/components/PopoverMenu/v2/content/ContentContext.ts`
- [Popover controller](https://github.com/expensify/app/blob/main/src/components/PopoverMenu/v2/content/useContentController.ts): `src/components/PopoverMenu/v2/content/useContentController.ts`
- [Style system](https://github.com/expensify/app/blob/main/src/styles/index.ts): `src/styles/index.ts`

### Other components

- **User**

## Connections

- User → Application shell: opens
- Application shell → App composition: starts
- App composition → Route definitions: navigates via
- Route definitions → Screen definitions: selects (evidence: `src/ROUTES.ts`)
- User → Conversation UI: chats
- Conversation UI → Message rendering: renders messages
- Message rendering → Link renderer: dispatches links (evidence: `src/components/HTMLEngineProvider/HTMLRenderers/index.ts`)
- Message rendering → Image renderer: dispatches images (evidence: `src/components/HTMLEngineProvider/HTMLRenderers/index.ts`)
- Message rendering → Mention renderer: dispatches mentions (evidence: `src/components/HTMLEngineProvider/HTMLRenderers/index.ts`)
- User → Transaction actions: initiates expenses
- Transaction actions → Transaction threads: opens thread
- Transaction actions → Expense requests: creates requests
- User → Onboarding flow: onboards
- Onboarding flow → State key catalog: tracks state (evidence: `src/ONYXKEYS.ts`)
- Popover controller → Popover context: uses context (evidence: `src/components/PopoverMenu/v2/content/useContentController.ts`)
- App composition → Android integration: uses native bridge
- App composition → iOS integration: uses native bridge
- App composition → Hybrid app module: integrates hybrid app
- App composition → Native utility modules: uses native utilities
