# janis-commerce/ui-native architecture

> Architecture diagram of the GitHub repository janis-commerce/ui-native, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/janis-commerce/ui-native
- Repository: https://github.com/janis-commerce/ui-native

## Overview

##### Main Components Identification
- Core UI Library:
- The core source code lives in the “src” directory. It holds a structured component hierarchy with “atoms”, “molecules”, and “organisms”.
- Components include basic elements like BaseButton, BaseInput, etc., along with more composite elements (e.g., Avatar, Button, Carousel).
- Storybook:
- The “storybook” directory along with the “.storybook” configuration represents the demo, testing, and development environment for the UI components.
- Platform-Specific Configurations:
- The “android” and “ios” directories contain native project configuration files required for integrating these UI components with mobile projects.
- Build, Linting, and CI/CD Tools:
- Configuration for ESLint, Prettier, Babel, and Husky (git hooks) are included.
- GitHub workflows under “.github/workflows” (such as build-status, coverage-status, npm-publish, publish-docs) show the CI/CD pipeline used for building, testing, publishing, and documentation.
- Additional Configurations:
- Files like “tsconfig.json”, “babel.config.js” and other tool-specific config files indicate the build and type-checking process.
- External Dependencies and Installation Requirements:
- The README highlights required dependency versions of React and React Native. It also provides instructions for additional native dependencies (e.g., react-native-reanimated) and configuration in “android/app/build.gradle”.

##### Key Architectural Patterns & Design Principles
- Component-Based Architecture:
- Separation of concerns (atoms, molecules, and organisms) which adheres to the principles of reusability and modularity.
- Build & Deployment Pipeline:
- How build scripts, linting, and GitHub actions integrate into the project’s lifecycle.
- Platform Abstraction:
- How native configurations for Android and iOS are kept separate while still interacting with the common UI library.

##### Detailed Steps for the Principal Software Engineer
- Create additional branch nodes for Storybook (demo/testing) and for CI/CD/build tools, indicating the use of GitHub workflows and various configuration files.
- External dependencies and note installation/configuration requirements as described in the README.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core UI Library and its Components
    subgraph "Core UI Library"
        CoreUI["Core UI Library"]:::ui
        Atoms["Atoms (Basic Components)"]:::ui
        Molecules["Molecules (Composite Components)"]:::ui
        Organisms["Organisms (Complex Components)"]:::ui
    end

    %% Storybook Environment
    CoreUI -->|"demo"| Storybook["Storybook (Demo & Testing)"]:::ui
    Storybook -->|"config"| StorybookConfig["Storybook Config (.storybook)"]:::ui

    %% Native Platform Integrations
    CoreUI -->|"native"| Android["Android Platform Configurations"]:::platform
    Android --> AndroidGradle["Android Gradle Config"]:::platform
    CoreUI -->|"native"| iOS["iOS Platform Configurations"]:::platform

    %% Tooling & CI/CD Infrastructure
    CoreUI -->|"build"| Workflows
    subgraph "Tooling & CI/CD Tools"
        Workflows["GitHub Workflows"]:::tooling
        ESLint["ESLint Config"]:::tooling
        Prettier["Prettier Config"]:::tooling
        Babel["Babel Config"]:::tooling
        Babelrc["Babelrc Config"]:::tooling
        TSConfig["TSConfig"]:::tooling
        TSConfigBuild["TSConfig Build"]:::tooling
        TSConfigAliases["TSConfig Aliases"]:::tooling
    end
    Workflows --> ESLint
    ESLint --> Prettier
    Prettier --> Babel
    Babel --> Babelrc
    Babelrc --> TSConfig
    TSConfig --> TSConfigBuild
    TSConfigBuild --> TSConfigAliases

    %% External Dependencies Integration
    CoreUI -->|"integrates"| ExternalDependencies["External Dependencies (Native Modules)"]:::external

    %% Click Events
    click CoreUI "https://github.com/janis-commerce/ui-native/tree/master/src"
    click Atoms "https://github.com/janis-commerce/ui-native/tree/master/src/components/atoms"
    click Molecules "https://github.com/janis-commerce/ui-native/tree/master/src/components/molecules"
    click Organisms "https://github.com/janis-commerce/ui-native/tree/master/src/components/organisms"
    click Storybook "https://github.com/janis-commerce/ui-native/tree/master/storybook"
    click StorybookConfig "https://github.com/janis-commerce/ui-native/blob/master/.storybook"
    click Android "https://github.com/janis-commerce/ui-native/tree/master/android"
    click AndroidGradle "https://github.com/janis-commerce/ui-native/blob/master/android/app/build.gradle"
    click iOS "https://github.com/janis-commerce/ui-native/tree/master/ios"
    click Workflows "https://github.com/janis-commerce/ui-native/tree/master/.github/workflows"
    click ESLint "https://github.com/janis-commerce/ui-native/blob/master/.eslintrc.js"
    click Prettier "https://github.com/janis-commerce/ui-native/blob/master/.prettierrc.js"
    click Babel "https://github.com/janis-commerce/ui-native/blob/master/babel.config.js"
    click Babelrc "https://github.com/janis-commerce/ui-native/blob/master/.babelrc.json"
    click TSConfig "https://github.com/janis-commerce/ui-native/blob/master/tsconfig.json"
    click TSConfigBuild "https://github.com/janis-commerce/ui-native/blob/master/tsconfig.build.json"
    click TSConfigAliases "https://github.com/janis-commerce/ui-native/blob/master/tsconfig.aliases.json"
    click ExternalDependencies "https://github.com/janis-commerce/ui-native/blob/master/react-native.config.js"

    %% Styling Classes
    classDef ui fill:#a0c4ff,stroke:#000,stroke-width:2px;
    classDef platform fill:#ffadad,stroke:#000,stroke-width:2px;
    classDef tooling fill:#caffbf,stroke:#000,stroke-width:2px;
    classDef external fill:#ffd6a5,stroke:#000,stroke-width:2px;
```
