[@layout]: ../docs.layout.md

# How PathMX runs

Publish public content as static files, or run a live server for accounts,
private content, and shared saved work. Browser-hosted apps can also save personal
Sources on the current device.

---

## Static files

`bun run pmx export` builds HTML, CSS, JavaScript, and assets for an anonymous reader.
Upload the output to a static host.

Queries and components produce pages during export. Browser features such as
navigation, theme switching, Focus, Slides, and playable chess run when readers
open those pages.

To publish changes to the content or query results, export and deploy again.

---

## A live server

`bun run start` renders pages as people request them. It can use the signed-in
reader's identity to control access, return private query results, and handle
Actions that save changes.

Use a live server when personal reading lists, submissions, or progress must be
saved to a shared host under a signed-in identity. Changes become available to readers through the running site.

---

## Browser-local work

A [browser publication](../extend/core.reference.md#browser-publications) runs a
local host in the browser. Input, Completion, and attachments can save personal
Sources and files in that browser's database. They survive reloads but do not
synchronize to a server or another device. Export a backup of personal Sources
before clearing site data.

[Personal state](../extend/state.reference.md) distinguishes this durable work
from device preferences and recovery drafts. Ordinary static export does not
implicitly turn every server Plugin or Action into a browser-hosted capability.

---

## Choose hosting

| Your site needs… | Hosting |
| --- | --- |
| Public pages and a bookcase built from files | Static export or live server |
| Browser interactions, such as a theme toggle or chess board | Static export or live server |
| Queries that show different private results to each reader | Live server |
| Personal work saved on this device | Browser publication with supported Plugins |
| Submissions or progress saved to a shared host | Live server |

Each feature's documentation describes its hosting requirements.

---

## Develop and publish

Use `bun run dev` to work locally. It watches your files and updates the browser.

For static hosting, run `bun run pmx export --origin https://example.com` and review
its diagnostics before uploading the output. For live hosting, configure and
run `bun run start`.

Continue to [Publish](./publish.guide.md) for setup and deployment commands.
