How lockerpm/mobile works
Main Components
• Mobile Frontend (React Native Application): This covers the entire “app” folder where your UI components, screens, navigators (e.g., MainTabNavigator, RootNavigator), and state management models reside.
• Platform-Specific Layers: Separate subcomponents for Android (android folder) and iOS (ios folder). These include native configuration, build scripts, and native implementations for services like Autofill, push notifications, and Firebase integration.
• Core/Business Logic: The “core” directory contains abstractions, service implementations, domain models, importers, and utility functions. This layer encapsulates the business logic, encryption, API handling, and shared functionality across platforms.
• Services & API: Under both “app/services/api” and “core/services”, you have modules that communicate with the external Backend Server. This includes authentication, file upload, messaging, and more.
• External Dependencies: Highlight connections to third-party systems such as the Backend server (which must be set up per README instructions), Firebase (via GoogleService-Info.plist and google-services.json), and other libraries (e.g., push notifications, crypto libraries).
Relationships and Interactions
• How the presentation layer (React Native “app” components and screens) interacts with the business logic (models and services) to fetch, store, and update data.
– Data flow from UI components to the business logic (state stores like CipherStore, FolderStore, etc.).
– API requests going from the “services/api” layer to the external backend.
– Communication between the core services (in “core/services”) and platform-specific native functionalities (Android and iOS code for autofill, push notifications).
• That the mobile app’s configuration (using files in app/config and environment variables) instructs the endpoints and external service settings.
Architectural Patterns and Design Principles
• Layered Architecture: Present separate layers for UI, domain/business logic, integration services, and native implementations.
• Separation of Concerns: Emphasize that individual modules (e.g., components, screens, navigation in “app”, core abstractions in “core”, and API integrations) handle isolated responsibilities.
• Cross-platform Strategy: Point out that most of the business logic is shared and written in JavaScript/TypeScript, while Android and iOS have dedicated directories for platform-specific code.
• Extensibility: Note the “selfhost” folder that hints at customization of assets and branding following the guide in the README.
Relevant Technologies, Frameworks, and Libraries
• React Native (for the UI layer)
• Native build tools (Android Studio/Gradle for Android, Xcode for iOS)
• Firebase integration and push notification services
• Possibly MobX or another state management system (as suggested by “models/RootStore” and other store files)
• Core crypto services and multi-platform utilities found in “core/utils” and “core/abstractions”
Putting It All Together
– At the top, show the Mobile Application as the entry point.
– Next, split into two parallel flows: one for the cross-platform React Native components (UI and shared business logic) and one for platform-specific modules.
– At the bottom, show the external Backend and cloud services, which receive API requests from the mobile services.
– The “app” folder is broken down into UI and navigational components.
– The “core” folder is highlighted as providing abstractions and domain logic utilized by both the UI and native layers.
• Lastly, include configuration flows (e.g., environment setup using file “app/config/.env”) that customize how the application connects to external services.