GuideStable beta loop

Application flow

This guide shows the Axonyx app loop in the order you actually use it: install tools, create a project, edit pages, inspect contracts, and run.

1. Install the tools

`create-axonyx` creates new projects. `cargo-axonyx` adds the `cargo ax ...` commands used while developing.

Code
ax
cargo install create-axonyx --version 0.2.16
cargo install cargo-axonyx --version 0.2.16
cargo install axonyx-aegis --version 0.1.8 --force

2. Create a site

The site template is the safest starting point because it already wires routes, assets, Foundry UI, and the Axonyx runtime.

Code
ax
create-axonyx my-site --yes --template site
cd my-site

3. Know the core files

app/layout.asx

Shared head, stylesheet links, header, shell, and root slot.

app/page.asx

The home route. Nested folders with `page.asx` become routes.

Axonyx.toml

App config for runtime, generated output, UI entry, and content collections.

public/

Static assets such as CSS, images, icons, and small JS helpers.

app/error.asx

Global render fallback. Nested `app/**/error.asx` files can override a route subtree.

app/not-found.asx

Global 404 boundary. Nested `app/**/not-found.asx` files keep missing pages branded per section.

4. Check the app

`cargo ax check` validates Axonyx files before you build or deploy. `doctor` adds package/config checks and can fail CI when warnings exist.

Code
ax
cargo ax check
cargo ax doctor --deny-warnings

5. Inspect routes and contracts

These commands make the app discoverable for humans and tooling. They are the early Axonyx equivalent of "show me what this app exposes".

Code
ax
cargo ax routes
cargo ax api
cargo ax api --schema
cargo ax actions
cargo ax actions --schema

6. Run locally

`cargo ax run dev` starts the local server. Keep `.asx` pages small, move data into loaders/actions, and use Foundry components for layout.

Code
ax
cargo ax run dev

7. Deploy

Hosted starts use `cargo ax run start`. On Render, pass the platform port through `$PORT`.

Code
terminal
cargo install cargo-axonyx --version 0.2.16 --force && cargo ax build --clean
cargo ax run start --host 0.0.0.0 --port $PORT

Open the Render deploy guide.

8. Run fast QA

New Axonyx templates include `aegis.toml`. With the dev server running, `cargo ax test` delegates route checks to Aegis.

Code
ax
cargo ax test
cargo ax test --format json --fail-fast false