Tutorial
Tutorial
Build a reading list with accounts, tests and a deploy, one step per page.
This tutorial builds Shelf, a reading list: you save links to read later, mark them read, and filter them. Then you add accounts, so every user has a shelf of their own, write tests for it, and ship it as one binary to a server.
Each step adds one idea and ends with an app that runs. Along the way you use most of what a Tern app is made of:
- Create the app: a new project, and the dev server
- Your first page: a Go load, and the types it gives your Svelte page
- A database: SQLite, and migrations
- Saving links: a form action, validated from Go struct tags
- A page for each link: a route parameter, not-found pages, more actions
- Filtering: state in the URL
- Accounts: sign-up, sign-in, and data that belongs to its user
- Tests: the whole app, tested from Go
- Ship it: one binary, deployed over SSH
The finished app is examples/shelf, if you want to compare. It goes one step further than the tutorial: assistants such as Claude can use it, through the tools in assistants.go (Apps for assistants).
#What you need
- Go 1.26 or later, and Node.js 22 or later. Node builds the client in development; the app you ship runs without it.
- Some Go, and some Svelte or another component framework. You don't need to know SvelteKit, but if you do, much of this will look familiar: Coming from SvelteKit lists the differences.