Quickstart

Quickstart

Four commands take you from nothing to a production server: init, dev, build, serve.

Create an app

albedo init my-app

This writes a working starter into my-app/: four routes, a database with two collections, password sign-in, and one component at each rendering tier. Nothing is installed; the project is ready to run.

Run it

cd my-app
albedo dev

The development server starts on http://127.0.0.1:3000 — the server block in albedo.config.ts sets the address. Save a file and it rebuilds and reloads the page.

Open /guestbook in two tabs and sign it in one. The other tab updates without a refresh and without any code in the page asking it to: the list is a live collection.

Build it

albedo build

The build compiles every component and prints the tier it was given and why:

A Hero        no hooks, no async, no IO, no side effects - static markup
B Guestbook   state escapes this client - server-owned, no component JS
C Counter     hooks + a client-satisfiable handler - ships a client island

That listing is the answer to "what does this page send to the browser". Only C components ship their own JavaScript. Rendering tiers explains the three letters.

albedo build fails on anything albedo serve would refuse to run, so a green build is one that will boot.

Serve it

albedo serve

serve builds and then runs the production server on the built output. It is the same binary and the same server you deploy — Deploy covers packaging it, and HTTPS.

Commands

CommandDoes
albedo init <name>Creates a new app in a new directory
albedo devRuns the development server; rebuilds on save
albedo buildCompiles for production and prints every component's tier
albedo serveBuilds, then runs the production server
albedo ship --target <binary|docker|fly>Packages the app for a deploy target
albedo doctorReports what the compiler decided about each route, and why
albedo budgetChecks the build against tier-budget.toml
albedo email test <address>Sends one real message through your email provider

Every command after init takes an optional project directory; without one it uses the current directory.

Next: what each file in the new app is for.