Get started

From nothing to a running admin.

Laterite ships a command-line tool that scaffolds a project, sets up the database, and creates the first administrator in one guided step.

Prerequisites

  • Rust (stable), installed with rustup.
  • One of PostgreSQL, MySQL/MariaDB, or SQLite. SQLite needs nothing extra; it is just a file.

1. Install the CLI

This installs the lat binary, which works with any supported database.

cargo install laterite-cli

2. Create an application

Run lat new and answer the prompts: the application name, a display timezone, a database and its connection details, and the first administrator.

lat new

It scaffolds the project, applies the framework migrations, and creates the administrator.

3. Run it

cd acme
lat serve

Open 127.0.0.1:8080/admin and sign in. lat serve is cargo run with a bind-address override when you want one: lat serve --port 3000.

Or a static website

The first prompt also offers a static website. Its content lives where you choose: files you edit, a folder the admin writes, a folder the admin commits on every save, or a database. The public site is rendered to dist/ for any static host; the admin runs beside it only while someone is editing.

lat new "Acme" --static --content git
cd acme
lat serve            # the admin, and the site beside it
lat theme build      # dist/, as the host does on push

A git site starts as a repository with a post collection: each post is a markdown file under content/posts/, read into the admin when it starts and written back and committed when it is saved. lat make:resource article --source content/articles --format markdown --git adds another collection, with its component for the theme and a page built per record. An editor without a toolchain runs the admin on their own machine from the built binary: ./acme admin serves it and opens the browser.

Every prompt has a flag, so a script scaffolds a site unattended: --url, --timezone, --listen, and --admin with the password in LAT_NEW_ADMIN_PASSWORD. The static website guide has the whole sequence.

Check the setup

lat doctor, run from anywhere inside the application, verifies it is ready to serve: the configuration loads, the timezone is valid, storage/ is writable, the database is reachable, and the framework tables are present. It exits non-zero if anything fails, so it can gate a deploy.

lat doctor

Manage administrators

The first administrator is created during lat new. To add one later, or to recover a forgotten password, use the CLI. Inside the application it reads the database from the app's own configuration; elsewhere pass --database-url.

lat admin create editor --email editor@acme.test --first-name Editor
lat admin reset-password editor

The full guide is the handbook, generated with the project. Browse the source on GitHub.