How rocketchat/rocket.chat.reactnative works
And separate the major layers/components
a. User Interface (Presentation) Layer
• This includes the React Native components (found under the “app” directory in subfolders such as containers, views, and components), Storybook configuration for showcasing UI components (.storybook), i18n localization files (app/i18n), and theming.
b. Business Logic / State Management Layer
• The project makes extensive use of Redux (reducers, actions inside “app/actions” and “app/reducers”), sagas (under “app/sagas”), and also makes use of custom hooks (in app/lib/hooks).
• Centralized state store, asynchronous operations and event handling as “State Management & Business Logic.”
c. Services & Data Handling / API Communication
• Under app/lib and app/methods, you have API services, methods for sending messages, encryption utilities, database models/services and schemes.
• Components like “REST API & SDK,” “Encryption Module,” and “Database & Local Storage” (covering the models, schemas, and migrations).
d. Native Integrations
• The separate directories “android” and “ios” show that there are platform-specific codes and native integrations.
• Native modules, third‑party integrations (Crashlytics, Fabric, SSL pinning modules, etc.), and fastlane configurations.
• Components as “Android Native Code” and “iOS Native Code” with links to the React Native bridge if needed.
e. Testing & Quality Assurance
• The __mocks__ directory, e2e tests, CircleCI workflows (.circleci and .github/workflows) and jest configurations form the testing and CI/CD layer.
• This part as “Testing (Unit, E2E) & CI/CD.”
Connections and data flow
• That the business logic (reducers/sagas) call methods in the services layer to perform API calls, encryption, or file operations.
• That the services layer communicates with external Rocket.Chat servers (for message and user data) and the native layers when additional system-level functionality is needed.
• That testing suites and CI/CD pipelines are set up to validate changes across UI, business logic, and service layers.
Architectural Patterns & Frameworks
• Use of the Flux/Redux pattern across actions, reducers, and sagas.
• Modular organization of “containers” versus “components” which indicates separation of presentation and business logic.
• Areas where dependency injection and abstraction are applied (e.g., in lib/services and lib/methods), and how native modules integrate (bridging functionality between JavaScript and native code).
Technologies and Frameworks
• React Native as the main UI framework with storybook for demos.
• Redux for state management, with sagas handling asynchronous flows.
• Custom hooks (in lib/hooks) to encapsulate behaviors.
• Encryption tools and database interfaces for offline and local storage features.
• Native mobile modules written in Kotlin/Java (android) and Swift/Objective-C (ios).