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

# Architecture

> Electron, React, IPC, main-process services, and renderer structure.

Catalyst uses a three-process Electron structure with shared TypeScript types.

```text theme={null}
src/main/          Electron main process
src/preload/       Preload bridge and contextBridge API
src/renderer/src/  React renderer UI
src/shared/        Shared types used across processes
```

## Process diagram

```mermaid theme={null}
graph TB
  subgraph Renderer
    App[React routes]
    Pages[Dashboard, Servers, Detail, Analytics, Settings]
    UI[shadcn/Radix components]
  end

  subgraph Preload
    Bridge[window.context API]
  end

  subgraph Main
    IPC[ipcMain handlers]
    SM[server-manager]
    SR[server-runner]
    BM[backup-manager]
    MR[modrinth]
    NG[ngrok-manager]
    JV[java-manager]
    UP[update-checker]
  end

  App --> Bridge
  Pages --> Bridge
  Bridge --> IPC
  IPC --> SM
  IPC --> SR
  IPC --> BM
  IPC --> MR
  IPC --> NG
  IPC --> JV
  IPC --> UP
  BM --> Worker[backup worker]
  SR --> Java[Minecraft Java processes]
```

## Main process modules

| Module              | Responsibility                                                                     |
| ------------------- | ---------------------------------------------------------------------------------- |
| `server-manager.ts` | Server records, folders, downloads, properties, files, import, export, disk usage. |
| `server-runner.ts`  | Java process lifecycle, console output, stats, restart behavior, shutdown.         |
| `backup-manager.ts` | Manual and automatic backups, restore, cancel, worker orchestration.               |
| `backup-worker.ts`  | Archive creation in a worker thread.                                               |
| `modrinth.ts`       | Search, project details, versions, installs, dependencies, updates, removal.       |
| `ngrok-manager.ts`  | ngrok install, authtoken validation, tunnel start/stop, status.                    |
| `java-manager.ts`   | Java detection, version mapping, managed runtime download.                         |
| `update-checker.ts` | GitHub release checks and version comparison.                                      |

## Renderer routes

| Route          | Page                                          |
| -------------- | --------------------------------------------- |
| `/`            | Dashboard                                     |
| `/servers`     | Server list and creation/import               |
| `/servers/:id` | Server detail tabs                            |
| `/analytics`   | Global analytics selector and analytics panel |
| `/settings`    | App-wide settings                             |

## Styling

Catalyst uses Tailwind CSS 3 with shadcn-style semantic tokens, Radix primitives, Motion, Lucide icons, and a custom frameless title bar. Theme variables live in `src/renderer/src/assets/theme.css`.

<Info>
  The server detail page is intentionally broad and holds several workflows. Prefer targeted edits over rewriting the page when changing a single tab.
</Info>
