Avalonia Field Guide
About

About

What this is, and why you can trust it

A course is only useful if its code still runs. This site is generated from the same repository that contains the sample app, and the build fails when the two drift apart.

The stack

The portal is a React Router app with ssr: false and prerendering, so every route is exported as static HTML plus a data file. There is no runtime server. Lessons are Markdown compiled by tools/ContentBuild; the sample app is Avalonia 12.2 on .NET 10, and the screenshots come from src/CourseApp.Verify, which boots the real app headlessly.

What is automated

  • Compilation. All projects build with nullable enabled and warnings treated as errors.
  • Rendering. Every lesson page is captured at 1280×800 in light and dark. The content build reads each PNG's IHDR header and rejects the wrong dimensions.
  • References. Every [[file:…]] listing is read from the real source file, so a snippet cannot outlive the code it quotes. Every referenced screenshot must exist.
  • Structure. Duplicate slugs, non-contiguous lesson order, missing modules, and lessons without a verification note all fail the build.
  • Behaviour. Assertions cover what a screenshot cannot show: that a binding updates, a command fires, validation blocks, and navigation switches the page.

What is checked by hand

Layout at mobile and tablet widths, dark-mode contrast, keyboard focus order, the opened mobile navigation sheet, and the printed lesson view are inspected visually. Automated checks catch drift; they do not judge whether a screen looks right.

Where your progress lives

In your browser's localStorage, under afg.progress.v1. There is no account and no database, which is what makes the portal safe to deploy anywhere and cheap to run. Clearing site data resets progress.

Running it yourself

The repository is self-contained:

dotnet run --project tools/ContentBuild    # render lessons, validate references
dotnet run --project src/CourseApp.Verify  # render screenshots, run assertions
cd web && pnpm build                       # prerender the site into build/client

# or just rebuild everything
./tools/verify.sh

Deploy the contents of web/build/client to any static host, or use the included Dockerfile with nginx.

What to do after lesson 13

Build something small and finish it: a notes app, a CSV viewer, a timer that survives sleep. Finishing teaches more than another tutorial. Then read Avalonia's own documentation and the source of a real app.