# qvapay/mobile_app architecture

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

- Interactive diagram: https://gitdiagram.com/qvapay/mobile_app
- Repository: https://github.com/qvapay/mobile_app

## Overview

QvaPay is a cross-platform financial app combining account-based money services with a self-custody, multi-chain wallet. Users enter through onboarding or login, then use balance, payments, P2P, savings, and commerce features; wallet users can also create or import keys and transact without an account. The map preserves the README’s major product branches and the documented API/query and local-wallet layers. Some feature implementations were not sampled, so their edges are included only where the README documents the relationship.

Main entry points: [`api/client.ts`](https://github.com/qvapay/mobile_app/blob/main/api/client.ts) (HTTP API client), [`api/userApi.ts`](https://github.com/qvapay/mobile_app/blob/main/api/userApi.ts) (API modules and types), [`auth/AuthContext.tsx`](https://github.com/qvapay/mobile_app/blob/main/auth/AuthContext.tsx) (Authentication state), [`App.tsx`](https://github.com/qvapay/mobile_app/blob/main/App.tsx) (App shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_app_entry["App shell<br/>[App.tsx]"]
  node_navigation["Navigation routes<br/>[routes.ts]"]
end

subgraph group_money["Money and identity"]
  node_auth_ui["Login and registration<br/>[Login.tsx]"]
  node_auth_state["Authentication state<br/>[AuthContext.tsx]"]
  node_money_screens["Balance and transfers<br/>[Send.tsx]"]
  node_deposit["Deposits<br/>[useDepositOrder.ts]"]
  node_withdraw["Withdrawals<br/>[useWithdrawForm.ts]"]
end

subgraph group_markets["Markets and commerce"]
  node_p2p["P2P marketplace"]
  node_savings_markets["Savings and markets<br/>[Savings.tsx]"]
  node_store["Store and top-ups<br/>[Store.tsx]"]
  node_miniapps["Mini-apps"]
end

subgraph group_wallet["Self-custody wallet"]
  node_wallet_ui["Wallet screens<br/>[WalletHome.tsx]"]
  node_wallet_core["Wallet keys and chains<br/>[index.ts]"]
  node_rpc_router["RPC routing<br/>[rpcRouter.ts]"]
end

subgraph group_platform["Shared platform"]
  node_api_client["HTTP API client<br/>[client.ts]"]
  node_api_contracts["API modules and types<br/>[userApi.ts]"]
  node_query_layer["Server-state queries<br/>[queryClient.ts]"]
  node_localization["Localization<br/>[index.ts]"]
  node_push["Push notifications<br/>[index.ts]"]
  node_native_storage["Native secure storage"]
end

node_person(("App user"))
node_backend["QvaPay API"]
node_blockchains["Blockchain networks"]

node_person -->|"opens"| node_app_entry
node_app_entry -->|"routes through"| node_navigation
node_person -->|"signs in"| node_auth_ui
node_auth_ui -.->|"updates session"| node_auth_state
node_auth_state -->|"sets token"| node_api_client
node_auth_state -->|"uses auth and user APIs"| node_api_contracts
node_money_screens -.->|"requests money operations"| node_api_client
node_deposit -->|"submits deposit flow"| node_api_client
node_withdraw -->|"loads payment methods"| node_api_contracts
node_p2p -->|"trades and chats"| node_backend
node_savings_markets -->|"loads market data"| node_backend
node_store -->|"places purchases"| node_backend
node_miniapps -->|"uses catalog API"| node_api_contracts
node_wallet_ui -->|"signs locally"| node_wallet_core
node_wallet_core -->|"routes chain requests"| node_rpc_router
node_rpc_router -->|"connects to networks"| node_blockchains
node_wallet_ui -->|"uses account features"| node_backend
node_api_contracts -->|"sends requests"| node_api_client
node_api_client -->|"calls endpoints"| node_backend
node_query_layer -->|"unwraps API results"| node_api_contracts
node_query_layer -->|"persists cache"| node_native_storage
node_app_entry -->|"provides offline cache"| node_query_layer
node_auth_state -->|"unregisters on logout"| node_push
node_push -->|"uses authenticated client"| node_api_client
node_api_client -->|"sets language header"| node_localization

click node_app_entry "https://github.com/qvapay/mobile_app/blob/main/App.tsx"
click node_navigation "https://github.com/qvapay/mobile_app/blob/main/routes.ts"
click node_auth_ui "https://github.com/qvapay/mobile_app/blob/main/auth/screens/Login.tsx"
click node_auth_state "https://github.com/qvapay/mobile_app/blob/main/auth/AuthContext.tsx"
click node_money_screens "https://github.com/qvapay/mobile_app/blob/main/screens/transaction/Send.tsx"
click node_deposit "https://github.com/qvapay/mobile_app/blob/main/screens/add/useDepositOrder.ts"
click node_withdraw "https://github.com/qvapay/mobile_app/blob/main/screens/withdraw/useWithdrawForm.ts"
click node_p2p "https://github.com/qvapay/mobile_app/blob/main/screens/p2p/useP2POfferDetail.ts"
click node_savings_markets "https://github.com/qvapay/mobile_app/blob/main/screens/crypto/Savings.tsx"
click node_store "https://github.com/qvapay/mobile_app/blob/main/screens/store/Store.tsx"
click node_miniapps "https://github.com/qvapay/mobile_app/blob/main/screens/miniapps/useMiniAppBridge.ts"
click node_wallet_ui "https://github.com/qvapay/mobile_app/blob/main/screens/crypto/wallet/WalletHome.tsx"
click node_wallet_core "https://github.com/qvapay/mobile_app/blob/main/wallet/chains/index.ts"
click node_rpc_router "https://github.com/qvapay/mobile_app/blob/main/wallet/registry/rpcRouter.ts"
click node_api_client "https://github.com/qvapay/mobile_app/blob/main/api/client.ts"
click node_api_contracts "https://github.com/qvapay/mobile_app/blob/main/api/userApi.ts"
click node_query_layer "https://github.com/qvapay/mobile_app/blob/main/api/queryClient.ts"
click node_localization "https://github.com/qvapay/mobile_app/blob/main/i18n/index.ts"
click node_push "https://github.com/qvapay/mobile_app/blob/main/push/index.ts"
click node_native_storage "https://github.com/qvapay/mobile_app/blob/main/android/app/src/main/java/com/qvapay/bridge/SharedStorageModule.kt"

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_app_entry,node_navigation,node_person toneBlue
class node_auth_ui,node_auth_state,node_money_screens,node_deposit,node_withdraw toneAmber
class node_p2p,node_savings_markets,node_store,node_miniapps,node_backend toneMint
class node_wallet_ui,node_wallet_core,node_rpc_router toneRose
class node_api_client,node_api_contracts,node_query_layer,node_localization,node_push,node_native_storage,node_blockchains toneIndigo
```

## Components

### App experience

- [App shell](https://github.com/qvapay/mobile_app/blob/main/App.tsx): `App.tsx`
- [Navigation routes](https://github.com/qvapay/mobile_app/blob/main/routes.ts): `routes.ts`

### Money and identity

- [Login and registration](https://github.com/qvapay/mobile_app/blob/main/auth/screens/Login.tsx): `auth/screens/Login.tsx`
- [Authentication state](https://github.com/qvapay/mobile_app/blob/main/auth/AuthContext.tsx): `auth/AuthContext.tsx`
- [Balance and transfers](https://github.com/qvapay/mobile_app/blob/main/screens/transaction/Send.tsx): `screens/transaction/Send.tsx`
- [Deposits](https://github.com/qvapay/mobile_app/blob/main/screens/add/useDepositOrder.ts): `screens/add/useDepositOrder.ts`
- [Withdrawals](https://github.com/qvapay/mobile_app/blob/main/screens/withdraw/useWithdrawForm.ts): `screens/withdraw/useWithdrawForm.ts`

### Markets and commerce

- [P2P marketplace](https://github.com/qvapay/mobile_app/blob/main/screens/p2p/useP2POfferDetail.ts): `screens/p2p/useP2POfferDetail.ts`
- [Savings and markets](https://github.com/qvapay/mobile_app/blob/main/screens/crypto/Savings.tsx): `screens/crypto/Savings.tsx`
- [Store and top-ups](https://github.com/qvapay/mobile_app/blob/main/screens/store/Store.tsx): `screens/store/Store.tsx`
- [Mini-apps](https://github.com/qvapay/mobile_app/blob/main/screens/miniapps/useMiniAppBridge.ts): `screens/miniapps/useMiniAppBridge.ts`

### Self-custody wallet

- [Wallet screens](https://github.com/qvapay/mobile_app/blob/main/screens/crypto/wallet/WalletHome.tsx): `screens/crypto/wallet/WalletHome.tsx`
- [Wallet keys and chains](https://github.com/qvapay/mobile_app/blob/main/wallet/chains/index.ts): `wallet/chains/index.ts`
- [RPC routing](https://github.com/qvapay/mobile_app/blob/main/wallet/registry/rpcRouter.ts): `wallet/registry/rpcRouter.ts`

### Shared platform

- [HTTP API client](https://github.com/qvapay/mobile_app/blob/main/api/client.ts): `api/client.ts`
- [API modules and types](https://github.com/qvapay/mobile_app/blob/main/api/userApi.ts): `api/userApi.ts`
- [Server-state queries](https://github.com/qvapay/mobile_app/blob/main/api/queryClient.ts): `api/queryClient.ts`
- [Localization](https://github.com/qvapay/mobile_app/blob/main/i18n/index.ts): `i18n/index.ts`
- [Push notifications](https://github.com/qvapay/mobile_app/blob/main/push/index.ts): `push/index.ts`
- [Native secure storage](https://github.com/qvapay/mobile_app/blob/main/android/app/src/main/java/com/qvapay/bridge/SharedStorageModule.kt): `android/app/src/main/java/com/qvapay/bridge/SharedStorageModule.kt`

### Other components

- **App user**
- **QvaPay API**
- **Blockchain networks**

## Connections

- App user → App shell: opens (evidence: `README.md`)
- App shell → Navigation routes: routes through (evidence: `routes.ts`)
- App user → Login and registration: signs in (evidence: `README.md`)
- Login and registration → Authentication state: updates session
- Authentication state → HTTP API client: sets token
- Authentication state → API modules and types: uses auth and user APIs
- Balance and transfers → HTTP API client: requests money operations
- Deposits → HTTP API client: submits deposit flow (evidence: `screens/add/useDepositOrder.ts`)
- Withdrawals → API modules and types: loads payment methods
- P2P marketplace → QvaPay API: trades and chats (evidence: `README.md`)
- Savings and markets → QvaPay API: loads market data (evidence: `README.md`)
- Store and top-ups → QvaPay API: places purchases (evidence: `README.md`)
- Mini-apps → API modules and types: uses catalog API (evidence: `screens/miniapps/useMiniAppBridge.ts`)
- Wallet screens → Wallet keys and chains: signs locally (evidence: `README.md`)
- Wallet keys and chains → RPC routing: routes chain requests (evidence: `README.md`)
- RPC routing → Blockchain networks: connects to networks (evidence: `README.md`)
- Wallet screens → QvaPay API: uses account features (evidence: `README.md`)
- API modules and types → HTTP API client: sends requests (evidence: `api/userApi.ts`)
- HTTP API client → QvaPay API: calls endpoints (evidence: `api/client.ts`)
- Server-state queries → API modules and types: unwraps API results
- Server-state queries → Native secure storage: persists cache (evidence: `api/queryClient.ts`)
- App shell → Server-state queries: provides offline cache (evidence: `README.md`)
- Authentication state → Push notifications: unregisters on logout
- Push notifications → HTTP API client: uses authenticated client (evidence: `push/index.ts`)
- HTTP API client → Localization: sets language header (evidence: `api/client.ts`)
