> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rigbox.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture Explorer

> Visualize code structure, module dependencies, and handler call graphs.

Architecture Explorer analyzes your codebase and generates an interactive visualization of its structure - modules, dependencies, handler call graphs, and more. It runs inside your workspace and serves a web-based UI you can access from your browser.

## What It Does

Architecture Explorer scans your project files, builds a dependency graph, and renders it as an interactive web application. You can explore:

* **Module structure** - how files and directories relate to each other
* **Dependency graphs** - which modules import or depend on others
* **Handler call graphs** - trace the flow from HTTP handlers through business logic
* **Code metrics** - file sizes, complexity indicators, and module boundaries

## Supported Languages

| Language   | Detection      | What's analyzed                                      |
| ---------- | -------------- | ---------------------------------------------------- |
| Rust       | `Cargo.toml`   | Crate dependencies, module tree, handler functions   |
| TypeScript | `package.json` | Import graph, component hierarchy, route definitions |
| JavaScript | `package.json` | Import graph, module structure                       |

<Note>
  Architecture Explorer scans up to **5 projects** at a maximum directory depth of **25**. For monorepos, it discovers and analyzes each project (crate or package) independently.
</Note>

## Availability by Image

Architecture Explorer is not pre-installed on any image, so you need to install it first.

| Image  | Status        | Action needed        |
| ------ | ------------- | -------------------- |
| `base` | Not installed | Install, then launch |
| `dev`  | Not installed | Install, then launch |

<Tip>
  Use the `dev` template if you want a richer development environment for working alongside Architecture Explorer. See [Images & Templates](/guides/images-and-templates) for details.
</Tip>

## Installation

Install Architecture Explorer before launching it.

### Start the installation

The install runs asynchronously and prints a job id you can poll.

```bash theme={null}
rig tools install --workspace $WORKSPACE --tool architecture-explorer
```

See [Install Tool](/api-reference/tools/install) for the full response schema.

### Poll for installation status

Installation takes 1-3 minutes depending on the workspace image. Poll with the job id from `rig tools install` until the status is `installed`.

```bash theme={null}
rig tools install-status --workspace $WORKSPACE --tool architecture-explorer --job-id $JOB_ID
```

See [Installation Status](/api-reference/tools/install-status) for the response schema.

### Installation complete

Once installed, Architecture Explorer is ready to launch.

## Launching Architecture Explorer

After installation, launch the tool.

```bash theme={null}
rig tools launch --workspace $WORKSPACE --tool architecture-explorer
```

See [Launch Tool](/api-reference/tools/launch) for the response schema.

## Accessing the Visualization

Once launched, Architecture Explorer serves a Vite development server on **port 5174** inside the workspace. It's accessible at:

```
https://arch-{workspace-id}.rigbox.dev
```

Open this URL in your browser to interact with the visualization.

<Note>
  The `arch-` prefixed subdomain is created automatically when you launch Architecture Explorer. You don't need to create an app route manually.
</Note>

### What you'll see

The visualization includes:

* **Project overview** - list of all detected projects with their type (Rust crate, Node.js package)
* **Dependency graph** - interactive node graph showing how modules connect
* **File tree** - expandable tree view of the analyzed directory structure
* **Call graph** - for Rust projects, trace handler functions through layers of business logic
* **Search** - find specific modules, functions, or files across all analyzed projects

## Stopping Architecture Explorer

When you're done, stop the tool to free up resources.

```bash theme={null}
rig tools stop --workspace $WORKSPACE --tool architecture-explorer
```

See [Stop Tool](/api-reference/tools/stop) for details.

## Complete Example: Analyze a Rust Project

This walkthrough clones a Rust project into a workspace and visualizes its architecture.

**1. Create a workspace with the dev image**

`rig workspace spawn` creates the workspace from the `dev` template, boots it, and waits until it's ready:

```bash theme={null}
rig workspace spawn --name arch-demo --template dev
```

**2. Clone your project**

SSH into the workspace and clone the repository you want to analyze:

```bash theme={null}
git clone https://github.com/your-org/your-rust-project.git
```

**3. Launch Architecture Explorer**

```bash theme={null}
rig tools launch --workspace arch-demo --tool architecture-explorer
```

Then open `https://arch-<workspace-id>.rigbox.dev` in your browser.

**4. Explore the visualization**

Open `https://arch-<workspace-id>.rigbox.dev` in your browser. Architecture Explorer will scan the cloned project, detect `Cargo.toml`, and build the dependency and call graphs.

**5. Stop when done**

```bash theme={null}
rig tools stop --workspace arch-demo --tool architecture-explorer
```

## Tips

<Tip>
  For a richer development environment, use the `dev` template. Install Architecture Explorer once and launch it whenever you need it.
</Tip>

<Tip>
  Architecture Explorer works best with well-structured projects that have clear module boundaries. Flat file structures with hundreds of files in one directory produce less useful visualizations.
</Tip>

<Warning>
  Architecture Explorer consumes CPU and RAM while running. If your workspace has limited resources (e.g., 512 MB RAM), consider stopping other services before launching.
</Warning>

## Next Steps

* [Virtual Browser](/guides/virtual-browser) - run a remote browser inside your workspace
* [Images & Templates](/guides/images-and-templates) - choose the right image for your tools
* [Catalog Apps](/guides/catalog) - install VS Code, Jupyter, and other pre-packaged apps
