How wataru-maeda/react-native-boilerplate works
Main Components
• Mobile/Web UI Layer:
• Screens and navigation hierarchy using Expo Router (note the file-based routing in the “app” and “pages” directories).
• Drawer navigation, tabs, stacks: show “Home”, “Profile”, and their nested screens (e.g., details, index, _layout files).
• Core Components/Modules:
• Global State Management: Highlight the Redux Toolkit slice(s) located in “slices” and their integration via the provider in “providers”. Emphasize how the Redux store (configured in “utils/store.ts”) feeds into the application.
• Theme Management: Include the “theme” directory and related hooks (e.g., “hooks/useColorScheme.ts”) for light/dark theming.
• Service Layer: Represent backend interaction and service logic from the “services” directory (e.g., user.service.ts). Even if these are minimal here, they’re meant to provide a gateway for external API calls.
• Component Library: Group reusable UI components (found under “components”), including common elements (Button, Image, BottomSheet, etc.) and layouts (NavigationHeader components and drawer/bottom sheet contents).
• Environment & Build Configurations:
• Environment variables and configurations (.env files, app.config.ts, app.json, and utils/config.ts) – these setup the app for both development and production environments.
• CI/CD and Testing: Illustrate how GitHub workflows (in .github/workflows), husky pre-commit hooks, ESLint, Prettier, and Jest tests integrate into the development lifecycle.
Relationships and Interactions
• Data flow from the UI layer (screens) that use the Redux store and components to manage state and maintain consistency across screens.
• Theme management hook and asset configuration to the UI components to reflect the dynamic theme support.
• That the service layer (e.g., “user.service.ts”) interacts with external APIs or backend systems, feeding data into the Redux store or directly into screens.
• Optionally, add the CI/CD and testing pipeline as an external but integral component that continuously validates the code quality and deployment readiness.
Architectural Patterns and Important Design Principles
• File-Based Routing: Emphasize how screens are organized by directory structure, corresponding to navigation stacks, tabs, and drawers.
• Separation of Concerns: Separate UI elements, state management, theming, and services into distinct modules.
• Reusability: Demonstrate how components are modular and reusable (grouping by “components/elements” and “components/layouts”).
• Environment-specific Configuration: Capturing dev vs. prod variables and secure handling of secrets.
• CI/CD: Automated testing, linting, and preview deployments are part of the development cycle.
Additional Notes
• At the top: Configuration and build environments (e.g., Environment Variables, CI/CD workflows).
• In the mid-layer: Core application modules (Navigation, State Management, Theme Management, and Service Layer).
• At the bottom: Detailed UI Components (reusable UI elements and layouts).
• Annotations or notes that mention key technologies and frameworks:
• Expo, React Native, Redux Toolkit, Expo Router, Jest, ESLint, Prettier.