How marlonbelomarques/capturepoke works
Main Components
• App (Presentation/UI Layer):
• The top-level “app” directory contains key route-driven pages (e.g., +html.tsx, _layout.tsx, index.tsx, myPokemonList.tsx, pokemonDetails.tsx). These represent the screens the user interacts with.
• Feature Modules:
• In “src”, you have separate directories for feature functionality. For instance, “pokemonList” and “pokemonDetails” each contain their own components, view models, data interaction layers, and domain models. This clearly defines separate bounded contexts for each feature.
• Shared/Global Components & Utilities:
• Assets:
• The “assets” folder contains fonts and images, indicating support for styling and media.
• Tests:
• The “test” directory (with doubles, mocks, stubs, and feature-specific tests) indicates that testing is an integral part of the development strategy.
• Configuration & Tooling:
• Files like babel.config.js, jest.config.js, .eslintrc.js, and package.json indicate the setup for code quality, testing, and bundling. There's also a “scripts” folder with reset-project scripts for initialization tasks.
Relationships and Interactions
• User actions trigger navigation to specific pages.
• Pages (views) delegate logic to their respective ViewModels (e.g., PokemonListViewModel.tsx and PokemonDetailsViewModel.ts).
• Feature Modules internally separate concerns:
• Components within each module are connected to view models, which interact with domain models.
• Data subdirectories inside each feature (e.g., useRemotePokemonDetails, getMyPokemonList) describe how remote or local data are fetched and stored.
• The “src/global” section provides utilities and shared components that are consumed by both feature modules and pages.
• Testing components should be represented as separate modules that verify the behavior of UI, view models, and data layers using mocks, stubs, and fakers.
Architectural Patterns & Technologies
• File-based Routing:
• That the “app” directory utilizes file-based routing provided by Expo.
• Modular Design with Domain-Driven and MVVM-Like Patterns:
• Each feature looks like it follows a separation of concerns between UI (components), presentation (view models), data (remote/local fetching functions), and domain (business logic models).
• Expo/React-Native Ecosystem:
• Notable technologies include React, Expo, and potential integration with hooks for theming and data fetching.
• Testing Strategy:
• Presence of detailed test doubles illustrates a partially dependency-injected architecture suited for unit testing.
Emphasizing Detail
• How user interactions lead to routing in the “app” folder
• How individual feature modules work with local and remote data
• How shared utilities and themes enforce consistent styling and behavior
• The testing layer ensuring quality of both UI and data interactions