How covidshield/mobile works
Main Components
• Native Platforms: Represent both Android and iOS. Indicate that each platform has its own native code base (found in the “android” and “ios” directories) to handle platform-specific implementations, integrations, and asset management.
• React Native Bridge: Highlight the bridging layer that connects the React Native JS code (in “src/bridge” and related files) with the native modules, such as the Exposure Notification and Push Notification modules.
• UI/Presentation Layer: Include the user interface components, screens, and navigation views. Use the “src/screens”, “src/components”, and “src/navigation” directories to illustrate this layer. Also note localization support in “src/locale” and theming in “src/shared/theme”.
• Services and Business Logic Layer: Identify services like “BackendService”, “ExposureNotificationService”, “StorageService”, “BackgroundSchedulerService”, and the test mode components. These encapsulate data fetching, storage, scheduling, and coordination of exposure notifications.
• Assets and Design Resources: Reference the “design” folder for animations, illustrations, and other design assets. Also include localization/translations and theme assets.
• External Integrations: Mark the integration points for Apple/Google Exposure Notification APIs and mention test mode functionality that simulates or overrides real exposures.
Relationships and Interactions
• Bidirectional interaction between the React Native bridge and native modules (found under “android/app/src/main/java/app/covidshield” and the iOS project structure) to demonstrate how notifications and system events are propagated.
• Separation between the presentation logic (React Native components) and backend communication, including the asynchronous data flow from backend endpoints.
• Workflows like the Test Mode flow, where tapping on UI elements accesses the test menu, bypassing some API checks.
Architectural Patterns
• Layered Architecture: Emphasize clear separations between native (platform-specific), bridging, UI, and services layers.
• Modular Design: Note that the project uses a modular approach where each service (Backend, Exposure Notification, Storage, etc.) is separated by its own directory under “src/services”. This facilitates testing and potential future enhancements.
• Separation of Concerns: The design distinguishes between UI (in “src/screens” and “src/components”), business logic (services), and bridging/native integrations.
• Dependency Injection/Providers: Mention usage of provider patterns seen in files like StorageServiceProvider.tsx and ExposureNotificationServiceProvider.tsx to supply services throughout the React component tree.
Relevant Technologies and Frameworks
• React Native for cross-platform mobile development.
• JavaScript/TypeScript in the “src” directory for the main application logic.
• Native Android (Java/Kotlin) and iOS (Objective-C/Swift) modules to integrate with key platform-specific Exposure Notification APIs.
• External libraries such as react-native-config, for environment configuration, and others indicated by configurations (e.g., Babel, Metro, ESLint, Prettier).
• Build and dependency management tools like Yarn, Cocoapods, and Gradle.
Final Touches
• Provide notes for any non-obvious interactions (for example, explaining that test mode toggles allow bypassing of real exposure notifications for development purposes).