Getting Started
Installation
Get up and running with Grit in minutes. Install the CLI, choose your architecture, and scaffold a production-ready full-stack application.
System Requirements
| Tool | Min Version |
|---|---|
| Go | 1.21+ |
| Node.js | 18+ |
| pnpm | 8+ |
| Docker | Latest |
Install the Grit CLI
Install Grit
Use the one-line install script. It detects an existing install and runs grit update (idempotent — no-ops if already on latest); otherwise it downloads the binary from the matching GitHub release for your OS / arch and puts it on PATH.
Prefer Go? go install github.com/MUKE-coder/grit/v3/cmd/grit@latest does the same thing if you have the Go toolchain.
# macOS / Linuxcurl -fsSL https://gritframework.dev/install.sh | sh# Windows (PowerShell)iwr -useb https://gritframework.dev/install.ps1 | iex
Create your project
Run grit new and follow the interactive prompts to select your architecture and frontend framework.
grit new my-app? Select architecture:> Triple — Web + Admin + API (Turborepo)Double — Web + API (Turborepo)Single — Go API + embedded React SPAAPI Only — Go API (no frontend)Mobile — API + Expo (React Native)? Select frontend framework:> Next.js — SSR, SEO, App RouterTanStack Router — Vite, fast builds, small bundle
Start infrastructure
Start PostgreSQL, Redis, MinIO, and Mailhog with Docker Compose. These services are pre-configured in the generated docker-compose.yml.
cd my-appdocker compose up -d
Install dependencies & start
Install frontend dependencies, apply migrations, seed the database, then start every development server with a single command. The Go API runs on :8080, web app on :3000, and admin on :3001.
pnpm installgrit migrategrit seedgrit start
Architecture shortcuts
Skip the interactive prompts with flags:
# Triple (default) with Next.jsgrit new my-app --triple --next# Single app with TanStack Router (Vite)grit new my-app --single --vite# Double (web + api) with TanStack Routergrit new my-app --double --vite# API only (no frontend)grit new my-app --api# Desktop app (Wails)grit new-desktop my-app
Default services
localhost:8080Backend server
localhost:3000Next.js or TanStack
localhost:3001Resource management
localhost:8080/docsAuto-generated
localhost:8080/studioDatabase browser
localhost:8025Email testing
Running without Docker
Docker is the default, but it is entirely optional. On low-spec machines, or when you just want the leanest possible setup, you can run Grit without any containers.
Option A — SQLite, no services
Point the API at a local SQLite file instead of PostgreSQL and skip docker compose entirely. GORM auto-migrates the SQLite file on first run, so there is nothing else to provision. Redis and MinIO are optional — the cache falls back to in-memory and file storage falls back to the local disk when their env vars are unset.
# Use a local SQLite file instead of PostgreSQLDATABASE_URL=sqlite:./app.db# Leave REDIS_URL / storage vars unset to run without Redis and MinIO
# No 'docker compose up' neededgrit start server # auto-migrates app.db on first run# In another terminal, start the frontend(s)pnpm installgrit start client
Option B — managed cloud services
Prefer PostgreSQL, Redis, and object storage without running them locally? Point the same env vars at managed services — all have generous free tiers. Set them in .env and run the API and frontends directly (no docker compose).
| Service | Provider | Env var |
|---|---|---|
| PostgreSQL | Neon | DATABASE_URL=postgres://…?sslmode=require |
| Redis | Upstash | REDIS_URL=rediss://…upstash.io:6379 |
| File storage | Cloudflare R2 / Backblaze B2 | STORAGE_DRIVER=r2 (+ R2_* keys) |
| Resend | RESEND_API_KEY / MAIL_FROM |
Grit scaffolds a .env.cloud.example file with these variables pre-filled as placeholders — copy it to .env and drop in your keys. The same setup doubles as your production infrastructure.
