# qunarcorp/qrn-remax-unir-demo architecture

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

- Interactive diagram: https://gitdiagram.com/qunarcorp/qrn-remax-unir-demo
- Repository: https://github.com/qunarcorp/qrn-remax-unir-demo

## Overview

##### Core Architecture Components

**Common Core**
- Source Code (src/)
- Pages
- Components
- App Configuration

##### Build & Configuration Layer

Build process flow with:
- Webpack Configuration (webpack.config.js)
- Babel Configuration (babel.config.js)
- Remax Configuration (remax.config.js)

##### Platform-Specific Outputs

**React Native/Expo → Mobile Apps**
**Web (App.web.js) → Browser**
**Remax → WeChat Mini Program**

##### Flow Representation

**Source Code → Build System → Platform-Specific Outputs**

##### Development Flow

A separate section showing the development workflow:
**yarn dev → RN/Web Development**
**yarn dev:wx → WeChat Mini Program Development**

##### Important Notes

- Unified nature of the codebase
- How the shared components are distributed to different platforms
- Where platform-specific code diverges
- Entry points for each platform (App.js, App.web.js, etc.)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Development
        DevRN["RN/Web Development<br>(yarn dev)"]
        DevWX["WeChat Development<br>(yarn dev:wx)"]
    end

    subgraph "Core Architecture"
        CoreSrc["Source Code"]:::core
        click CoreSrc "https://github.com/qunarcorp/qrn-remax-unir-demo/tree/demo/src/"
        Pages["Pages"]:::core
        click Pages "https://github.com/qunarcorp/qrn-remax-unir-demo/tree/demo/src/pages/"
        Components["Components"]:::core
        AppConfig["App Configuration"]:::core
        click AppConfig "https://github.com/qunarcorp/qrn-remax-unir-demo/blob/demo/src/app.config.js"
        GlobalStyle["Global Styling"]:::core
        click GlobalStyle "https://github.com/qunarcorp/qrn-remax-unir-demo/blob/demo/src/app.css"
    end

    subgraph "Build System"
        Webpack["Webpack Config"]:::build
        click Webpack "https://github.com/qunarcorp/qrn-remax-unir-demo/blob/demo/webpack.config.js"
        Babel["Babel Config"]:::build
        click Babel "https://github.com/qunarcorp/qrn-remax-unir-demo/blob/demo/babel.config.js"
        Remax["Remax Config"]:::build
        click Remax "https://github.com/qunarcorp/qrn-remax-unir-demo/blob/demo/remax.config.js"
    end

    subgraph "Platform Entry Points"
        RNEntry["App.js<br>(React Native)"]:::rn
        click RNEntry "https://github.com/qunarcorp/qrn-remax-unir-demo/blob/demo/App.js"
        WebEntry["App.web.js<br>(Web)"]:::web
        click WebEntry "https://github.com/qunarcorp/qrn-remax-unir-demo/blob/demo/App.web.js"
        WXEntry["app.js<br>(WeChat)"]:::wx
        click WXEntry "https://github.com/qunarcorp/qrn-remax-unir-demo/blob/demo/src/app.js"
    end

    subgraph "Platform Configurations"
        ExpoConfig["app.json<br>(Expo Config)"]:::rn
        click ExpoConfig "https://github.com/qunarcorp/qrn-remax-unir-demo/blob/demo/app.json"
        WXConfig["mini.project.json<br>(WeChat Config)"]:::wx
        click WXConfig "https://github.com/qunarcorp/qrn-remax-unir-demo/blob/demo/mini.project.json"
        WXProjectConfig["project.config.json<br>(WeChat Project)"]:::wx
        click WXProjectConfig "https://github.com/qunarcorp/qrn-remax-unir-demo/blob/demo/project.config.json"
    end

    subgraph "Web Platform"
        WebHTML["index.html"]:::web
        click WebHTML "https://github.com/qunarcorp/qrn-remax-unir-demo/blob/demo/public/index.html"
    end

    subgraph "Home Page Components"
        HomePage["Home Page"]:::core
        click HomePage "https://github.com/qunarcorp/qrn-remax-unir-demo/blob/demo/src/pages/home/index.js"
        HomeAlert["Alert Component"]:::core
        click HomeAlert "https://github.com/qunarcorp/qrn-remax-unir-demo/blob/demo/src/pages/home/Alert.js"
        HomeApp["App Component"]:::core
        click HomeApp "https://github.com/qunarcorp/qrn-remax-unir-demo/blob/demo/src/pages/home/App.js"
    end

    CoreSrc --> Pages
    CoreSrc --> Components
    CoreSrc --> AppConfig
    CoreSrc --> GlobalStyle

    Pages --> HomePage
    HomePage --> HomeAlert
    HomePage --> HomeApp

    CoreSrc --> |Build| Webpack
    CoreSrc --> |Build| Babel
    CoreSrc --> |Build| Remax

    Webpack --> RNEntry
    Webpack --> WebEntry
    Remax --> WXEntry

    RNEntry --> ExpoConfig
    WXEntry --> WXConfig
    WXEntry --> WXProjectConfig
    WebEntry --> WebHTML

    DevRN --> |Development| RNEntry
    DevRN --> |Development| WebEntry
    DevWX --> |Development| WXEntry

    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef rn fill:#2ecc71,stroke:#27ae60,color:white
    classDef web fill:#e67e22,stroke:#d35400,color:white
    classDef wx fill:#e74c3c,stroke:#c0392b,color:white
    classDef build fill:#95a5a6,stroke:#7f8c8d,color:white

    subgraph Legend
        L1["Core Components"]:::core
        L2["React Native"]:::rn
        L3["Web Platform"]:::web
        L4["WeChat Platform"]:::wx
        L5["Build System"]:::build
    end
```
