How wako1203/earthcare works
Main Components
• React Native Core: The application bootstraps using React Native (with Metro as the bundler). Represent the “React Native App Runtime” as a core component encapsulating JavaScript execution.
• Application Source Code:
– "src" Directory: Contains key business logic, UI components, screens, navigation, state management, and API integrations.
– Sub-components include:
• Components – reusable UI parts like BottomSheet, Map components (MapBox, MapGoogle) and others.
• Screens – distinct views such as LoginScreen, HomeScreen, ProfileScreen, and additional screens under subdirectories.
• Navigation – files managing routing (AppNavigation, BottomTabs) that structure how the user moves between screens.
• Context & Hooks – “LoadingContext” and “UserContext” for managing global states and user authentication (e.g., userAuth hook).
• API Integrations – custom modules like "firebaseAPI" and "googleMapAPI" which provide connectivity to external services.
• Configuration and Environment:
– Environment files (.env), configuration files (e.g., .eslintrc.js, .prettierrc.js, tsconfig.json) and build/deployment scripts (android/build.gradle, ios/Podfile, etc.) that set up and guide the app’s behavior across environments (development, staging, production).
Relationships and Interactions
• Flow from Native to JavaScript: Illustrate how the native layer initializes the Metro bundler and launches the React Native runtime.
• Data Flow within the JavaScript Layer: Show a clear data flow where user interactions in UI components trigger events captured via context and hooks, leading to API calls and then resolution/updating of the UI.
• API Communication: Highlight the connections between the “src/api” modules (firebaseAPI, googleMapAPI) and external services (Firebase, Google Maps).
• Navigation and State: Represent how the navigation system routes between different “screens” and how global contexts (UserContext & LoadingContext) underpin state management across components.
Architectural Patterns & Design Principles
• Separation of Concerns: Distinguish clear boundaries between UI (components/screens), business logic (contexts/hooks), and external communication (api modules).
• Modularity: Emphasize that different screens and components likely follow a cohesive modular organization that improves maintainability.
• Cross-Platform Pattern: Represent that the shared JavaScript code handles business logic and UI consistently across both mobile platforms, while the native folders manage platform-specific requirements.
Relevant Technologies and Frameworks
• React Native as the core framework.
• Metro bundler for JavaScript bundling.
• Testing framework indicated by __tests__ directory (likely using Jest).
• Native build tools: Gradle (Android) and Xcode (iOS).
• External library or API integration for Firebase and Google Maps.