Documentation

Docs

Introduction

What is rune

Philosophy

Why rune

Architecture

Getting Started

Installation

Quick start

Project structure

The dev loop

Tutorial: build an app

1. Create the app

2. Pages & routes

3. Layouts

4. State with Mimir

5. SSR & data

6. API routes

7. Styling

8. Build & deploy

Core Concepts

The application object

Rendering pipeline

Hydration

The build manifest

Configuration (ekko.json)

Permissions

Conventions

Routing

File-based routing

Dynamic routes

The router (useRouter)

Navigation & Link

Guards & redirects

Programmatic routes

Server-Side Rendering

Overview

The ssr() function

Strategies (eager/lazy)

SSR → hydration

Caching & invalidation

SEO

Mimir, state management

Overview

Atoms

Reading & writing

Selectors (derived state)

Subscriptions & the store

SSR & hydration

Persistence & sessions

Patterns & recipes

Pitfalls

Pages & Layouts

Pages

Layouts

Error & not-found

API Routes

Defining routes

Request & response

Middleware

helmet

cors

rateLimit

bodyLimit

validateContentType

csrf

requestId

timeout

errorHandler

httpsRedirect

secureCookies

ipFilter

safePath

Validation & options

Styling & Theming

SCSS

Theming (light/dark)

Asgard integration

No flash (no-FOUC)

Building & Deploying

The build

Static assets

Production deploy

API Reference

ekko:rune

ekko:rune/router

ekko:rune/mimir

ekko:rune/seo

ekko:ssr / css

ekko.json schema

CLI commands

Guides

Rune app from scratch

Recipes

Dark mode

Forms

Data fetching

Authentication

Pagination

FAQ (use cases)

Documentation

Docs

Introduction

What is rune

Philosophy

Why rune

Architecture

Getting Started

Installation

Quick start

Project structure

The dev loop

Tutorial: build an app

1. Create the app

2. Pages & routes

3. Layouts

4. State with Mimir

5. SSR & data

6. API routes

7. Styling

8. Build & deploy

Core Concepts

The application object

Rendering pipeline

Hydration

The build manifest

Configuration (ekko.json)

Permissions

Conventions

Routing

File-based routing

Dynamic routes

The router (useRouter)

Navigation & Link

Guards & redirects

Programmatic routes

Server-Side Rendering

Overview

The ssr() function

Strategies (eager/lazy)

SSR → hydration

Caching & invalidation

SEO

Mimir, state management

Overview

Atoms

Reading & writing

Selectors (derived state)

Subscriptions & the store

SSR & hydration

Persistence & sessions

Patterns & recipes

Pitfalls

Pages & Layouts

Pages

Layouts

Error & not-found

API Routes

Defining routes

Request & response

Middleware

helmet

cors

rateLimit

bodyLimit

validateContentType

csrf

requestId

timeout

errorHandler

httpsRedirect

secureCookies

ipFilter

safePath

Validation & options

Styling & Theming

SCSS

Theming (light/dark)

Asgard integration

No flash (no-FOUC)

Building & Deploying

The build

Static assets

Production deploy

API Reference

ekko:rune

ekko:rune/router

ekko:rune/mimir

ekko:rune/seo

ekko:ssr / css

ekko.json schema

CLI commands

Guides

Rune app from scratch

Recipes

Dark mode

Forms

Data fetching

Authentication

Pagination

FAQ (use cases)

Production deploy

Deploying a rune app is a short runbook, not a research project: build the client on your machine, ship the folder plus the runtime to a Linux host, run it under systemd, and put nginx + Let's Encrypt in front. No build farm on prod, no containers required. This is the exact shape used to put this docs site on the internet.

What ships

The prod box needs no Rust/.NET toolchain and no esbuild. Ship three things:

  1. The runtime , the ekko binary + its native lib (EkkoNative.so on Linux), built elsewhere. On a

host already running another rune app, it is already installed at /usr/local/bin.

  1. The app bundle , your project folder including the prebuilt .ekko/build (made by

ekko build --client on your machine) and any dependency .ekl archives it resolves from ekko.lock.

  1. The ekko store , ~/.ekko/store (the packages ekko.lock sources from "store", @ekko/react,

@ekko/react-dom, and any libraries like @ekko/asgard).

1. Build the client (dev machine)

1
2
3
ekko build --client # regenerate .ekko/build
tar czf app.tgz <project-folder> <dep .ekl dirs> # app + any .ekl it needs
tar czf store.tgz -C "$HOME/.ekko" store # the package store

2. Ship it

1
scp app.tgz store.tgz user@host:/tmp/

3. Install the runtime + system libraries (host)

The ekko binary dynamically links the WebKitGTK/GTK3 + libxdo stack (it carries the desktop/webview feature), so those libraries must be present even on a headless server, or it will not start:

1
2
3
4
sudo cp ekko /usr/local/bin/ekko && sudo cp EkkoNative.so /usr/local/bin/ # native lib sits next to ekko
sudo chmod +x /usr/local/bin/ekko
sudo apt-get install -y libxdo3 libwebkit2gtk-4.1-0 libgtk-3-0
ekko --version

4. Extract the app + store (host)

1
2
3
4
5
6
mkdir -p ~/apps ~/.ekko
tar xzf /tmp/app.tgz -C ~/apps # → ~/apps/<project>
tar xzf /tmp/store.tgz -C ~/.ekko # → ~/.ekko/store
# smoke test
cd ~/apps/<project> && PORT=3100 ekko run server.tsx --allow=fs,net,env & sleep 6
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:3100/ # 200

Running ekko build --client on prod fails with "esbuild not found", that is expected. The client is prebuilt and shipped; only rebuild it on your dev machine.

5. Run under systemd

/etc/systemd/system/myapp.service:

[Unit]
Description=My rune app (SSR)
After=network.target
[Service]
Type=simple
User=ubuntu
Environment=HOME=/home/ubuntu
Environment=PORT=3100
WorkingDirectory=/home/ubuntu/apps/myapp
ExecStart=/usr/local/bin/ekko run server.tsx --allow=fs,net,env
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
1
2
sudo systemctl daemon-reload && sudo systemctl enable --now myapp
systemctl is-active myapp # active

6. Lock the port to localhost

createApp binds 0.0.0.0; keep it private and let nginx reach it on loopback. One boot-persistent rule:

1
sudo iptables -I INPUT -p tcp --dport 3100 ! -i lo -j DROP # external blocked, loopback (nginx) ok

Persist it with a tiny oneshot unit (ExecStart the same iptables line, RemainAfterExit=yes, enable it) so it survives reboots.

7. nginx reverse proxy

/etc/nginx/sites-available/myapp.example.com:

server {
    listen 80;
    listen [::]:80;
    server_name myapp.example.com;
    location / {
        proxy_pass http://127.0.0.1:3100;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 60s;
    }
}
1
2
sudo ln -sf /etc/nginx/sites-available/myapp.example.com /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

8. HTTPS with Let's Encrypt

certbot obtains the cert over HTTP-01 (needs port 80 reachable, which it is), rewrites nginx to add the 443 ssl block, and --redirect adds the 80→443 redirect. It also installs the auto-renewal timer.

1
sudo certbot --nginx -d myapp.example.com --non-interactive --agree-tos -m you@example.com --redirect

9. Verify (from anywhere)

1
2
curl -s -o /dev/null -w '%{http_code}\n' https://myapp.example.com/ # 200
curl -s -o /dev/null -w '%{http_code}\n' http://myapp.example.com/ # 301 → https

Updating later

The runtime rarely changes; usually only the app does:

1
2
# dev: ekko build --client && tar czf app.tgz <project> && scp app.tgz host:/tmp/
# host: tar xzf /tmp/app.tgz -C ~/apps && sudo systemctl restart myapp

Running several rune apps on one host

Give each app its own port, systemd unit, firewall rule, and nginx server block (one server_name per subdomain). They share the runtime and the store. That is exactly how a single host serves multiple rune sites side by side.

Gotchas

  • EkkoNative.so must sit next to the ekko binary, or the runtime will not load its native APIs.
  • The ekko binary needs libxdo3 + libwebkit2gtk-4.1-0 + libgtk-3-0 to start (it links the desktop

stack even when unused).

  • Build the client on dev and ship .ekko/build; do not rebuild on prod.
  • Any dependency .ekl referenced by ekko.lock must be present at its source path on the host too.

That completes Building & Deploying. Next: the exhaustive API Reference.