# department-of-veterans-affairs/va-mobile-app architecture

> Architecture diagram of the GitHub repository department-of-veterans-affairs/va-mobile-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/department-of-veterans-affairs/va-mobile-app
- Repository: https://github.com/department-of-veterans-affairs/va-mobile-app

## Overview

##### Main Architecture Components

a. Frontend Layer:
- React Native Mobile App (iOS & Android)
- Redux Store for state management
- Component Library
- Authentication System
- Navigation System

b. Backend Integration Layer:
- API Client Services
- Authentication/OAuth Services
- Push Notification Services
- Remote Configuration
- Analytics Services

c. External Services:
- VA Backend Services
- Firebase Services
- App Store/Play Store Services

##### Key Architectural Patterns to Highlight

a. Feature Modules:
- Health Services
- Benefits Services
- Payments
- Profile Management
- Secure Messaging
- Appointments
- Claims & Appeals

b. Core Infrastructure:
- Authentication & Authorization
- Error Handling
- Analytics
- Accessibility
- Internationalization

**[Mobile Clients (iOS/Android)]**
- ↓
**[React Native Layer]**
- ↓
**[Core Services Layer]**
- ↙     ↓     ↘
**[Auth] [API] [Storage]**
- ↘     ↓     ↙
**[VA Backend Services]**

**[Navigation Container]**
- ↓
**[Screen Components]**
- ↓
**[Shared Components]**
- ↓
**[Redux Store]**
- ↓
**[API Clients]**

**[Feature Module]**
- ↙     ↓     ↘
**[Screens] [Components] [State]**
- ↘     ↓     ↙
**[Shared Services]**

##### Important Elements

- User-facing components (blue)
- Business logic (green)
- Data services (yellow)
- External integrations (gray)

- Clear data flow indicators showing:
- User interactions
- API calls
- State updates
- Push notifications
- Authentication flows

##### Specific Implementation Details

- Redux store structure with main slices:
- Auth
- Settings
- Error handling
- Analytics
- Feature-specific states

- Security components:
- Biometric authentication
- Secure storage
- API security

##### Integration Points

- VA Backend Services
- Push Notification Services
- Analytics Services
- Remote Config
- App Store Services

##### Development pipeline

This will provide a complete picture of the system while maintaining clarity and usefulness for the development team.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Mobile_Clients
        iOS["iOS Client"]
        Android["Android Client"]
    end

    subgraph React_Native_Layer
        App["Main App"]:::core
        Nav["Navigation System"]:::core
        CompLib["Component Library"]:::core
    end

    subgraph State_Management
        Redux["Redux Store"]:::state
        AuthSlice["Auth Slice"]:::state
        APISlice["API Slice"]:::state
    end

    subgraph Feature_Modules
        Health["Health Services"]:::feature
        Benefits["Benefits Services"]:::feature
        Payments["Payments"]:::feature
        Profile["Profile Management"]:::feature
        Messaging["Secure Messaging"]:::feature
        Appointments["Appointments"]:::feature
        Claims["Claims & Appeals"]:::feature
    end

    subgraph Core_Infrastructure
        Auth["Authentication"]:::infra
        Analytics["Analytics"]:::infra
        RemoteConfig["Remote Config"]:::infra
        PushNotif["Push Notifications"]:::infra
        I18n["Internationalization"]:::infra
        A11y["Accessibility"]:::infra
    end

    subgraph External_Services
        VABackend["VA Backend Services"]:::external
        Firebase["Firebase Services"]:::external
        AppStores["App Stores"]:::external
    end

    iOS & Android --> App
    App --> Nav
    App --> CompLib
    App --> Redux
    
    Redux --> AuthSlice & APISlice
    
    Nav --> Feature_Modules
    CompLib --> Feature_Modules
    
    Feature_Modules --> Core_Infrastructure
    Core_Infrastructure --> External_Services

    %% Click Events
    click App "https://github.com/department-of-veterans-affairs/va-mobile-app/blob/develop/VAMobile/src/App.tsx"
    click Nav "https://github.com/department-of-veterans-affairs/va-mobile-app/blob/develop/VAMobile/src/screens/index.ts"
    click Redux "https://github.com/department-of-veterans-affairs/va-mobile-app/blob/develop/VAMobile/src/store/index.ts"
    click AuthSlice "https://github.com/department-of-veterans-affairs/va-mobile-app/blob/develop/VAMobile/src/store/slices/authSlice.ts"
    click CompLib "https://github.com/department-of-veterans-affairs/va-mobile-app/tree/develop/VAMobile/src/components/"
    click Health "https://github.com/department-of-veterans-affairs/va-mobile-app/tree/develop/VAMobile/src/screens/HealthScreen/"
    click Benefits "https://github.com/department-of-veterans-affairs/va-mobile-app/tree/develop/VAMobile/src/screens/BenefitsScreen/"
    click Payments "https://github.com/department-of-veterans-affairs/va-mobile-app/tree/develop/VAMobile/src/screens/PaymentsScreen/"
    click Profile "https://github.com/department-of-veterans-affairs/va-mobile-app/tree/develop/VAMobile/src/screens/HomeScreen/ProfileScreen/"
    click Messaging "https://github.com/department-of-veterans-affairs/va-mobile-app/tree/develop/VAMobile/src/screens/HealthScreen/SecureMessaging/"
    click Appointments "https://github.com/department-of-veterans-affairs/va-mobile-app/tree/develop/VAMobile/src/screens/HealthScreen/Appointments/"
    click Claims "https://github.com/department-of-veterans-affairs/va-mobile-app/tree/develop/VAMobile/src/screens/BenefitsScreen/ClaimsScreen/"
    click Auth "https://github.com/department-of-veterans-affairs/va-mobile-app/tree/develop/VAMobile/src/screens/auth/"
    click Analytics "https://github.com/department-of-veterans-affairs/va-mobile-app/blob/develop/VAMobile/src/utils/analytics.ts"
    click RemoteConfig "https://github.com/department-of-veterans-affairs/va-mobile-app/blob/develop/VAMobile/src/utils/remoteConfig.ts"
    click PushNotif "https://github.com/department-of-veterans-affairs/va-mobile-app/blob/develop/VAMobile/src/utils/notifications.tsx"
    click I18n "https://github.com/department-of-veterans-affairs/va-mobile-app/tree/develop/VAMobile/src/translations/"
    click A11y "https://github.com/department-of-veterans-affairs/va-mobile-app/blob/develop/VAMobile/src/utils/accessibility.tsx"

    %% Styling
    classDef core fill:#2374ab
    classDef state fill:#57a773
    classDef feature fill:#4ba3c3
    classDef infra fill:#ffc857
    classDef external fill:#808080
    
    %% Legend
    subgraph Legend
        CoreComp["Core Components"]:::core
        StateComp["State Management"]:::state
        FeatureComp["Feature Modules"]:::feature
        InfraComp["Infrastructure"]:::infra
        ExtComp["External Services"]:::external
    end
```
