Core Concepts
Architecture Modes
Grit supports 5 architecture modes. Choose the one that fits your team, your deployment target, and the frameworks you already know.
Single
--singleGo API + embedded React SPA — one binary
Ideal for: Laravel/Rails developers, solo devs, simple deploys
View example project (Job Portal) →Structure
my-app/ ├── cmd/server/main.go # go:embed frontend/dist/* ├── internal/ # Go backend ├── frontend/ # React + Vite + TanStack Router ├── go.mod └── Makefile # make dev, make build
Features
- -Single binary deployment via go:embed
- -Dev: Go on :8080, Vite on :5173 with proxy
- -make build produces one executable
- -No Node.js needed in production
Double
--doubleWeb + API Turborepo monorepo
Ideal for: MERN stack developers, API + SPA projects
View example project (Job Portal) →Structure
my-app/ ├── apps/ │ ├── api/ # Go backend (Gin + GORM) │ └── web/ # React frontend (Next.js or TanStack) ├── packages/shared/ # Types, schemas, constants ├── turbo.json └── pnpm-workspace.yaml
Features
- -Turborepo for parallel builds
- -Shared TypeScript types + Zod schemas
- -Independent deployment of API and web
- -pnpm workspaces for dependency management
Triple
--triple (default)Web + Admin + API Turborepo monorepo
Ideal for: Full-stack teams, SaaS products, content platforms
View example project (Job Portal) →Structure
my-app/ ├── apps/ │ ├── api/ # Go backend (Gin + GORM) │ ├── web/ # Public-facing frontend │ └── admin/ # Admin panel (DataTable, FormBuilder) ├── packages/shared/ # Types, schemas, constants ├── turbo.json └── pnpm-workspace.yaml
Features
- -Full admin panel with DataTable + FormBuilder
- -Resource definitions for zero-code CRUD
- -Dashboard widgets, system pages
- -grit generate creates Go + admin page
API Only
--apiGo API with no frontend
Ideal for: Microservices, backend teams, mobile-first apps
View example project (Job Portal) →Structure
my-app/ ├── apps/ │ └── api/ # Go backend (Gin + GORM) │ ├── cmd/server/ │ └── internal/ └── docker-compose.yml
Features
- -Minimal footprint — Go only
- -All batteries included (auth, storage, jobs)
- -No Node.js, no frontend build step
- -Perfect for REST/gRPC APIs
Mobile
--mobileAPI + Expo React Native
Ideal for: Mobile-first products, cross-platform apps
View example project (Job Portal) →Structure
my-app/ ├── apps/ │ ├── api/ # Go backend │ └── expo/ # React Native (Expo) ├── packages/shared/ # Shared types └── turbo.json
Features
- -Expo managed workflow
- -Shared types between API and mobile
- -Same auth system (JWT)
- -File upload with presigned URLs
Frontend Framework Choice
For any architecture that includes a frontend (single, double, triple), you can choose between:
Next.js
--next- - Server-side rendering (SSR)
- - SEO-friendly by default
- - App Router with layouts
- - Larger bundle, Node.js runtime
TanStack Router
--vite- - Vite — instant HMR, fast builds
- - Small bundle size (SPA)
- - File-based routing via plugin
- - No Node.js server needed
Example Projects
We built the same Job Portal app with every architecture so you can see exactly how each one works. Each example includes a README, step-by-step guide, .env template, and production Docker Compose.