# marlonbelomarques/capturepoke architecture

> Architecture diagram of the GitHub repository marlonbelomarques/capturepoke, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/marlonbelomarques/capturepoke
- Repository: https://github.com/marlonbelomarques/capturepoke

## Overview

##### 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

## Diagram (Mermaid)

```mermaid
graph TD
  %% UI Layer
  subgraph "UI Layer"
    A1["App (Routes & Screens)"]:::ui
  end

  %% Feature Modules
  subgraph "Feature Modules"
    F1["PokemonList Module\n(Presentation, Data, Domain)"]:::feature
    F2["PokemonDetails Module\n(Presentation, Data, Domain)"]:::feature
  end

  %% Shared/Global Components
  subgraph "Shared/Global Services"
    G1["Global Components & Utilities"]:::global
  end

  %% Configuration & Build Scripts
  subgraph "Configuration & Build Scripts"
    C1["Babel Config"]:::config
    C2["Jest Config"]:::config
    C3["ESLint Config"]:::config
    C4["Package.json"]:::config
    C5["Reset Project Script"]:::config
  end

  %% Assets and Testing
  AS["Assets"]:::assets
  T1["Test Suite"]:::test

  %% Relationships between layers
  A1 -->|"navigatesTo"| F1
  A1 -->|"navigatesTo"| F2

  %% Shared global usage
  G1 -->|"providesUtilsTo"| A1
  G1 -->|"providesUtilsTo"| F1
  G1 -->|"providesUtilsTo"| F2

  %% Assets support
  AS -->|"supports"| G1
  AS -->|"usedBy"| A1
  AS -->|"usedBy"| F1
  AS -->|"usedBy"| F2

  %% Configuration influence
  C1 -->|"configures"| A1
  C2 -->|"configures"| F1
  C3 -->|"configures"| F2
  C4 -->|"definesDepsFor"| G1
  C5 -->|"resetsProjFor"| A1

  %% Testing relationships
  T1 -->|"tests"| A1
  T1 -->|"tests"| F1
  T1 -->|"tests"| F2
  T1 -->|"tests"| G1

  %% Click Events
  click A1 "https://github.com/marlonbelomarques/capturepoke/tree/master/app"
  click F1 "https://github.com/marlonbelomarques/capturepoke/tree/master/src/pokemonList"
  click F2 "https://github.com/marlonbelomarques/capturepoke/tree/master/src/pokemonDetails"
  click G1 "https://github.com/marlonbelomarques/capturepoke/tree/master/src/global"
  click AS "https://github.com/marlonbelomarques/capturepoke/tree/master/assets"
  click T1 "https://github.com/marlonbelomarques/capturepoke/tree/master/test"
  click C1 "https://github.com/marlonbelomarques/capturepoke/blob/master/babel.config.js"
  click C2 "https://github.com/marlonbelomarques/capturepoke/blob/master/jest.config.js"
  click C3 "https://github.com/marlonbelomarques/capturepoke/blob/master/.eslintrc.js"
  click C4 "https://github.com/marlonbelomarques/capturepoke/blob/master/package.json"
  click C5 "https://github.com/marlonbelomarques/capturepoke/blob/master/scripts/reset-project.js"

  %% Styles
  classDef ui fill:#fceabb,stroke:#d58512,stroke-width:2px;
  classDef feature fill:#dcedc1,stroke:#8bc34a,stroke-width:2px;
  classDef global fill:#cce5ff,stroke:#007bff,stroke-width:2px;
  classDef assets fill:#f8d7da,stroke:#dc3545,stroke-width:2px;
  classDef config fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;
  classDef test fill:#ffe0b2,stroke:#ff9800,stroke-width:2px;
```
