Scaffolding
grit new-desktop walkthrough.
Welcome to Building Desktop with Go API. Different kit, different command, different binary. This lesson covers the scaffold + what makes it different from the web/mobile kits.
The command — note it's different
$grit new-desktop field-pos
Yes — new-desktop, not new --desktop. The desktop kit produces a standalone Wails app (Go + React bundled into one binary), not a monorepo. That's why it has its own command.
What you get
Desktop project shape
What ships
- Wails v2 binding Go methods directly to React (no IPC plumbing)
- SQLite + GORM for local storage — survives across launches
- Frameless window with a custom titlebar (chapter 3 covers the polish)
- Local auth with bcrypt — no server needed
- In-app auto-updater — binary swap from GitHub releases (chapter 4)
- NSIS installer templates (chapter 5)
- Tailwind + shadcn/ui on the React side
Prerequisites
- Go 1.21+ installed
- Node 18+ and pnpm
- Wails v2 CLI —
go install github.com/wailsapp/wails/v2/cmd/wails@latest - Windows: WebView2 (ships with Windows 11; older Windows installs it on first build)
- macOS: Xcode CLI tools (
xcode-select --install) - Linux: WebKit2GTK + libgtk-3-dev (Wails docs lists the apt commands)
wails doctor — it checks every dependency and tells you exactly what's missing.Quick check
Try it
Scaffold + verify:
- Install Wails CLI:
go install github.com/wailsapp/wails/v2/cmd/wails@latest - Run
wails doctor— fix anything red. grit new-desktop field-poscd field-pos && ls— confirmmain.go,frontend/, andwails.jsonare at the root (not underapps/).
Paste the directory listing in notes.md.
What's next
Next lesson — wails dev. Hot-reload loop for both Go AND React. Much faster than building every change.
Spot a typo? Have an idea?
Help us improve this lesson. One click opens a GitHub issue with the lesson URL pre-filled — suggest clearer wording, report a bug, or request more depth. The course keeps improving thanks to learners like you.
Suggest an improvement on GitHub