How mosip/inji-wallet works
• Mobile Application Frontend:
– Represent the core mobile client built with React Native and Expo.
– Include the primary UI elements (screens and components, e.g., AuthScreen, HomeScreen, Settings, etc.).
– Highlight the “components” and “screens” directories that make up the presentation layer.
• Business Logic & State Management:
– Capture the “machines” directory that contains state machines (for authentication, verifiable credential processes, backup/restore, QR login, etc.).
– Include shared modules such as “shared”, “lib” (with JSON-LD signatures for cryptographic operations), and utilities (keystore, crypto, telemetry).
• Platform-Specific Layers:
– Illustrate separate native code and configurations for Android (android folder) and iOS (ios folder).
– Explain how platform-specific build scripts, configuration files (e.g., gradle files, Xcode project files, Podfile), and native modules (e.g., RNWalletModule, RNOpenID4VPModule) integrate into the overall application.
• External Services & APIs:
– Mark the integration points with backend services using URLs defined in the .env configuration (e.g., Mimoto, ESignet, Telemetry endpoints).
– Show data flow from the mobile client to these external services, noting that they are consumed via network calls from shared API code in the “shared” directory.
• Testing & CI/CD:
– Include a component for the testing infrastructure “injitest” and indicate usage of mocks (__mocks__) and GitHub workflows.
– Show dependencies on continuous integration scripts for Android and iOS builds, as well as testing frameworks.
Relationships and Interactions
– From User Interactions (via various screens and UI components) to Business Logic managed by state machines.
– From state machines and shared service utilities to external API/backend services.
– From platform-specific modules to native hardware integrations (e.g., camera for QR scanning or biometric sensors).
• That the UI layer communicates with business logic/state machines (found in the “machines” directory) to handle events such as authentication, credential sharing, or scanning operations.
• Configuration and build management components (e.g., .env, app.config.ts, package.json) as “infrastructure” nodes that support both the development and CI/CD processes.
Important Architectural Patterns and Design Principles
• Separation of Concerns:
– The design clearly separates presentation (screens and UI components), business logic (state machines and shared utilities), and platform-specific integrations (Android, iOS native code).
• Modular Design:
– Each folder (components, screens, machines, shared, lib) represents a logical module.
• Layered Architecture:
– The highest layer (User Interface) sends events which are processed by intermediate layers (state machines, business logic) that then interact with lower-level services (cryptography, API calls, device hardware).
• Testability:
– Noting the dedicated “injitest” folder and extensive mocks, include a node that indicates automated testing and regression suites ensuring robustness.
Relevant Technologies and Frameworks
• React Native & Expo for building the mobile client.
• JavaScript/TypeScript for application logic (as seen by tsconfig and source files).
• Native Android (Gradle, Java) and iOS (Xcode, Swift/Objective-C) for platform-specific components.
• Integration with Flipper for debugging and testing workflows as indicated in configuration files.