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)

Tutorial , 8. Build and deploy

Notes is done. Let us build it for production and put it on a server behind HTTPS. The full reference is Building & Deploying; here is the concrete path for our app.

1. Build the client

On your machine, produce the browser bundle and manifest:

1
ekko build --client

This writes .ekko/build/client/* (content-hashed chunks) and .ekko/build/manifest.json. Ship this folder, the production box does not rebuild client code (it has no esbuild in its store).

2. What ships

Three things, from your machine to the server:

  1. The runtime , the ekko binary + its native lib (built elsewhere; on a host already running another

rune app it is already installed).

  1. The app bundle , the notes/ folder including .ekko/build, plus 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, ...).

1
2
3
tar czf app.tgz notes
tar czf store.tgz -C "$HOME/.ekko" store
scp app.tgz store.tgz user@host:/tmp/

3. Install on the host

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

4. Run under systemd

/etc/systemd/system/notes.service:

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

5. nginx + HTTPS

createApp binds 0.0.0.0:3100; keep it private and let nginx reach it on 127.0.0.1:3100:

1
sudo iptables -I INPUT -p tcp --dport 3100 ! -i lo -j DROP # block external, allow loopback

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

server {
    listen 80;
    server_name notes.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-Forwarded-Proto $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}
1
2
3
sudo ln -sf /etc/nginx/sites-available/notes.example.com /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d notes.example.com --non-interactive --agree-tos -m you@example.com --redirect

6. Verify

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

Updating later

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

The runtime rarely changes; usually you just rebuild the client, re-ship the folder, and restart the service.

You built a full-stack app

Notes uses every part of rune: file-based and dynamic routing, a persistent layout, Mimir atoms and a selector with a persisted session, SSR with seeded state and a cached list page, API routes in the same process with cache invalidation, SCSS theming, and a production build + deploy. That is the whole framework, in one small app.

From here, deepen any area with its chapter, or browse the API Reference and Recipes.