# moon-sangho/rn_playground architecture

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

- Interactive diagram: https://gitdiagram.com/moon-sangho/rn_playground
- Repository: https://github.com/moon-sangho/rn_playground

## Overview

##### Main Components

a. Application Layer
- React Native Application Core
- App.tsx as the root component
- Atomic Design pattern implementation
- Navigation system (RootStackNavigator)

b. Component Architecture (Using Atomic Design)
- Atoms Layer (Basic UI components)
- Molecules Layer (Composite components)
- Organisms Layer (Complex UI sections)
- Templates Layer (Layout structures)
- Pages/Screens Layer (Full screens)

c. State Management
- Context API implementation
- AppContext for global state

d. Platform-Specific Implementations
- iOS Native Bridge
- Android Native Bridge

**[User Interface Layer]**
- ↓
**[Navigation Layer (RootStackNavigator)]**
- ↓
**[Component Hierarchy]**
- Templates
- ↓
- Organisms
- ↓
- Molecules
- ↓
- Atoms
- ↓
**[State Management Layer (Context API)]**
- ↓
**[Platform Bridge Layer]**
- iOS Native Modules
- Android Native Modules

##### Important Elements to Highlight

a. Core Features:
- Relationship between screens (navigators/RootStackNavigator.tsx)
- Atomic design pattern flow
- Demonstrate how components communicate with AppContext

b. Asset Management:
- Assets structure (animations and images)
- How they integrate with the components

c. Utility Layer:
- Utils folder connection to components
- Type definitions integration

##### Specific Implementation Details

- AlertModalScreen
- CarouselScreen
- ChartScreen
- PasswordSettingScreen
- RouletteScreen
- etc.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "User Interface Layer"
        UI[React Native UI]
        App["App Root Component"]
        click App "https://github.com/Moon-Sangho/RN_PlayGround/blob/main/src/App.tsx"
    end

    subgraph "Navigation Layer"
        Nav["RootStackNavigator"]
        click Nav "https://github.com/Moon-Sangho/RN_PlayGround/blob/main/src/screens/navigators/RootStackNavigator.tsx"
    end

    subgraph "Component Hierarchy"
        direction TB
        subgraph "Screens"
            Screens["Pages/Screens"]
            click Screens "https://github.com/Moon-Sangho/RN_PlayGround/tree/main/src/screens/"
        end

        subgraph "Templates"
            Templates["Template Components"]
            click Templates "https://github.com/Moon-Sangho/RN_PlayGround/tree/main/src/components/templates/"
        end

        subgraph "Organisms"
            Organisms["Complex UI Sections"]
            click Organisms "https://github.com/Moon-Sangho/RN_PlayGround/tree/main/src/components/organisms/"
        end

        subgraph "Molecules"
            Molecules["Composite Components"]
            click Molecules "https://github.com/Moon-Sangho/RN_PlayGround/tree/main/src/components/molecules/"
        end

        subgraph "Atoms"
            Atoms["Basic UI Components"]
            click Atoms "https://github.com/Moon-Sangho/RN_PlayGround/tree/main/src/components/atoms/"
        end
    end

    subgraph "State Management"
        Context["AppContext"]
        click Context "https://github.com/Moon-Sangho/RN_PlayGround/blob/main/src/contexts/AppContext.ts"
    end

    subgraph "Platform Bridge Layer"
        iOS["iOS Native Bridge"]
        Android["Android Native Bridge"]
        click iOS "https://github.com/Moon-Sangho/RN_PlayGround/blob/main/ios/RN_playground/AppDelegate.m"
        click Android "https://github.com/Moon-Sangho/RN_PlayGround/blob/main/android/app/src/main/java/com/rn_playground/MainActivity.java"
    end

    subgraph "Supporting Layers"
        Utils["Utility Functions"]
        Types["Type Definitions"]
        Theme["Theme/Styles"]
        click Utils "https://github.com/Moon-Sangho/RN_PlayGround/tree/main/src/utils/"
        click Types "https://github.com/Moon-Sangho/RN_PlayGround/tree/main/src/types/"
        click Theme "https://github.com/Moon-Sangho/RN_PlayGround/blob/main/src/styles/theme.ts"
    end

    subgraph "Assets"
        Animations["Animations"]
        Images["Images"]
        click Animations "https://github.com/Moon-Sangho/RN_PlayGround/tree/main/assets/animations/"
        click Images "https://github.com/Moon-Sangho/RN_PlayGround/tree/main/assets/images/"
    end

    subgraph "Configuration"
        TSConfig["TypeScript Config"]
        BabelConfig["Babel Config"]
        MetroConfig["Metro Config"]
        click TSConfig "https://github.com/Moon-Sangho/RN_PlayGround/blob/main/tsconfig.json"
        click BabelConfig "https://github.com/Moon-Sangho/RN_PlayGround/blob/main/babel.config.js"
        click MetroConfig "https://github.com/Moon-Sangho/RN_PlayGround/blob/main/metro.config.js"
    end

    UI --> App
    App --> Nav
    Nav --> Screens
    Screens --> Templates
    Templates --> Organisms
    Organisms --> Molecules
    Molecules --> Atoms
    
    Context --> App
    Context --> Screens
    
    App --> iOS
    App --> Android
    
    Utils --> Screens
    Types --> Screens
    Theme --> Screens
    
    Animations --> Screens
    Images --> Screens

    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef atomic fill:#4CAF50,stroke:#388E3C,color:white
    classDef nav fill:#FF9800,stroke:#F57C00,color:white
    classDef state fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef platform fill:#757575,stroke:#616161,color:white
    classDef support fill:#00BCD4,stroke:#0097A7,color:white
    classDef assets fill:#FFC107,stroke:#FFA000,color:white
    classDef config fill:#607D8B,stroke:#455A64,color:white

    class UI,App core
    class Screens,Templates,Organisms,Molecules,Atoms atomic
    class Nav nav
    class Context state
    class iOS,Android platform
    class Utils,Types,Theme support
    class Animations,Images assets
    class TSConfig,BabelConfig,MetroConfig config
```
