Scaffolding

grit new-desktop walkthrough.

6 mineasy

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

Terminal
$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

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ field-pos/ (one Wails project) โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ โ”‚ โ”‚ main.go โ—„โ”€โ”€โ”€ entry point โ”‚ โ”‚ app.go โ—„โ”€โ”€โ”€ Go methods โ”‚ โ”‚ bound to React โ”‚ โ”‚ internal/ โ”‚ โ”‚ โ”œโ”€โ”€ db/ local SQLite โ”‚ โ”‚ โ”œโ”€โ”€ models/ GORM structs โ”‚ โ”‚ โ”œโ”€โ”€ service/ business logic โ”‚ โ”‚ โ””โ”€โ”€ ... โ”‚ โ”‚ โ”‚ โ”‚ frontend/ โ—„โ”€โ”€โ”€ React + Vite โ”‚ โ”‚ โ”œโ”€โ”€ src/ โ”‚ โ”‚ โ”œโ”€โ”€ package.json โ”‚ โ”‚ โ””โ”€โ”€ wailsjs/ auto-generated Go- โ”‚ โ”‚ to-TS bridge โ”‚ โ”‚ โ”‚ โ”‚ build/ Wails build assets โ”‚ โ”‚ wails.json Wails config โ”‚ โ”‚ go.mod โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ wails build โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ field-pos.exe โ”‚ โ—„โ”€โ”€ single binary, โ”‚ (frontend dist embedded) โ”‚ no server, โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ no internet.
One binary. The frontend is bundled INTO the Go executable at build time.

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)
Confirm Wails CLI is healthy with wails doctor โ€” it checks every dependency and tells you exactly what's missing.

Quick check

A teammate asks why we use `grit new-desktop` and not `grit new --desktop`. What's the cleanest answer?

Try it

Scaffold + verify:

  1. Install Wails CLI: go install github.com/wailsapp/wails/v2/cmd/wails@latest
  2. Run wails doctor โ€” fix anything red.
  3. grit new-desktop field-pos
  4. cd field-pos && ls โ€” confirm main.go, frontend/, and wails.json are at the root (not under apps/).

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