# Quickstart

This walkthrough goes from an empty folder to a gateway serving a published project with live values and an HMI screen. It uses the built-in simulation driver, so you don't need a PLC — or a database — to follow along.

### Working with an agent?

You can give this work to your own AI agent. [Work with your agent](https://thermitescada.com/docs/your-agent.md) has the prompt to start with. This page does the same work by hand, so you can see every file and command the agent uses.

## Get the server

[Request a build](https://thermitescada.com/contact) for your target platform. This walkthrough uses `thermite-server` (the gateway) and `thermite` (the project lifecycle CLI). The trial package also includes thermite-passwd for password hashes. Commands below assume the executables are on PATH; otherwise invoke them by their full or relative paths.

## Create a site

A *site* is a self-contained directory holding everything one gateway runs: configuration, project sources, and the published store. Create the folder, and work from inside it — the CLI discovers the site by walking up from your current directory.

```sh
mkdir -p my-site/config my-site/projects
cd my-site
```

Then create `config/server.toml`. This minimal config names the gateway, turns on HMI serving, defines three scan-group labels, and connects a simulated device whose update_rate_ms controls its cadence. The historian is off so the quickstart has no database dependency — [Server configuration](https://thermitescada.com/docs/server-configuration.md) covers enabling it against PostgreSQL.

```toml
# config/server.toml
[server]
name = "quickstart"
http_port = 8400

[features]
historian = false
hmi_serving = true

[[scan_groups]]
name = "fast"
rate_ms = 100

[[scan_groups]]
name = "normal"
rate_ms = 250

[[scan_groups]]
name = "slow"
rate_ms = 1000

[[devices]]
name = "sim-plc"
driver = "sim"

[devices.config]
update_rate_ms = 500
```

## Start the gateway

```sh
thermite-server --site .
```

Open `http://localhost:8400`. An unlicensed gateway boots into a license page: start the built-in trial there, then restart the server — trial entitlements load at boot. The two-hour trial window starts when you request it; a restart uses the remaining time. Starting another trial after it lapses waits out a cooldown that grows with back-to-back trials. Details on [Licensing & trial](https://thermitescada.com/docs/licensing.md).

## Create a project

Projects live under `projects/` — one folder per industrial application. From the site root:

```sh
$ thermite project init press-line
Initialized project 'press-line' at /srv/my-site/projects/press-line (id 01a1d097-b185-76aa-a477-ea4a5a4479d1)
Publish it with: thermite project publish press-line
```

Now give it tags. Tag files are TOML arrays under the project's `tags/` folder; the simulation driver generates values from address patterns like `Sine_Wave` and `Square_Wave`.

```toml
# projects/press-line/tags/demo.toml
[[tags]]
name = "HeadPressure"
path = "press/outputs/HeadPressure"
data_type = "f64"
device = "sim-plc"
address = "Sine_Wave"
scan_group = "fast"
eng_units = "psi"

[[tags]]
name = "CycleActive"
path = "press/outputs/CycleActive"
data_type = "bool"
device = "sim-plc"
address = "Square_Wave"
scan_group = "fast"
```

## Add a screen

A screen is a folder under `screens/` containing an `index.html`. The gateway serves `thermite.js` (live tag binding over WebSocket) and `thermite.css` (a dark industrial theme) to every screen.

```html
<!-- projects/press-line/screens/overview/index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Press Overview</title>
  <link rel="stylesheet" href="../thermite.css">
</head>
<body>
  <div class="th-screen">
    <div class="th-header"><h1>Press Overview</h1></div>
    <div class="th-pad th-row">
      <div class="th-gauge">
        <div class="th-gauge-label">Head pressure</div>
        <div class="th-gauge-value" id="pressure">--</div>
        <div class="th-gauge-units">psi</div>
      </div>
    </div>
  </div>

  <script src="../thermite.js"></script>
  <script>
    Thermite.subscribe("press/outputs/HeadPressure", function (tv) {
      // tv = { value, quality, timestamp }
      document.getElementById("pressure").textContent =
        tv.quality === "good" && typeof tv.value === "number"
          ? tv.value.toFixed(1) : "--";
    });
  </script>
</body>
</html>
```

## Publish it

The gateway serves the *published store*, never your working files. Check a draft, then publish the same project source to production. The running gateway mounts these screen and tag changes without a restart.

```sh
# validate + snapshot into a draft slot
$ thermite project draft press-line wip
Published press-line → draft 'wip' (snap-01a1d097bba372efaa8af557dc922b19) — serves at /draft/press-line/wip/

# check the draft screen, then publish the same project source
$ thermite project publish press-line
Published press-line → production (snap-01a1d097bbd674859e2966fd5c5dd513)
Surviving drafts:
  wip    (published 2026-11-12T16:29:27.331313+00:00)
    teardown: thermite project destroy-draft press-line wip
```

The draft screen is at `/draft/press-line/wip/hmi/overview/`, production at `/p/press-line/hmi/overview/`. Re-running the draft command swaps that draft's snapshot in place — that's the edit loop while you build. The full lifecycle is on [Publishing & the CLI](https://thermitescada.com/docs/publishing.md).

## Read it over the API

Every published project exposes its tags over HTTP and WebSocket under its own prefix.

```sh
$ curl http://localhost:8400/p/press-line/api/tags/press/outputs/HeadPressure
{
  "type": "tag",
  "path": "press/outputs/HeadPressure",
  "value": {
    "value": 10.452846326765346,
    "quality": "good",
    "timestamp": "2026-11-12T16:29:29.015068Z"
  }
}
```

`GET /p/press-line/api/tags` browses the tag tree; the WebSocket stream and history queries are covered in the [API reference](https://thermitescada.com/docs/api-reference.md).

## Where to next

### [Site structure](https://thermitescada.com/docs/site-structure.md)

What every folder in the site is for, and what belongs in git.

### [Tags](https://thermitescada.com/docs/tag-configuration.md)

The full tag file format and per-driver addressing.

### [HMI screens](https://thermitescada.com/docs/screen-development.md)

The thermite.js API and the built-in component styles.

### [Devices & drivers](https://thermitescada.com/docs/device-configuration.md)

Swap the simulator for Modbus, S7, OPC UA, MQTT, EtherNet/IP, or BACnet/IP.
