@donotdev/cli 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dependencies-matrix.json +100 -50
  2. package/dist/bin/commands/agent-setup.js +245 -12
  3. package/dist/bin/commands/build.js +3339 -208
  4. package/dist/bin/commands/bump.js +245 -12
  5. package/dist/bin/commands/cacheout.js +245 -12
  6. package/dist/bin/commands/coach.js +361 -60
  7. package/dist/bin/commands/create-app.js +245 -12
  8. package/dist/bin/commands/create-project.js +253 -12
  9. package/dist/bin/commands/db.js +9114 -2327
  10. package/dist/bin/commands/deploy.js +4074 -694
  11. package/dist/bin/commands/dev.js +347 -33
  12. package/dist/bin/commands/doctor.js +408 -107
  13. package/dist/bin/commands/emu.js +386 -52
  14. package/dist/bin/commands/format.js +245 -12
  15. package/dist/bin/commands/get-demo.js +245 -12
  16. package/dist/bin/commands/make-admin.js +8356 -1516
  17. package/dist/bin/commands/preview.js +347 -33
  18. package/dist/bin/commands/seed.js +9114 -2327
  19. package/dist/bin/commands/setup-cicd.js +452 -132
  20. package/dist/bin/commands/setup.js +407 -107
  21. package/dist/bin/commands/staging.js +4074 -694
  22. package/dist/bin/commands/sync-secrets.js +246 -13
  23. package/dist/bin/commands/type-check.js +245 -12
  24. package/dist/bin/commands/wai.js +245 -12
  25. package/dist/bin/dndev.js +13 -4
  26. package/dist/bin/donotdev.js +13 -4
  27. package/dist/index.js +4169 -812
  28. package/{templates/root-consumer/guides/dndev/advanced/VERSION_CONTROL.md.example → guidelines/VERSION_CONTROL.md} +7 -11
  29. package/package.json +2 -1
  30. package/templates/app-demo/src/themes.css.example +21 -0
  31. package/templates/app-dndev/index.html.example +0 -3
  32. package/templates/app-dndev/src/themes.css.example +21 -0
  33. package/templates/app-next/src/app/layout.tsx.example +13 -4
  34. package/templates/app-next/src/themes.css.example +21 -0
  35. package/templates/app-vite/csp.example.json +44 -0
  36. package/templates/app-vite/index.html.example +0 -3
  37. package/templates/app-vite/src/themes.css.example +21 -0
  38. package/templates/functions-supabase/supabase/migrations/20250101000000_idempotency.sql +3 -0
  39. package/templates/functions-supabase/supabase/migrations/20250101000001_rate_limits.sql +3 -0
  40. package/templates/functions-supabase/supabase/migrations/20250101000003_operation_metrics.sql +3 -0
  41. package/templates/root-consumer/.claude/hooks/framework-compliance.sh.example +56 -0
  42. package/templates/root-consumer/.claude/hooks/guard-bash.sh.example +61 -0
  43. package/templates/root-consumer/.claude/hooks/guard-files.sh.example +46 -0
  44. package/templates/root-consumer/.claude/hooks/guard-mcp.sh.example +91 -0
  45. package/templates/root-consumer/.claude/hooks/guard-secrets.sh.example +67 -0
  46. package/templates/root-consumer/.claude/hooks/guard-write.sh.example +89 -0
  47. package/templates/root-consumer/.claude/hooks/session-start.sh.example +50 -0
  48. package/templates/root-consumer/.claude/hooks/track-mcp-lookup.sh.example +20 -0
  49. package/templates/root-consumer/.claude/hooks/typecheck-stop.sh.example +18 -0
  50. package/templates/root-consumer/.claude/rules/consumer-ux.md.example +32 -0
  51. package/templates/root-consumer/.claude/rules/definition-of-done.md.example +32 -0
  52. package/templates/root-consumer/.claude/rules/framework.md.example +39 -0
  53. package/templates/root-consumer/.claude/rules/git.md.example +14 -0
  54. package/templates/root-consumer/.claude/rules/security.md.example +13 -0
  55. package/templates/root-consumer/.claude/settings.json.example +123 -1
  56. package/templates/root-consumer/.claude/skills/build/SKILL.md.example +103 -25
  57. package/templates/root-consumer/.claude/skills/grill/SKILL.md.example +26 -15
  58. package/templates/root-consumer/.claude/skills/polish/SKILL.md.example +50 -37
  59. package/templates/root-consumer/AI.md.example +2 -2
  60. package/templates/root-consumer/CLAUDE.md.example +33 -1
  61. package/templates/root-consumer/guides/dndev/INDEX.md.example +23 -27
  62. package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +3 -2
  63. package/templates/root-consumer/guides/dndev/SETUP_OAUTH.md.example +10 -5
  64. package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +50 -3
  65. package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +13 -15
  66. package/templates/app-demo/public/manifest.json.example +0 -10
  67. package/templates/app-dndev/public/manifest.json.example +0 -10
  68. package/templates/root-consumer/.claude/commands/brainstorm.md.example +0 -175
  69. package/templates/root-consumer/.claude/commands/build.md.example +0 -131
  70. package/templates/root-consumer/.claude/commands/design.md.example +0 -184
  71. package/templates/root-consumer/.claude/commands/grill.md.example +0 -135
  72. package/templates/root-consumer/.claude/commands/polish.md.example +0 -146
  73. package/templates/root-consumer/.claude/commands/techdebt.md.example +0 -28
  74. package/templates/root-consumer/guides/dndev/COMPONENTS_ATOMIC.md.example +0 -180
  75. package/templates/root-consumer/guides/dndev/COMPONENTS_CRUD.md.example +0 -234
  76. package/templates/root-consumer/guides/dndev/COMPONENTS_UI.md.example +0 -136
  77. package/templates/root-consumer/guides/dndev/COMPONENT_API.md.example +0 -195
  78. package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +0 -219
  79. package/templates/root-consumer/guides/dndev/GOTCHAS.md.example +0 -197
  80. package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +0 -132
  81. package/templates/root-consumer/guides/dndev/SETUP_BLOG.md.example +0 -280
  82. package/templates/root-consumer/guides/dndev/SETUP_CICD.md.example +0 -115
  83. package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +0 -334
  84. package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +0 -9
  85. package/templates/root-consumer/guides/dndev/SETUP_I18N.md.example +0 -233
  86. package/templates/root-consumer/guides/dndev/SETUP_LAYOUTS.md.example +0 -158
  87. package/templates/root-consumer/guides/dndev/SETUP_PAGES.md.example +0 -205
  88. package/templates/root-consumer/guides/dndev/SETUP_PWA.md.example +0 -213
  89. package/templates/root-consumer/guides/dndev/SETUP_TESTING.md.example +0 -184
  90. package/templates/root-consumer/guides/dndev/SETUP_THEMES.md.example +0 -111
  91. package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +0 -260
  92. package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +0 -499
  93. package/templates/root-consumer/guides/dndev/essences_reference.css.example +0 -288
@@ -1,136 +0,0 @@
1
- # UI Package Reference
2
-
3
- **Check JSDoc in your IDE** - Hover over any component import to see props, types, and examples.
4
-
5
- **Import from:** `@donotdev/ui` (layout/composition components)
6
-
7
- ---
8
-
9
- ## Layout Components
10
-
11
- - **PageContainer** - Page wrapper with width constraints, spacing, and density system.
12
- - **GameContainer** - Game preset container with fixed header/footer layout.
13
- - **GameFlow** - Game flow component for step-by-step game interfaces.
14
-
15
- ---
16
-
17
- ## Layout Sub-Components
18
-
19
- - **AppBranding** - App branding display with logo and name.
20
- - **AppIcon** - App icon component.
21
- - **AppTitle** - App title display component.
22
- - **GameTitle** - Game title component for game preset.
23
- - **Breadcrumbs** - Breadcrumb navigation component.
24
- - **HeaderNavigation** - Header navigation menu component.
25
- - **DropdownNavigation** - Dropdown navigation menu.
26
- - **HeaderMenu** - Header menu component.
27
- - **SettingsMenu** - Settings menu component.
28
- - **ThemeToggle** - Theme toggle button component.
29
- - **CacheSettings** - Cache settings component.
30
- - **Notifications** - Notifications component.
31
- - **FloatingLanguageSwitcher** - Floating language selector component.
32
-
33
- ---
34
-
35
- ## Auth Components
36
-
37
- - **AuthHeader** - Header component with authentication UI (sign in/out, user menu).
38
- - **AuthMenu** - Authentication menu component.
39
-
40
- ---
41
-
42
- ## Helpers
43
-
44
- - **tList(t, key, count, icon?, size?)** - Translated array as List. Default: CheckCircle icon. Pass `null` for no icon (use with emoji labels).
45
-
46
- ---
47
-
48
- ## Common Components
49
-
50
- - **FeatureDisabled** - Component shown when features are disabled.
51
- - **Icon** - Icon component wrapper.
52
- - **ProgressBar** - Progress bar component.
53
- - **Skeleton** - Skeleton loading component (consumer use, not used internally).
54
- - **FeatureCard** - Feature showcase card component.
55
- - **TechBento** - Tech stack showcase component.
56
-
57
- ---
58
-
59
- ## Routing Components
60
-
61
- - **Link** - Platform-agnostic link component (works in Vite + Next.js).
62
- - **AuthGuard** - Route guard component for protected routes.
63
- - **AuthGuardFallback** - Fallback component for auth-guarded routes.
64
- - **GoTo** - Programmatic navigation component.
65
- - **GoToWrapper** - Wrapper for GoTo navigation.
66
- - **GoToInput** - Input component for GoTo navigation.
67
- - **GoToDialog** - Dialog for GoTo navigation.
68
- - **DnDevNavigationMenu** - Framework navigation menu component.
69
- - **NotFoundPage** - 404 page component.
70
-
71
- ---
72
-
73
- ## Routing Hooks
74
-
75
- - **useNavigate** - Navigate to routes programmatically.
76
- - **useBack** - Navigate back in history.
77
- - **useRefresh** - Refresh current route.
78
- - **usePrefetch** - Prefetch route data.
79
- - **useLocation** - Get current location.
80
- - **useParams** - Get route parameters.
81
- - **useSearchParams** - Get URL search parameters. Returns `URLSearchParams` directly (NOT a tuple). Use `.get('key')` to read values.
82
- - **useMatch** - Match current route pattern.
83
- - **useQueryParams** - Get and set query parameters.
84
- - **useRedirectGuard** - Guard against redirects.
85
- - **useNavigation** - Navigation state and methods.
86
- - **useGoTo** - GoTo navigation hook.
87
- - **useRouteDiscovery** - Route discovery hook.
88
-
89
- ---
90
-
91
- ## Cookie Consent
92
-
93
- - **CookieConsent** - Cookie consent management component.
94
- - **ConsentBanner** - Cookie consent banner component.
95
-
96
- ---
97
-
98
- ## Platform-Specific Providers
99
-
100
- - **ViteAppProviders** - App providers for Vite (import from `@donotdev/ui/vite`).
101
- - **NextJsAppProviders** - App providers for Next.js (import from `@donotdev/ui/next`).
102
-
103
- ---
104
-
105
- ## CRUD Display Components (from @donotdev/ui)
106
-
107
- - **DisplayFieldRenderer** - Renders read-only field displays.
108
- - **EntityDisplayRenderer** - Renders complete entity displays.
109
- - **TextFieldDisplay** - Text field display component.
110
- - **BadgeFieldDisplay** - Badge field display component.
111
- - **AvatarFieldDisplay** - Avatar field display component.
112
- - **LinkFieldDisplay** - Link field display component.
113
- - **DateFieldDisplay** - Date field display component.
114
- - **NumberFieldDisplay** - Number field display component.
115
- - **PhoneNumberDisplay** - Phone number display component.
116
- - **TextAreaDisplay** - Textarea display component.
117
- - **CheckboxFieldDisplay** - Checkbox display component.
118
- - **DropdownDisplay** - Dropdown display component.
119
- - **MultiDropdownDisplay** - Multi-select dropdown display component.
120
- - **MultiInputTextFieldDisplay** - Multi-input text field display component.
121
- - **RadioFieldDisplay** - Radio field display component.
122
- - **RangeFieldDisplay** - Range field display component.
123
- - **FileFieldDisplay** - File field display component.
124
- - **ImageFieldDisplay** - Image field display component.
125
- - **GeoPointFieldDisplay** - GeoPoint field display component.
126
- - **MapFieldDisplay** - Map field display component.
127
- - **ReferenceFieldDisplay** - Reference field display component.
128
- - **TimestampFieldDisplay** - Timestamp field display component.
129
- - **HiddenFieldDisplay** - Hidden field display component.
130
- - **ButtonFieldDisplay** - Button field display component.
131
-
132
- ---
133
-
134
- **For MVP:** Only `PageContainer` is needed. All other components are optional.
135
-
136
- **All props documented in JSDoc** - Hover in IDE for complete reference.
@@ -1,195 +0,0 @@
1
- # Component API Reference
2
-
3
- **SOURCE OF TRUTH. If prop not listed here, it does not exist.**
4
-
5
- ---
6
-
7
- ## Button
8
- ```tsx
9
- <Button>Label</Button>
10
- <Button variant="primary">Label</Button>
11
- <Button onClick={fn}>Label</Button>
12
- ```
13
- | Prop | Type | Default |
14
- |------|------|---------|
15
- | variant | `'default'` \| `'primary'` \| `'secondary'` \| `'accent'` \| `'destructive'` \| `'ghost'` \| `'outline'` \| `'link'` | `'default'` |
16
- | icon | `LucideIcon` \| `ReactNode` | - |
17
- | iconEnd | `boolean` | `false` |
18
- | display | `'auto'` \| `'compact'` \| `'full'` | `'auto'` |
19
- | tooltip | `string` | - |
20
- | floating | `boolean` | `false` |
21
- | fullWidth | `boolean` | `false` |
22
- | loading | `boolean` | `false` |
23
- | loadingText | `string` | - |
24
- | progress | `number` (0-100) | - |
25
- | disabled | `boolean` | `false` |
26
- | render | `(props) => ReactNode` | - |
27
-
28
- **NO: size, tone, gap**
29
-
30
- ---
31
-
32
- ## Text
33
- ```tsx
34
- <Text>Content</Text>
35
- <Text level="h1">Heading</Text>
36
- <Text as="p">Paragraph</Text>
37
- ```
38
- | Prop | Type | Default |
39
- |------|------|---------|
40
- | as | `'h1'`-`'h6'` \| `'p'` \| `'span'` \| `'div'` \| `'li'` \| `'label'` \| `'code'` | `'div'` |
41
- | level | `'h1'`-`'h6'` \| `'body'` \| `'small'` \| `'caption'` | auto from `as` |
42
- | variant | `'default'` \| `'muted'` \| `'primary'` \| `'secondary'` \| `'accent'` \| `'success'` \| `'warning'` \| `'destructive'` \| `'code'` | `'default'` |
43
- | align | `'start'` \| `'center'` \| `'end'` | `'start'` |
44
- | weight | `'normal'` \| `'medium'` \| `'semibold'` \| `'bold'` | - |
45
-
46
- **NO: size, tone, color**
47
-
48
- ---
49
-
50
- ## Stack
51
- ```tsx
52
- <Stack>children</Stack>
53
- <Stack direction="row">children</Stack>
54
- ```
55
- | Prop | Type | Default |
56
- |------|------|---------|
57
- | as | `ElementType` | `'div'` |
58
- | direction | `'row'` \| `'column'` \| `'row-reverse'` \| `'column-reverse'` | `'column'` |
59
- | align | `'start'` \| `'center'` \| `'end'` \| `'stretch'` \| `'baseline'` | `'stretch'` |
60
- | justify | `'start'` \| `'center'` \| `'end'` \| `'between'` \| `'around'` \| `'evenly'` | `'start'` |
61
- | gap | `'none'` \| `'tight'` \| `'medium'` \| `'large'` | `'medium'` |
62
- | wrap | `'nowrap'` \| `'wrap'` \| `'wrap-reverse'` | `'nowrap'` |
63
- | width | `'full'` \| `'fit'` \| `'auto'` | `'full'` |
64
- | centered | `boolean` | `false` |
65
-
66
- **NO: spacing, size**
67
-
68
- ---
69
-
70
- ## Card
71
- ```tsx
72
- <Card>children</Card>
73
- <Card title="Title">children</Card>
74
- <Card onClick={fn}>children</Card>
75
- ```
76
- | Prop | Type | Default |
77
- |------|------|---------|
78
- | variant | `'default'` \| `'muted'` \| `'primary'` \| `'secondary'` \| `'accent'` | `'default'` |
79
- | title | `string` \| `ReactNode` | - |
80
- | subtitle | `string` \| `ReactNode` | - |
81
- | icon | `LucideIcon` | - |
82
- | content | `string` \| `string[]` \| `ReactNode` | - |
83
- | footer | `ReactNode` | - |
84
- | onClick | `() => void` | - |
85
- | clickable | `boolean` | auto from onClick |
86
- | elevated | `boolean` | `false` |
87
- | asChild | `boolean` | `false` |
88
-
89
- **NO: size, padding, margin**
90
-
91
- ---
92
-
93
- ## Grid
94
- ```tsx
95
- <Grid>children</Grid>
96
- <Grid cols={3}>children</Grid>
97
- <Grid cols={[1, 1, 2, 3]}>children</Grid>
98
- ```
99
- | Prop | Type | Default |
100
- |------|------|---------|
101
- | as | `ElementType` | `'div'` |
102
- | cols | `number` \| `[mobile, tablet, laptop, desktop]` | `1` |
103
- | gap | `'none'` \| `'tight'` \| `'medium'` \| `'large'` | `'medium'` |
104
- | align | `'start'` \| `'center'` \| `'end'` \| `'stretch'` | `'stretch'` |
105
- | justify | `'start'` \| `'center'` \| `'end'` \| `'stretch'` | `'stretch'` |
106
-
107
- **NO: spacing, columns (use cols)**
108
-
109
- ---
110
-
111
- ## Section
112
- ```tsx
113
- <Section title="Title">children</Section>
114
- ```
115
- | Prop | Type | Default |
116
- |------|------|---------|
117
- | as | `'section'` \| `'article'` \| `'aside'` \| `'div'` \| `'main'` | `'section'` |
118
- | title | `string` | - |
119
- | separator | `boolean` | `false` |
120
- | tone | `'base'` \| `'muted'` \| `'elevated'` \| `'contrast'` \| `'accent'` | `'base'` |
121
- | align | `'start'` \| `'center'` \| `'end'` | `'center'` |
122
- | gridCols | `number` \| `[mobile, tablet, laptop, desktop]` | - |
123
- | gridGap | `'none'` \| `'tight'` \| `'medium'` \| `'large'` | `'medium'` |
124
- | collapsible | `boolean` | `false` |
125
- | defaultOpen | `boolean` | `false` |
126
-
127
- **NO: padding, margin, background**
128
-
129
- ---
130
-
131
- ## Badge
132
- ```tsx
133
- <Badge>Label</Badge>
134
- <Badge variant="primary">Label</Badge>
135
- ```
136
- | Prop | Type | Default |
137
- |------|------|---------|
138
- | as | `'div'` \| `'span'` \| `'mark'` | `'div'` |
139
- | variant | `'default'` \| `'muted'` \| `'primary'` \| `'secondary'` \| `'accent'` \| `'success'` \| `'warning'` \| `'destructive'` \| `'outline'` | `'default'` |
140
- | tooltip | `string` | - |
141
-
142
- **NO: size, color**
143
-
144
- ---
145
-
146
- ## Spinner
147
- ```tsx
148
- <Spinner />
149
- <Spinner overlay />
150
- ```
151
- | Prop | Type | Default |
152
- |------|------|---------|
153
- | overlay | `boolean` | `false` |
154
- | variant | `'default'` \| `'primary'` \| `'secondary'` \| `'accent'` \| `'success'` \| `'warning'` \| `'destructive'` | `'primary'` |
155
-
156
- **NO: size**
157
-
158
- ---
159
-
160
- ## Separator
161
- ```tsx
162
- <Separator />
163
- ```
164
- | Prop | Type | Default |
165
- |------|------|---------|
166
- | orientation | `'horizontal'` \| `'vertical'` | `'horizontal'` |
167
- | variant | `'default'` \| `'muted'` \| `'accent'` | `'default'` |
168
-
169
- ---
170
-
171
- ## EntityFormRenderer
172
- ```tsx
173
- <EntityFormRenderer entity={entity} operation="create" onSubmit={fn} />
174
- ```
175
- | Prop | Type | Default |
176
- |------|------|---------|
177
- | entity | `Entity` | required |
178
- | operation | `'create'` \| `'edit'` | `'create'` |
179
- | onSubmit | `(data) => void` | required |
180
- | defaultValues | `Record<string, unknown>` | - |
181
- | loading | `boolean` | `false` |
182
- | submitText | `string` | - |
183
- | cancelText | `string` | - |
184
- | onCancel | `() => void` | - |
185
- | viewerRole | `string` | `'guest'` |
186
-
187
- **NO: fields (renders all editable fields automatically)**
188
-
189
- ---
190
-
191
- ## BEFORE WRITING JSX
192
-
193
- 1. Check this file
194
- 2. If prop not listed → don't use it
195
- 3. When in doubt → use defaults only
@@ -1,219 +0,0 @@
1
- # Getting Started
2
-
3
- **The complete onboarding flow — from `dndev init` to deployed app.**
4
-
5
- If you haven’t run `dndev init` yet, see [AGENT_START_HERE.md](./AGENT_START_HERE.md) § **Getting started (for humans)** (P0 → Install CLI → Run AI.md → Enjoy).
6
-
7
- ---
8
-
9
- ## The Flow
10
-
11
- ```
12
- bun install → install dependencies
13
- dndev dev → start app, read the homepage setup guide
14
- dndev coach → see what to configure (numbered checklist)
15
- (fill in .env values from dashboard)
16
- dndev setup → validate .env, automate provider config
17
- dndev doctor → health check
18
- dndev emu start → test locally with emulators (Firebase)
19
- dndev deploy → deploy to production
20
- ```
21
-
22
- ---
23
-
24
- ## Step 1: Install & Run
25
-
26
- ```bash
27
- bun install
28
- dndev dev
29
- ```
30
-
31
- Open the app. The homepage shows every setup step with instructions.
32
-
33
- ---
34
-
35
- ## Step 2: Git
36
-
37
- ```bash
38
- git init
39
- git add . && git commit -m "Initial scaffold"
40
- ```
41
-
42
- Create a repo on GitHub, then:
43
-
44
- ```bash
45
- git remote add origin <your-repo-url>
46
- git push -u origin main
47
- ```
48
-
49
- ---
50
-
51
- ## Step 3: Backend Setup
52
-
53
- ### 1. See what to configure
54
-
55
- ```bash
56
- dndev coach
57
- ```
58
-
59
- Prints a numbered checklist: which dashboard to visit, what to copy, where to paste it. No automation, no prompts.
60
-
61
- ### 2. Fill in credentials
62
-
63
- Follow the coach checklist. Paste **public** credentials into `apps/<app>/.env`, and **secret** keys into `.dndev.secrets` at project root.
64
-
65
- ### 3. Run setup
66
-
67
- ```bash
68
- dndev setup
69
- ```
70
-
71
- Validates all required env vars are present, runs provider automation (CLI linking, migrations, etc.), and runs an inline health check. If values are missing, it tells you which ones and points you back to `dndev coach`.
72
-
73
- See [SETUP_FIREBASE.md](./SETUP_FIREBASE.md) or [SETUP_SUPABASE.md](./SETUP_SUPABASE.md) for full details. See [Secrets Philosophy](#secrets-philosophy) for how we handle secret keys.
74
-
75
- ---
76
-
77
- ## Step 4: Test Locally
78
-
79
- ```bash
80
- dndev emu start # Firebase emulators
81
- ```
82
-
83
- Select services: Auth + Firestore + Functions. This starts Firebase emulators so you can develop without touching production.
84
-
85
- For Supabase, development runs against your Supabase project directly (or use `supabase start` for local Supabase if installed).
86
-
87
- ---
88
-
89
- ## Step 5: Build With AI
90
-
91
- Open the project in **Cursor**, **Claude Code**, **Windsurf**, or **AntiGravity**.
92
-
93
- The AI reads `AI.md` and follows the WAI-WAY protocol:
94
- - Phase 0: Brainstorm -> produce a spec
95
- - Phase 1: Scaffold -> create pages
96
- - Phase 2: Entities -> define data models
97
- - Phase 3: Compose -> build pages with components
98
- - Phase 4: Configure -> generate tests, firestore rules, CI/CD
99
-
100
- Read `guides/wai-way/WAI_WAY_CLI.md` for the full workflow.
101
-
102
- ---
103
-
104
- ## Step 6: Deploy
105
-
106
- ```bash
107
- dndev deploy
108
- ```
109
-
110
- Deploys hosting + functions + rules. Syncs runtime secrets automatically before deploying functions.
111
-
112
- ---
113
-
114
- ## Secrets Philosophy
115
-
116
- **DoNotDev follows strict rules about credentials:**
117
-
118
- ### Tier 1: Public Keys -- We Ask Directly
119
-
120
- These are safe to share, shipped in your client JS bundle. We ask for them during setup.
121
-
122
- | Key | Where It Goes |
123
- |-----|--------------|
124
- | Firebase API key, project ID, auth domain, etc. | `apps/<app>/.env` as `VITE_FIREBASE_*` |
125
- | Supabase project URL | `apps/<app>/.env` as `VITE_SUPABASE_URL` |
126
- | Supabase anon key (public JWT) | `apps/<app>/.env` as `VITE_SUPABASE_ANON_KEY` |
127
- | Stripe publishable key | `apps/<app>/.env` as `VITE_STRIPE_PUBLISHABLE_KEY` |
128
-
129
- ### Tier 2: Secret Keys -- One File, Project Root
130
-
131
- All secret keys go in **`.dndev.secrets`** at project root (gitignored). One file, every secret.
132
-
133
- | Key | How To Get It |
134
- |-----|---------------|
135
- | `VERCEL_TOKEN` | https://vercel.com/account/tokens |
136
- | `SUPABASE_SECRET_KEY` | Supabase Dashboard → Settings → API |
137
- | `SUPABASE_ACCESS_TOKEN` | https://supabase.com/dashboard/account/tokens |
138
- | `STRIPE_SECRET_KEY` | https://dashboard.stripe.com/apikeys |
139
- | `STRIPE_WEBHOOK_SECRET` | Stripe Dashboard → Webhooks |
140
-
141
- Resolution order: `process.env` (CI) → `.dndev.secrets` (local) → legacy paths (with warning).
142
-
143
- Then sync to your runtime:
144
-
145
- ```bash
146
- dndev sync-secrets # -> Firebase Secret Manager or Vercel env
147
- dndev sync-secrets --target github # -> GitHub Secrets (for CI/CD)
148
- ```
149
-
150
- ### Tier 3: Service Account Files -- Download, Place, Gitignore
151
-
152
- | File | Where It Goes | How To Get It |
153
- |------|--------------|---------------|
154
- | `service-account-key.json` | App root (next to firebase.json) | Firebase Console -> Settings -> Service Accounts |
155
- | `service-account-key.staging.json` | Same location, for staging | Same, from staging project |
156
-
157
- These files are `.gitignored`. Never commit them. For CI/CD, upload the file content as a GitHub Secret and decode it in your workflow.
158
-
159
- ---
160
-
161
- ## Environment Variables
162
-
163
- **Public config** lives in each app's `.env`. **Secrets** live in `.dndev.secrets` at project root.
164
-
165
- ```
166
- my-project/
167
- +-- .dndev.secrets <-- ALL secrets (gitignored)
168
- +-- .dndev.secrets.example <-- Template (committed)
169
- +-- apps/
170
- | +-- my-app/
171
- | +-- .env <-- Public keys: VITE_*, VERCEL_ORG_ID, VERCEL_PROJECT_ID
172
- | +-- .env.staging <-- Used by dndev staging
173
- | +-- .env.production <-- Production overrides
174
- | +-- service-account-key.json <-- Firebase SA (gitignored)
175
- ```
176
-
177
- **Rules:**
178
- - `VITE_*` / `NEXT_PUBLIC_*` vars → `apps/<app>/.env` (public, shipped to browser)
179
- - `VERCEL_ORG_ID` / `VERCEL_PROJECT_ID` → `apps/<app>/.env` (public, per-app)
180
- - All secret keys → `.dndev.secrets` at project root (one file, gitignored)
181
- - Service account files → app root, gitignored
182
-
183
- ---
184
-
185
- ## CLI Commands
186
-
187
- | Command | What It Does |
188
- |---------|-------------|
189
- | `dndev dev` | Start dev server |
190
- | `dndev emu start` | Start Firebase emulators |
191
- | `dndev coach` | Show what to configure (numbered checklist) |
192
- | `dndev setup` | Validate .env, automate provider config, health check |
193
- | `dndev doctor` | Check project health (providers, .env) |
194
- | `dndev deploy` | **Firebase:** hosting + functions + rules. **Supabase:** deploys frontend to [Vercel](https://vercel.com) (via scaffolded vercel.json) and Edge Functions to Supabase. Set `VITE_SUPABASE_*` in Vercel project env. |
195
- | `dndev staging` | Deploy to staging environment |
196
- | `dndev sync-secrets` | Push .dndev.secrets to runtime (Firebase/Vercel) |
197
- | `dndev sync-secrets --target github` | Push secrets to GitHub Secrets (CI/CD) |
198
- | `bun test` | Run tests (after Phase 4) |
199
- | `bun run type-check` | TypeScript validation |
200
-
201
- ---
202
-
203
- ## What's Optional
204
-
205
- | Feature | Required? | When to Set Up |
206
- |---------|-----------|---------------|
207
- | Git + GitHub | Recommended | Before starting development |
208
- | Firebase or Supabase | Yes (pick one) | Before building any features |
209
- | Cloud Functions | If using server logic | Before deploying functions |
210
- | Stripe | If using billing | When adding payment features |
211
- | GitHub Actions CI/CD | Optional | Phase 4 generates the workflow |
212
- | Staging environment | Optional | When you want a test environment |
213
- | Custom domain | Optional | After first deploy |
214
- | Sentry | Optional | When you want error tracking |
215
- | i18n | Optional | Phase 4 or after launch |
216
-
217
- ---
218
-
219
- **Start here: `bun install && dndev dev`. The homepage tells you everything else.**