# burhanyilmaz/womob architecture

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

- Interactive diagram: https://gitdiagram.com/burhanyilmaz/womob
- Repository: https://github.com/burhanyilmaz/womob

## Overview

##### Main Components
- Mobile App Entry Point: Represent the App.tsx file as the starting point.
- UI Layer: Include folders like src/components (with specialized components for blog headers, sliders, posts, and common controls) and src/screens (with Blog and Welcome screens).
- Navigation: Highlight src/navigators (e.g., BlogNavigator, MainNavigator) that coordinate screen transitions using React Navigation.
- Data/Service Layer: Include src/services/Api.ts for integrating with the WordPress REST API.
- Utility & Hooks Layer: Include src/hooks (e.g., useDebounce, useLoadFonts) and src/utils for helper functions and data types.

##### Detail the Relationships and Interactions
- A flow from the App Entry Point (App.tsx) to the Navigation layer (BlogNavigator, MainNavigator), which routes users to various screens (Blog, Welcome, Post Detail, etc.).
- From the UI screens, indicate that they retrieve data via the API service (src/services/Api.ts) through asynchronous calls. This data is then stored/managed by MobX-State-Tree stores.
- The components layer (including BlogTabHeader, HomeSlider, etc.) should be depicted as building blocks that are used by screens and containers.
- Use of hooks to enhance component functionality such as font loading and debouncing user interactions.

##### Architectural Patterns and Principles
- Separation of concerns:
- Presentation Layer (UI components and screens)
- Navigation Layer (React Navigation-based navigators)
- Business Logic & State Management (MobX-State-Tree in src/store)
- Data Integration (WordPress REST API calls through src/services/Api.ts)
- Modular and reusable components approach, which is typical in React Native projects.
- That some post content may render web view content, so include an external/extracted “WebView” component (referenced in the README for handling iframe content).

##### Specific Technologies and Tools
- React Native (with Expo) forms the core platform.
- React and TypeScript power the UI and type safety.
- React Navigation structures the screen and tab navigating flows.
- MobX-State-Tree and MobX-React-Lite manage the application state.
- Nativewind and Tailwind CSS (via tailwind.config.js) are used for styling.
- Testing frameworks such as Jest and React Native Testing Library provide the testing layer.
- External build and configuration tools such as Babel, ESLint, Prettier, and Husky for commit hooks.

- On the next tier, layout “Navigators” (BlogNavigator, MainNavigator) directing airflow to two primary sectors:
- UI Screens (Blog, Welcome, PostDetailScreen, etc.) contained in the src/screens directory.
- Associated containers (like src/containers/Post.tsx) that serve as intermediaries between screens and business logic.
- Below the UI tier, have a layer for “State Management” showing the MobX-State-Tree stores (CategoryStore, PostStore, etc.) which are connected to the API module.
- Off to the side, add a “Service/Integration” module that illustrates the API service (src/services/Api.ts) interfacing with external WordPress REST API endpoints.
- Link “Utilities & Theming” to both the UI and business logic tiers indicating common helper functions (hooks, utils) and theme configuration that standardizes styling across components.
- Finally, include testing, configuration, and build tools as peripheral blocks to acknowledge their roles in ensuring code quality and maintainability.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["App Entry (App.tsx)"]:::ui
    B["Navigators (BlogNavigator, MainNavigator)"]:::nav
    C["UI Screens (Blog, Welcome, etc.)"]:::ui
    D["UI Components (BlogTabHeader, HomeSlider, Post, etc.)"]:::ui
    E["WebView Component (HtmlToNativeViewer)"]:::ui
    F["Containers (Post)"]:::ui
    G["State Management (MobX-State-Tree Stores)"]:::logic
    H["API Service (Api.ts)"]:::api
    I["Hooks (useDebounce, useLoadFonts)"]:::util
    J["Utils (data, helpers, BlogTypes)"]:::util

    subgraph "Theming & Styling"
        K1["Theme (src/theme)"]:::theme
        K2["Tailwind Config (tailwind.config.js)"]:::theme
        K3["Prettier Config (.prettierrc.js)"]:::theme
        K4["Babel Config (babel.config.js)"]:::theme
    end

    A -->|"routes"| B
    B -->|"directs"| C
    C -->|"delegates"| F
    C -->|"renders"| D
    D -->|"renders_iframe"| E
    C -->|"fetches"| H
    H -->|"populates"| G
    F -->|"updates"| G
    G -->|"updates"| D
    I -->|"enhances"| D
    J -->|"supports"| D
    K1 -->|"styles"| D
    K1 -->|"styles"| C

    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef nav fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef logic fill:#98FB98,stroke:#333,stroke-width:2px;
    classDef api fill:#FFA500,stroke:#333,stroke-width:2px;
    classDef util fill:#DDA0DD,stroke:#333,stroke-width:2px;
    classDef theme fill:#FFC0CB,stroke:#333,stroke-width:2px;

    click A "https://github.com/burhanyilmaz/womob/blob/main/App.tsx"
    click B "https://github.com/burhanyilmaz/womob/tree/main/src/navigators"
    click C "https://github.com/burhanyilmaz/womob/tree/main/src/screens"
    click D "https://github.com/burhanyilmaz/womob/tree/main/src/components"
    click E "https://github.com/burhanyilmaz/womob/blob/main/src/components/HtmlToNativeViewer.tsx"
    click F "https://github.com/burhanyilmaz/womob/blob/main/src/containers/Post.tsx"
    click G "https://github.com/burhanyilmaz/womob/tree/main/src/store"
    click H "https://github.com/burhanyilmaz/womob/blob/main/src/services/Api.ts"
    click I "https://github.com/burhanyilmaz/womob/tree/main/src/hooks"
    click J "https://github.com/burhanyilmaz/womob/tree/main/src/utils"
    click K1 "https://github.com/burhanyilmaz/womob/tree/main/src/theme"
    click K2 "https://github.com/burhanyilmaz/womob/blob/main/tailwind.config.js"
    click K3 "https://github.com/burhanyilmaz/womob/blob/main/.prettierrc.js"
    click K4 "https://github.com/burhanyilmaz/womob/blob/main/babel.config.js"
```
