You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: add detailed architecture pages for all 5 modes + update knowledge base
New docs pages with full folder structures, data flow diagrams,
code generation specifics, deployment guides, and example links:
- /docs/concepts/architecture-modes/triple
- /docs/concepts/architecture-modes/double
- /docs/concepts/architecture-modes/single
- /docs/concepts/architecture-modes/api-only
- /docs/concepts/architecture-modes/mobile
Sidebar updated with all 5 architecture sub-pages.
Knowledge base updated with docs links, example links, folder structures,
and key differences for each architecture.
Copy file name to clipboardExpand all lines: GRIT_KNOWLEDGE_BASE.txt
+60-29Lines changed: 60 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -63,56 +63,87 @@ ARCHITECTURE MODES
63
63
When you run "grit new myapp", the CLI enters interactive mode and asks you to choose an architecture. This is one of Grit's most powerful features — you pick the structure that matches your project's needs.
64
64
65
65
1. TRIPLE (Web + Admin + API)
66
-
Command: grit new myapp --triple
66
+
Command: grit new myapp --triple --next (or --vite)
Structure: Turborepo monorepo with two apps (NO admin panel)
78
93
- apps/api/ — Go backend
79
-
- apps/web/ — Frontend
94
+
- apps/web/ — Frontend (admin features via role-protected routes)
80
95
- packages/shared/ — Shared types
81
-
Best for: Simpler apps that don't need a separate admin panel, marketing sites with a backend, blogs
96
+
Key difference: No apps/admin/. ADMIN users access management features within the web app itself via role-protected routes. Code generation creates fewer files (no admin resource/page).
97
+
Best for: Simpler apps, blogs, portfolios, apps where admins use the same UI as users
82
98
83
99
3. SINGLE (Embedded SPA)
84
-
Command: grit new myapp --single
85
-
Structure: Single Go binary with embedded frontend
86
-
- main.go at the project root with go:embed
87
-
- internal/ — Go backend code
88
-
- frontend/ — React SPA (built and embedded into the binary)
89
-
Best for: Laravel/Next.js developers who want one deployable unit, microservices, internal tools
90
-
This is similar to how Laravel or Next.js work — one app, one deployment, one binary.
91
-
In development, Go runs on port 8080 and Vite runs on port 5173 with a proxy.
92
-
In production, the frontend is compiled and embedded into the Go binary using go:embed.
Structure: Pure Go API — no frontend, no React, no Node.js, no pnpm
121
+
- apps/api/ — Go backend only
122
+
Key differences: No TypeScript, no Zod schemas, no React. Code generation only creates Go files. All batteries still work (auth, storage, email, jobs, AI, TOTP). Test via /docs (Scalar/Swagger), curl, or Postman.
123
+
Best for: Mobile app backends, microservices, headless CMS, third-party APIs
Structure: Turborepo monorepo with API and Expo React Native
104
130
- apps/api/ — Go backend
105
-
- apps/expo/ — React Native (Expo) mobile app
106
-
Best for: Mobile-first applications
131
+
- apps/expo/ — Expo React Native (Expo Router for navigation)
132
+
- packages/shared/ — Shared types between API and mobile
133
+
Key differences: SecureStore for encrypted token storage (not localStorage), Expo Router for tab/stack navigation, FlatList instead of HTML tables, push notifications via Expo Notifications, physical device needs local IP (not localhost)
134
+
Best for: Mobile-first applications, cross-platform apps
107
135
108
136
6. DESKTOP (Wails)
109
137
Command: grit new-desktop myapp
110
138
Structure: Standalone Wails desktop application
111
-
- Go backend with Wails v2 bindings
139
+
- Go backend with Wails v2 bindings (methods callable from React)
112
140
- React frontend (Vite + TanStack Router)
113
-
- SQLite database (local)
141
+
- SQLite database (local, no Docker needed)
114
142
Best for: Cross-platform desktop tools, offline-first apps
115
143
144
+
ALL EXAMPLES: https://github.com/MUKE-coder/grit/tree/main/examples
145
+
Same Job Portal built with every architecture — full source, setup guide, deployment config.
0 commit comments