Skip to content

Latest commit

 

History

History
80 lines (62 loc) · 4.64 KB

File metadata and controls

80 lines (62 loc) · 4.64 KB

Tutorial: build and ship a whole product

This is the hands-on companion to Getting started. Where that guide teaches you the UI (components, state, routing), this tutorial takes you the rest of the way — from an empty folder to a deployed, database-backed product that one person runs on one server. That is the promise of the .NET One Person Framework, and this is the walk-through that proves it.

We build a small online shop — Shop — and grow it one chapter at a time. Every step is a real command you type and real code the rask CLI writes for you. Nothing here is pseudo-code.

Want to try the ideas before installing anything? The playground's guided tutorial teaches components, state, forms and then EF Core CRUD — running real SQLite in your browser tab, with nothing to set up. It covers the code; this tutorial covers the product: the CLI, migrations, jobs, email, and shipping it.

What you'll build

By the last chapter, Shop has:

  • a Products catalog with full create / read / update / delete pages, backed by SQLite through EF Core;
  • an Orders feature;
  • a login so only signed-in staff can edit the catalog;
  • a background job that runs work off the request thread;
  • transactional email (an order receipt) whose body is a Rask component;
  • a cache in front of the catalog;
  • domain events delivered through a durable outbox;
  • production-grade SQLite — WAL, a busy-timeout, snapshots, and continuous off-box backup;
  • push notifications sent from your own server on your own keys;
  • an ops page that shows every background worker's state;
  • and finally, a one-command deploy to a single server behind automatic HTTPS.

Every one of those is a first-party Rask pillar — a thin, opinionated package that rides on the app's own SQLite database. No Redis, no message broker, no managed queue, no second server. One box runs the whole product.

The chapters

# Chapter Pillar You'll run
1 Scaffold the app CLI · Auth rask new Shop --all-batteries --auth --docker
2 Your first feature Data · CQRS · SQLite rask generate feature Product … · rask db
3 A second feature + locking it down Auth rask generate feature Order …
4 Background jobs Jobs rask generate job …
5 Transactional email Mail rask generate email …
6 Caching the catalog Cache rask generate cache …
7 Domain events + the outbox Outbox rask generate feature … --outbox
8 Production SQLite SQLite UseRaskSqlite() · snapshots · Litestream
9 Push notifications Web Push · PWA VapidKeys.Generate() · IWebPush
10 Watching it run Observability an /ops page over every pillar's table
11 Deploy to one box Deploy rask deploy --host … --domain …

Read them in order — each chapter builds on the app the previous one left behind. Every chapter ends with a Verify section (how to confirm it works) and a Learn more link to that pillar's reference doc.

One command in Chapter 1 wires every pillar in; each chapter then teaches you what one of them is for and how to use it. If you'd rather add them one at a time, every flag works on its own — rask new Shop --data --jobs gives you a database and background work and nothing else.

Want to read ahead? samples/Rask.Example.Shop is the finished app, committed and runnable — the output of this tutorial's commands, with browser tests that prove each pillar actually runs.

Before you start

You need the .NET 10 SDK and the rask CLI:

dotnet --version                      # must be ≥ 10.0
dotnet tool install -g Rask.Cli       # installs the `rask` command (one-time)

If dotnet --version prints an older version, install the .NET 10 SDK from dotnet.microsoft.com first. To upgrade an already-installed CLI later, run dotnet tool update -g Rask.Cli.

This tutorial assumes you're comfortable with C#. It does not assume you know EF Core, CQRS, or Rask — each idea is introduced where it first appears. If you've never built a Rask UI, skim Getting started first; we won't re-teach components here.

Ready? → Chapter 1: Scaffold the app