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

# LiteJoin Studio

> Build streaming pipelines visually with the LiteJoin Studio desktop app.

# LiteJoin Studio

LiteJoin Studio is a **desktop application** that wraps the LiteJoin streaming engine with a visual interface. Think of it as "Postman for Streaming" — add API sources, write SQL joins, see live results, and export a production-ready config file.

## Prerequisites

* **Go 1.24+** with CGO enabled
* **Node.js 18+**
* A C compiler (`gcc` or `clang`)
* [Wails CLI](https://wails.io/docs/gettingstarted/installation) (`go install github.com/wailsapp/wails/v2/cmd/wails@latest`)

## Build & Run

```bash theme={null}
# Build the frontend
cd internal/studio/frontend && npm install && npm run build

# Build the binary (from repo root)
CGO_ENABLED=1 go build -o litejoin-studio ./cmd/studio

# Launch
./litejoin-studio
```

For development with hot-reload:

```bash theme={null}
cd cmd/studio
wails dev
```

## The Interface

Studio uses a **tri-pane layout**:

| Pane             | Purpose                                                                                           |
| ---------------- | ------------------------------------------------------------------------------------------------- |
| **Left sidebar** | Lists all sources, joins, windows, and sinks. Green dots indicate live connections.               |
| **Top right**    | SQL editor with syntax highlighting, autocomplete, and window configuration controls.             |
| **Bottom right** | Live results table — new rows slide in with a glow animation as data flows through your pipeline. |

## Workflow

### 1. Add a Source

Click **+ Add API** in the sidebar. Enter the API URL, authentication headers, poll interval, and key path. Studio immediately starts polling and shows raw data flowing in.

### 2. Write SQL

In the SQL editor, write your join query. Use `Ctrl+Enter` (or `Cmd+Enter` on Mac) to execute. The results pane updates in real-time as new data arrives.

```sql theme={null}
SELECT
  o.key as order_id,
  json_extract(o.payload, '$.amount') as amount,
  json_extract(u.payload, '$.name') as customer_name
FROM orders o
LEFT JOIN users u
  ON json_extract(o.payload, '$.user_id') = u.key
WHERE o.timestamp > (strftime('%s', 'now') - 300)
```

### 3. Configure Windows (Optional)

Use the visual windowing toolbar above the editor to add time-based aggregations without writing complex SQL:

* Select window type (Tumbling, Sliding, Session)
* Set the window size and slide interval
* Choose aggregation functions (COUNT, SUM, AVG, MAX, MIN)

### 4. Deploy

Click **Deploy** in the header to export your pipeline as a `litejoin.yaml` file. This file contains everything needed to run the pipeline standalone:

```bash theme={null}
litejoin run -c litejoin.yaml
```

<Tip>
  Studio embeds the LiteJoin engine directly — the Go backend runs the same code as the `litejoin` CLI binary. What you see in Studio is exactly what runs in production.
</Tip>

## Features

<CardGroup cols={2}>
  <Card title="API → Stream" icon="bolt">
    Paste a REST API URL and see changes stream in within seconds. No webhook setup required.
  </Card>

  <Card title="Live SQL Preview" icon="code">
    Write SQL joins and see results update in real-time as data flows through the pipeline.
  </Card>

  <Card title="Visual Windows" icon="clock">
    Configure tumbling, sliding, and session windows with visual controls — no manual SQL needed.
  </Card>

  <Card title="One-Click Export" icon="download">
    Generate a production-ready `litejoin.yaml` with a single click.
  </Card>
</CardGroup>
