# developer-sumit/react-native-lab architecture

> Architecture diagram of the GitHub repository developer-sumit/react-native-lab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/developer-sumit/react-native-lab
- Repository: https://github.com/developer-sumit/react-native-lab

## Overview

React Native Lab is an interactive CLI that gathers project choices, optionally installs Android prerequisites, invokes the React Native Community CLI, then customizes the generated project. Customization includes selectable blank/navigation templates, NativeWind, environment-variable options, optional hooks and console-log removal; the workflow can also initialize Git and add CI. The graph emphasizes the observed orchestration and calls. Template families and some optional capabilities are represented from the README/tree; their internal wiring was not fully sampled.

Main entry points: [`src/template.ts`](https://github.com/developer-sumit/react-native-lab/blob/main/src/template.ts) (Template Installer), [`index.ts`](https://github.com/developer-sumit/react-native-lab/blob/main/index.ts) (CLI Entry), [`src/react-native-lab.ts`](https://github.com/developer-sumit/react-native-lab/blob/main/src/react-native-lab.ts) (Project Orchestrator), [`src/prompts.ts`](https://github.com/developer-sumit/react-native-lab/blob/main/src/prompts.ts) (Setup Prompts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI Workflow"]
  node_entry["CLI Entry<br/>[index.ts]"]
  node_prompts["Setup Prompts<br/>[prompts.ts]"]
  node_retry["Retry Logic<br/>[retry.ts]"]
end

subgraph group_setup["Project Generation"]
  node_project["Project Orchestrator"]
  node_package["Package Manager<br/>[get-pkg-manager.ts]"]
  node_version["RN Versions"]
end

subgraph group_templates["Templates &amp; DX"]
  node_template["Template Installer<br/>[template.ts]"]
  node_templatefiles["Project Templates"]
  node_copy["File Copier<br/>[copy.ts]"]
  node_hooks["Custom Hooks<br/>[hooks.ts]"]
  node_styling["NativeWind Option"]
  node_env["Environment Config<br/>[template.ts]"]
  node_console["Console Removal<br/>[template.ts]"]
end

subgraph group_environment["Environment Setup"]
  node_install["Prerequisite Installer<br/>[install-scripts.ts]"]
  node_command["Command Detection<br/>[check-cmd.ts]"]
end

subgraph group_integrations["Project Integrations"]
  node_git["Git Initialization<br/>[git.ts]"]
  node_ci["CI Workflow Setup<br/>[ci.ts]"]
end

node_user(("CLI User"))
node_rncli["React Native CLI"]
node_android["Android Toolchain"]

node_user -->|"runs"| node_entry
node_entry -->|"collects choices"| node_prompts
node_prompts -->|"fetches versions"| node_version
node_prompts -->|"checks tools"| node_command
node_entry -->|"retries installs"| node_retry
node_entry -->|"requests installs"| node_install
node_install -->|"checks commands"| node_command
node_install -->|"installs tools"| node_android
node_entry -->|"starts setup"| node_project
node_project -->|"runs init"| node_rncli
node_project -->|"installs template"| node_template
node_template -->|"copies selected files"| node_templatefiles
node_template -->|"copies files"| node_copy
node_template -.->|"includes selected hooks"| node_hooks
node_project -->|"initializes repository"| node_git
node_project -->|"sets up CI"| node_ci
node_template -.->|"supports NativeWind"| node_styling
node_template -.->|"configures env"| node_env
node_template -.->|"configures removal"| node_console

click node_entry "https://github.com/developer-sumit/react-native-lab/blob/main/index.ts"
click node_prompts "https://github.com/developer-sumit/react-native-lab/blob/main/src/prompts.ts"
click node_retry "https://github.com/developer-sumit/react-native-lab/blob/main/src/helpers/retry.ts"
click node_project "https://github.com/developer-sumit/react-native-lab/blob/main/src/react-native-lab.ts"
click node_template "https://github.com/developer-sumit/react-native-lab/blob/main/src/template.ts"
click node_templatefiles "https://github.com/developer-sumit/react-native-lab/tree/main/src/templates/project"
click node_copy "https://github.com/developer-sumit/react-native-lab/blob/main/src/helpers/copy.ts"
click node_hooks "https://github.com/developer-sumit/react-native-lab/blob/main/src/templates/snippets/hooks.ts"
click node_package "https://github.com/developer-sumit/react-native-lab/blob/main/src/helpers/get-pkg-manager.ts"
click node_version "https://github.com/developer-sumit/react-native-lab/blob/main/src/helpers/fetch-rn-versions.ts"
click node_install "https://github.com/developer-sumit/react-native-lab/blob/main/src/install-scripts.ts"
click node_command "https://github.com/developer-sumit/react-native-lab/blob/main/src/helpers/check-cmd.ts"
click node_git "https://github.com/developer-sumit/react-native-lab/blob/main/src/helpers/git.ts"
click node_ci "https://github.com/developer-sumit/react-native-lab/blob/main/src/helpers/ci.ts"
click node_styling "https://github.com/developer-sumit/react-native-lab/tree/main/src/templates/project"
click node_env "https://github.com/developer-sumit/react-native-lab/blob/main/src/template.ts"
click node_console "https://github.com/developer-sumit/react-native-lab/blob/main/src/template.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_prompts,node_retry,node_user toneBlue
class node_project,node_package,node_version toneAmber
class node_template,node_templatefiles,node_copy,node_hooks,node_styling,node_env,node_console toneMint
class node_install,node_command toneRose
class node_git,node_ci,node_rncli,node_android toneIndigo
```

## Components

### CLI Workflow

- [CLI Entry](https://github.com/developer-sumit/react-native-lab/blob/main/index.ts): `index.ts`
- [Setup Prompts](https://github.com/developer-sumit/react-native-lab/blob/main/src/prompts.ts): `src/prompts.ts`
- [Retry Logic](https://github.com/developer-sumit/react-native-lab/blob/main/src/helpers/retry.ts): `src/helpers/retry.ts`

### Project Generation

- [Project Orchestrator](https://github.com/developer-sumit/react-native-lab/blob/main/src/react-native-lab.ts): `src/react-native-lab.ts`
- [Package Manager](https://github.com/developer-sumit/react-native-lab/blob/main/src/helpers/get-pkg-manager.ts): `src/helpers/get-pkg-manager.ts`
- [RN Versions](https://github.com/developer-sumit/react-native-lab/blob/main/src/helpers/fetch-rn-versions.ts): `src/helpers/fetch-rn-versions.ts`

### Templates & DX

- [Template Installer](https://github.com/developer-sumit/react-native-lab/blob/main/src/template.ts): `src/template.ts`
- [Project Templates](https://github.com/developer-sumit/react-native-lab/tree/main/src/templates/project): `src/templates/project`
- [File Copier](https://github.com/developer-sumit/react-native-lab/blob/main/src/helpers/copy.ts): `src/helpers/copy.ts`
- [Custom Hooks](https://github.com/developer-sumit/react-native-lab/blob/main/src/templates/snippets/hooks.ts): `src/templates/snippets/hooks.ts`
- [NativeWind Option](https://github.com/developer-sumit/react-native-lab/tree/main/src/templates/project): `src/templates/project`
- [Environment Config](https://github.com/developer-sumit/react-native-lab/blob/main/src/template.ts): `src/template.ts`
- [Console Removal](https://github.com/developer-sumit/react-native-lab/blob/main/src/template.ts): `src/template.ts`

### Environment Setup

- [Prerequisite Installer](https://github.com/developer-sumit/react-native-lab/blob/main/src/install-scripts.ts): `src/install-scripts.ts`
- [Command Detection](https://github.com/developer-sumit/react-native-lab/blob/main/src/helpers/check-cmd.ts): `src/helpers/check-cmd.ts`

### Project Integrations

- [Git Initialization](https://github.com/developer-sumit/react-native-lab/blob/main/src/helpers/git.ts): `src/helpers/git.ts`
- [CI Workflow Setup](https://github.com/developer-sumit/react-native-lab/blob/main/src/helpers/ci.ts): `src/helpers/ci.ts`

### Other components

- **CLI User**
- **React Native CLI**
- **Android Toolchain**

## Connections

- CLI User → CLI Entry: runs
- CLI Entry → Setup Prompts: collects choices (evidence: `index.ts`)
- Setup Prompts → RN Versions: fetches versions (evidence: `src/prompts.ts`)
- Setup Prompts → Command Detection: checks tools (evidence: `src/prompts.ts`)
- CLI Entry → Retry Logic: retries installs (evidence: `index.ts`)
- CLI Entry → Prerequisite Installer: requests installs (evidence: `index.ts`)
- Prerequisite Installer → Command Detection: checks commands (evidence: `src/install-scripts.ts`)
- Prerequisite Installer → Android Toolchain: installs tools (evidence: `src/install-scripts.ts`)
- CLI Entry → Project Orchestrator: starts setup (evidence: `index.ts`)
- Project Orchestrator → React Native CLI: runs init (evidence: `src/react-native-lab.ts`)
- Project Orchestrator → Template Installer: installs template (evidence: `src/react-native-lab.ts`)
- Template Installer → Project Templates: copies selected files (evidence: `src/template.ts`)
- Template Installer → File Copier: copies files (evidence: `src/template.ts`)
- Template Installer → Custom Hooks: includes selected hooks (evidence: `src/template.ts`)
- Project Orchestrator → Git Initialization: initializes repository (evidence: `src/react-native-lab.ts`)
- Project Orchestrator → CI Workflow Setup: sets up CI (evidence: `src/react-native-lab.ts`)
- Template Installer → NativeWind Option: supports NativeWind
- Template Installer → Environment Config: configures env (evidence: `src/template.ts`)
- Template Installer → Console Removal: configures removal (evidence: `src/template.ts`)
