@donotdev/cli 0.0.5 → 0.0.7
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.
- package/dependencies-matrix.json +76 -34
- package/dist/bin/commands/build.js +165 -161
- package/dist/bin/commands/bump.js +172 -160
- package/dist/bin/commands/cacheout.js +163 -157
- package/dist/bin/commands/create-app.js +205 -163
- package/dist/bin/commands/create-project.js +176 -161
- package/dist/bin/commands/deploy.js +480 -472
- package/dist/bin/commands/dev.js +164 -158
- package/dist/bin/commands/emu.js +164 -158
- package/dist/bin/commands/format.js +163 -157
- package/dist/bin/commands/lint.js +166 -157
- package/dist/bin/commands/make-admin.d.ts +11 -0
- package/dist/bin/commands/make-admin.d.ts.map +1 -0
- package/dist/bin/commands/make-admin.js +12 -0
- package/dist/bin/commands/make-admin.js.map +1 -0
- package/dist/bin/commands/preview.js +164 -158
- package/dist/bin/commands/sync-secrets.js +164 -158
- package/dist/bin/commands/wai.d.ts +11 -0
- package/dist/bin/commands/wai.d.ts.map +1 -0
- package/dist/bin/commands/wai.js +12 -0
- package/dist/bin/commands/wai.js.map +1 -0
- package/dist/bin/dndev.js +24 -8
- package/dist/bin/donotdev.js +24 -8
- package/dist/index.js +557 -514
- package/package.json +1 -1
- package/templates/app-demo/index.html.example +4 -0
- package/templates/app-demo/src/App.tsx.example +28 -10
- package/templates/app-demo/src/config/app.ts.example +68 -0
- package/templates/app-next/src/app/ClientLayout.tsx.example +4 -3
- package/templates/app-next/src/app/layout.tsx.example +17 -25
- package/templates/app-next/src/config/app.ts.example +75 -48
- package/templates/app-next/src/globals.css.example +10 -7
- package/templates/app-next/src/locales/dndev_en.json.example +68 -0
- package/templates/app-next/src/pages/locales/example_en.json.example +5 -0
- package/templates/app-vite/index.html.example +71 -34
- package/templates/app-vite/src/config/app.ts.example +75 -47
- package/templates/app-vite/src/globals.css.example +14 -6
- package/templates/app-vite/src/locales/dndev_en.json.example +68 -0
- package/templates/app-vite/src/pages/FormPageExample.tsx.example +152 -0
- package/templates/app-vite/src/pages/HomePage.tsx.example +81 -134
- package/templates/app-vite/src/pages/ListPageExample.tsx.example +88 -0
- package/templates/functions-firebase/README.md.example +25 -0
- package/templates/functions-firebase/build.mjs.example +8 -1
- package/templates/functions-firebase/functions-firebase/build.mjs.example +8 -1
- package/templates/functions-firebase/functions-firebase/src/index.ts.example +19 -25
- package/templates/functions-firebase/functions.config.js.example +35 -0
- package/templates/functions-firebase/tsconfig.json.example +3 -13
- package/templates/functions-vercel/tsconfig.json.example +1 -13
- package/templates/root-consumer/entities/ExampleEntity.ts.example +223 -0
- package/templates/root-consumer/entities/demo.ts.example +562 -0
- package/templates/root-consumer/entities/index.ts.example +15 -0
- package/templates/root-consumer/firebase.json.example +1 -1
- package/templates/root-consumer/guides/{AGENT_START_HERE.md.example → dndev/AGENT_START_HERE.md.example} +22 -0
- package/templates/root-consumer/guides/{COMPONENTS_ADV.md.example → dndev/COMPONENTS_ADV.md.example} +456 -360
- package/templates/root-consumer/guides/{COMPONENTS_ATOMIC.md.example → dndev/COMPONENTS_ATOMIC.md.example} +42 -0
- package/templates/root-consumer/guides/dndev/COMPONENTS_CRUD.md.example +231 -0
- package/templates/root-consumer/guides/{INDEX.md.example → dndev/INDEX.md.example} +3 -0
- package/templates/root-consumer/guides/{SETUP_APP_CONFIG.md.example → dndev/SETUP_APP_CONFIG.md.example} +5 -2
- package/templates/root-consumer/guides/{SETUP_AUTH.md.example → dndev/SETUP_AUTH.md.example} +30 -0
- package/templates/root-consumer/guides/{SETUP_BILLING.md.example → dndev/SETUP_BILLING.md.example} +44 -4
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +473 -0
- package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +116 -0
- package/templates/root-consumer/guides/{SETUP_PAGES.md.example → dndev/SETUP_PAGES.md.example} +17 -0
- package/templates/root-consumer/guides/dndev/SETUP_PWA.md.example +213 -0
- package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +503 -0
- package/templates/root-consumer/guides/wai-way/WAI_WAY_CLI.md.example +404 -0
- package/templates/root-consumer/guides/wai-way/agents/architect.md.example +78 -0
- package/templates/root-consumer/guides/wai-way/agents/builder.md.example +87 -0
- package/templates/root-consumer/guides/wai-way/agents/extractor.md.example +325 -0
- package/templates/root-consumer/guides/wai-way/agents/polisher.md.example +100 -0
- package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +281 -0
- package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +77 -0
- package/templates/root-consumer/guides/wai-way/blueprints/2_entities.md.example +104 -0
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +124 -0
- package/templates/root-consumer/guides/wai-way/blueprints/4_configure.md.example +165 -0
- package/templates/root-consumer/guides/wai-way/context_map.json.example +95 -0
- package/templates/root-consumer/guides/wai-way/entity_patterns.md.example +840 -0
- package/templates/root-consumer/guides/wai-way/page_patterns.md.example +686 -0
- package/templates/root-consumer/guides/wai-way/presets_guide.md.example +217 -0
- package/templates/root-consumer/guides/wai-way/spec_template.md.example +312 -0
- package/templates/root-consumer/vercel.json.example +315 -20
- package/templates/app-demo/src/Routes.tsx.example +0 -20
- package/templates/app-vite/src/Routes.tsx.example +0 -16
- package/templates/app-vite/src/pages/locales/README.md.example +0 -1
- package/templates/functions-firebase/functions-firebase/src/crud/createEntity.ts.example +0 -19
- package/templates/functions-firebase/functions-firebase/src/crud/deleteEntity.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/crud/getEntity.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/crud/index.ts.example +0 -12
- package/templates/functions-firebase/functions-firebase/src/crud/listEntities.ts.example +0 -14
- package/templates/functions-firebase/functions-firebase/src/crud/updateEntity.ts.example +0 -14
- package/templates/root-consumer/guides/COMPONENTS_CRUD.md.example +0 -70
- package/templates/root-consumer/guides/SETUP_FUNCTIONS.md.example +0 -62
- /package/templates/root-consumer/guides/{COMPONENTS_UI.md.example → dndev/COMPONENTS_UI.md.example} +0 -0
- /package/templates/root-consumer/guides/{ENV_SETUP.md.example → dndev/ENV_SETUP.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_I18N.md.example → dndev/SETUP_I18N.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_LAYOUTS.md.example → dndev/SETUP_LAYOUTS.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_OAUTH.md.example → dndev/SETUP_OAUTH.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_THEMES.md.example → dndev/SETUP_THEMES.md.example} +0 -0
- /package/templates/root-consumer/guides/{advanced → dndev/advanced}/APP_CHECK.md.example +0 -0
- /package/templates/root-consumer/guides/{advanced → dndev/advanced}/COOKIE_REFERENCE.md.example +0 -0
- /package/templates/root-consumer/guides/{advanced → dndev/advanced}/EMULATORS.md.example +0 -0
- /package/templates/root-consumer/guides/{advanced → dndev/advanced}/VERSION_CONTROL.md.example +0 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Preset Selection Guide
|
|
2
|
+
|
|
3
|
+
> **One decision. Everything else follows.**
|
|
4
|
+
|
|
5
|
+
## How Presets Work
|
|
6
|
+
|
|
7
|
+
**Presets are NOT part of scaffolding.** When you run `dndev create-app`, it creates a base app with either Vite or Next.js.
|
|
8
|
+
|
|
9
|
+
**Preset is a single config change** in `config/app.ts` after the app is created:
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export const appConfig: AppConfig = {
|
|
13
|
+
preset: 'admin', // Change this one line
|
|
14
|
+
};
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The preset controls layout, navigation, and default behaviors - but the files are the same.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Decision Matrix
|
|
22
|
+
|
|
23
|
+
| If your app is... | Use Preset | Why |
|
|
24
|
+
|-------------------|------------|-----|
|
|
25
|
+
| Marketing site with conversion goals | `landing` | Hero sections, CTAs, no sidebar, public-first |
|
|
26
|
+
| Internal dashboard / back-office tool | `admin` | Sidebar nav, CRUD tables, auth-required by default |
|
|
27
|
+
| Multi-tenant SaaS with teams | `moolti` | Workspace switcher, billing, team management |
|
|
28
|
+
| Documentation / knowledge base | `docs` | Auto-sidebar from pages, search, TOC |
|
|
29
|
+
| Blog / content publishing | `blog` | Article layout, archive, categories |
|
|
30
|
+
| Mobile-first / game / fullscreen | `game` | Minimal chrome, touch-optimized, no sidebar |
|
|
31
|
+
| Custom / minimal / embedded | `plain` | No layout, full control |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Preset Details
|
|
36
|
+
|
|
37
|
+
### `landing`
|
|
38
|
+
**Best for:** Marketing sites, product pages, portfolios
|
|
39
|
+
|
|
40
|
+
**Layout:**
|
|
41
|
+
- Header with nav links
|
|
42
|
+
- Full-width content area
|
|
43
|
+
- Footer with legal links
|
|
44
|
+
- NO sidebar
|
|
45
|
+
|
|
46
|
+
**Default auth:** Public pages, optional protected sections
|
|
47
|
+
|
|
48
|
+
**Typical pages:**
|
|
49
|
+
- HomePage (hero + features + CTA)
|
|
50
|
+
- AboutPage
|
|
51
|
+
- PricingPage
|
|
52
|
+
- ContactPage
|
|
53
|
+
- LoginPage / SignupPage
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
### `admin`
|
|
58
|
+
**Best for:** Dashboards, CMS, internal tools, CRUD apps
|
|
59
|
+
|
|
60
|
+
**Layout:**
|
|
61
|
+
- Header with branding + user menu
|
|
62
|
+
- Collapsible sidebar with nav
|
|
63
|
+
- Main content area
|
|
64
|
+
- Optional footer
|
|
65
|
+
|
|
66
|
+
**Default auth:** Most pages require login
|
|
67
|
+
|
|
68
|
+
**Typical pages:**
|
|
69
|
+
- DashboardPage (stats, recent items)
|
|
70
|
+
- [Entity]ListPage (table with search/filter)
|
|
71
|
+
- [Entity]Page (create/edit form)
|
|
72
|
+
- SettingsPage
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
### `moolti`
|
|
77
|
+
**Best for:** SaaS with workspaces, team collaboration
|
|
78
|
+
|
|
79
|
+
**Layout:**
|
|
80
|
+
- Like `admin` but with workspace switcher
|
|
81
|
+
- Team/organization context
|
|
82
|
+
- Billing integration ready
|
|
83
|
+
|
|
84
|
+
**Default auth:** All pages require login + workspace
|
|
85
|
+
|
|
86
|
+
**Typical pages:**
|
|
87
|
+
- WorkspaceDashboardPage
|
|
88
|
+
- TeamSettingsPage
|
|
89
|
+
- BillingPage
|
|
90
|
+
- [Entity]ListPage per workspace
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
### `docs`
|
|
95
|
+
**Best for:** Documentation, guides, API reference
|
|
96
|
+
|
|
97
|
+
**Layout:**
|
|
98
|
+
- Header with search
|
|
99
|
+
- Auto-generated sidebar from `src/pages/docs/**`
|
|
100
|
+
- Wide content area for text
|
|
101
|
+
- Table of contents
|
|
102
|
+
|
|
103
|
+
**Default auth:** Public (or auth for premium docs)
|
|
104
|
+
|
|
105
|
+
**Typical structure:**
|
|
106
|
+
```
|
|
107
|
+
src/pages/docs/
|
|
108
|
+
GettingStartedPage.tsx
|
|
109
|
+
guides/
|
|
110
|
+
SetupPage.tsx
|
|
111
|
+
ConfigurationPage.tsx
|
|
112
|
+
api/
|
|
113
|
+
OverviewPage.tsx
|
|
114
|
+
EndpointsPage.tsx
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
### `blog`
|
|
120
|
+
**Best for:** Articles, news, content marketing
|
|
121
|
+
|
|
122
|
+
**Layout:**
|
|
123
|
+
- Header with categories
|
|
124
|
+
- Article-focused content area
|
|
125
|
+
- Sidebar for related/recent posts
|
|
126
|
+
- Author profiles
|
|
127
|
+
|
|
128
|
+
**Default auth:** Public read, admin write
|
|
129
|
+
|
|
130
|
+
**Typical pages:**
|
|
131
|
+
- BlogHomePage (featured + recent)
|
|
132
|
+
- ArticlePage (single article)
|
|
133
|
+
- CategoryPage (filtered list)
|
|
134
|
+
- AuthorPage (author profile + posts)
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
### `game`
|
|
139
|
+
**Best for:** Mobile apps, games, fullscreen experiences
|
|
140
|
+
|
|
141
|
+
**Layout:**
|
|
142
|
+
- Minimal/no header
|
|
143
|
+
- Full viewport content
|
|
144
|
+
- Bottom navigation (mobile)
|
|
145
|
+
- Touch-optimized
|
|
146
|
+
|
|
147
|
+
**Default auth:** Varies
|
|
148
|
+
|
|
149
|
+
**Typical pages:**
|
|
150
|
+
- GamePage (main experience)
|
|
151
|
+
- LeaderboardPage
|
|
152
|
+
- ProfilePage
|
|
153
|
+
- SettingsPage
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
### `plain`
|
|
158
|
+
**Best for:** Embeds, custom layouts, special cases
|
|
159
|
+
|
|
160
|
+
**Layout:**
|
|
161
|
+
- No framework layout
|
|
162
|
+
- You control everything
|
|
163
|
+
- Just `<PageContainer>` wrapper
|
|
164
|
+
|
|
165
|
+
**Default auth:** None (you configure)
|
|
166
|
+
|
|
167
|
+
**Use when:**
|
|
168
|
+
- Embedding in another app
|
|
169
|
+
- Completely custom design
|
|
170
|
+
- Framework presets don't fit
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Quick Decision Flow
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
START
|
|
178
|
+
|
|
|
179
|
+
v
|
|
180
|
+
Is it content/docs focused?
|
|
181
|
+
YES --> Is it articles/blog? --> YES --> blog
|
|
182
|
+
| --> NO --> docs
|
|
183
|
+
NO
|
|
184
|
+
|
|
|
185
|
+
v
|
|
186
|
+
Is it a dashboard/tool?
|
|
187
|
+
YES --> Multi-tenant/teams? --> YES --> moolti
|
|
188
|
+
| --> NO --> admin
|
|
189
|
+
NO
|
|
190
|
+
|
|
|
191
|
+
v
|
|
192
|
+
Is it marketing/public?
|
|
193
|
+
YES --> landing
|
|
194
|
+
NO
|
|
195
|
+
|
|
|
196
|
+
v
|
|
197
|
+
Is it mobile-first/fullscreen?
|
|
198
|
+
YES --> game
|
|
199
|
+
NO --> plain
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Changing Presets Later
|
|
205
|
+
|
|
206
|
+
Presets can be changed in `config/app.ts`:
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
export const appConfig: AppConfig = {
|
|
210
|
+
preset: 'admin', // Change this
|
|
211
|
+
};
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**Low risk:** Switching between similar presets (admin <-> moolti)
|
|
215
|
+
**Higher risk:** Switching layout types (landing <-> admin) - may need page restructuring
|
|
216
|
+
|
|
217
|
+
**Recommendation:** Get the preset right in Phase 0. Changing later is possible but adds work.
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
# App Specification
|
|
2
|
+
|
|
3
|
+
> **This is the contract.** Complete spec = deterministic build. Incomplete spec = wasted work.
|
|
4
|
+
> **Do NOT start coding until this document is complete and validated.**
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. Identity
|
|
9
|
+
|
|
10
|
+
| Field | Value |
|
|
11
|
+
|-------|-------|
|
|
12
|
+
| **App Name** | |
|
|
13
|
+
| **One-Line Description** | |
|
|
14
|
+
| **Primary User** | _(Who uses this daily?)_ |
|
|
15
|
+
| **Secondary Users** | _(Who else interacts?)_ |
|
|
16
|
+
| **Core Value** | _(What problem does it solve?)_ |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 2. User Journeys
|
|
21
|
+
|
|
22
|
+
> **Most important section.** These drive everything else.
|
|
23
|
+
|
|
24
|
+
### Journey 1: [Name - e.g., "New User Onboarding"]
|
|
25
|
+
|
|
26
|
+
**Actor:** [User type]
|
|
27
|
+
**Goal:** [What they're trying to accomplish]
|
|
28
|
+
**Trigger:** [What starts this journey]
|
|
29
|
+
|
|
30
|
+
**Steps:**
|
|
31
|
+
1.
|
|
32
|
+
2.
|
|
33
|
+
3.
|
|
34
|
+
4.
|
|
35
|
+
5.
|
|
36
|
+
|
|
37
|
+
**Success:** [What indicates completion]
|
|
38
|
+
**Failure:** [What could go wrong, how to handle]
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
### Journey 2: [Name - e.g., "Daily Core Task"]
|
|
43
|
+
|
|
44
|
+
**Actor:** [User type]
|
|
45
|
+
**Goal:** [What they're trying to accomplish]
|
|
46
|
+
**Trigger:** [What starts this journey]
|
|
47
|
+
|
|
48
|
+
**Steps:**
|
|
49
|
+
1.
|
|
50
|
+
2.
|
|
51
|
+
3.
|
|
52
|
+
4.
|
|
53
|
+
5.
|
|
54
|
+
|
|
55
|
+
**Success:** [What indicates completion]
|
|
56
|
+
**Failure:** [What could go wrong, how to handle]
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
### Journey 3: [Name - e.g., "Admin Management"]
|
|
61
|
+
|
|
62
|
+
**Actor:** [User type]
|
|
63
|
+
**Goal:** [What they're trying to accomplish]
|
|
64
|
+
|
|
65
|
+
**Steps:**
|
|
66
|
+
1.
|
|
67
|
+
2.
|
|
68
|
+
3.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
_(Add more journeys as needed)_
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 3. Preset Selection
|
|
77
|
+
|
|
78
|
+
**Selected:** `_______________`
|
|
79
|
+
|
|
80
|
+
| Preset | When to Use |
|
|
81
|
+
|--------|-------------|
|
|
82
|
+
| `landing` | Marketing site, public pages, conversion focus |
|
|
83
|
+
| `admin` | Dashboard with sidebar, CRUD-heavy, internal tools |
|
|
84
|
+
| `moolti` | Multi-tenant SaaS, teams/workspaces, billing |
|
|
85
|
+
| `docs` | Documentation, auto-sidebar from pages |
|
|
86
|
+
| `blog` | Content-focused, articles, archive |
|
|
87
|
+
| `game` | Mobile-first, fullscreen, minimal chrome |
|
|
88
|
+
| `plain` | Custom everything, no framework layout |
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 4. Auth & Roles
|
|
93
|
+
|
|
94
|
+
| Question | Answer |
|
|
95
|
+
|----------|--------|
|
|
96
|
+
| **Auth required?** | Yes / No |
|
|
97
|
+
| **Providers** | [ ] Email [ ] Google [ ] GitHub [ ] Apple |
|
|
98
|
+
| **Self-registration?** | Yes / No / Invite-only |
|
|
99
|
+
|
|
100
|
+
### Roles
|
|
101
|
+
|
|
102
|
+
| Role | Description | Can Do |
|
|
103
|
+
|------|-------------|--------|
|
|
104
|
+
| `guest` | Not logged in | |
|
|
105
|
+
| `user` | Logged in | |
|
|
106
|
+
| `admin` | Administrator | |
|
|
107
|
+
| | | |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 5. Billing (if applicable)
|
|
112
|
+
|
|
113
|
+
| Question | Answer |
|
|
114
|
+
|----------|--------|
|
|
115
|
+
| **Billing enabled?** | Yes / No |
|
|
116
|
+
| **Model** | Subscription / One-time / Usage-based |
|
|
117
|
+
| **Provider** | Stripe / Other |
|
|
118
|
+
|
|
119
|
+
### Plans
|
|
120
|
+
|
|
121
|
+
| Plan | Price | Features |
|
|
122
|
+
|------|-------|----------|
|
|
123
|
+
| | | |
|
|
124
|
+
| | | |
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 6. Entities
|
|
129
|
+
|
|
130
|
+
> One entity = one collection. Define ALL data.
|
|
131
|
+
|
|
132
|
+
### Entity: [Name]
|
|
133
|
+
|
|
134
|
+
| Field | Type | Required | Validation |
|
|
135
|
+
|-------|------|----------|------------|
|
|
136
|
+
| id | string | yes | auto-generated |
|
|
137
|
+
| | | | |
|
|
138
|
+
| | | | |
|
|
139
|
+
| createdAt | timestamp | yes | auto |
|
|
140
|
+
| updatedAt | timestamp | yes | auto |
|
|
141
|
+
|
|
142
|
+
**States:** `[state1]` → `[state2]` → `[state3]`
|
|
143
|
+
|
|
144
|
+
**State Transitions:**
|
|
145
|
+
- `state1` → `state2`: [What triggers this]
|
|
146
|
+
- `state2` → `state3`: [What triggers this]
|
|
147
|
+
- `state2` → `cancelled`: [What triggers this]
|
|
148
|
+
|
|
149
|
+
**Relationships:**
|
|
150
|
+
- Belongs to: [Entity] (via `fieldName`)
|
|
151
|
+
- Has many: [Entity]
|
|
152
|
+
|
|
153
|
+
**Permissions:**
|
|
154
|
+
| Action | Who | Conditions |
|
|
155
|
+
|--------|-----|------------|
|
|
156
|
+
| Create | | |
|
|
157
|
+
| Read | | |
|
|
158
|
+
| Update | | |
|
|
159
|
+
| Delete | | |
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
### Entity: [Name]
|
|
164
|
+
|
|
165
|
+
| Field | Type | Required | Validation |
|
|
166
|
+
|-------|------|----------|------------|
|
|
167
|
+
| | | | |
|
|
168
|
+
|
|
169
|
+
**States:** (if applicable)
|
|
170
|
+
|
|
171
|
+
**Relationships:**
|
|
172
|
+
|
|
173
|
+
**Permissions:**
|
|
174
|
+
| Action | Who | Conditions |
|
|
175
|
+
|--------|-----|------------|
|
|
176
|
+
| Create | | |
|
|
177
|
+
| Read | | |
|
|
178
|
+
| Update | | |
|
|
179
|
+
| Delete | | |
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
_(Copy entity template for each entity)_
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## 7. Business Rules
|
|
188
|
+
|
|
189
|
+
> Explicit rules that govern behavior. If it's not here, it doesn't exist.
|
|
190
|
+
|
|
191
|
+
### [Entity/Feature] Rules
|
|
192
|
+
|
|
193
|
+
1. **[Rule name]:** [Description]
|
|
194
|
+
- Example: "Order total = sum(items) + shipping - discount"
|
|
195
|
+
|
|
196
|
+
2. **[Rule name]:** [Description]
|
|
197
|
+
|
|
198
|
+
3. **[Rule name]:** [Description]
|
|
199
|
+
|
|
200
|
+
### Validation Rules
|
|
201
|
+
|
|
202
|
+
| Entity | Field | Rule |
|
|
203
|
+
|--------|-------|------|
|
|
204
|
+
| | | |
|
|
205
|
+
| | | |
|
|
206
|
+
|
|
207
|
+
### Automatic Calculations
|
|
208
|
+
|
|
209
|
+
| When | Calculate | Formula/Logic |
|
|
210
|
+
|------|-----------|---------------|
|
|
211
|
+
| | | |
|
|
212
|
+
|
|
213
|
+
### Notifications/Triggers
|
|
214
|
+
|
|
215
|
+
| Event | Action | Recipients |
|
|
216
|
+
|-------|--------|------------|
|
|
217
|
+
| | | |
|
|
218
|
+
| | | |
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## 8. Pages
|
|
223
|
+
|
|
224
|
+
> Derived from user journeys. Every page exists because a journey needs it.
|
|
225
|
+
|
|
226
|
+
### Public Pages
|
|
227
|
+
|
|
228
|
+
| Route | Page | Purpose | From Journey |
|
|
229
|
+
|-------|------|---------|--------------|
|
|
230
|
+
| `/` | HomePage | | |
|
|
231
|
+
| | | | |
|
|
232
|
+
|
|
233
|
+
### Protected Pages (login required)
|
|
234
|
+
|
|
235
|
+
| Route | Page | Purpose | From Journey |
|
|
236
|
+
|-------|------|---------|--------------|
|
|
237
|
+
| `/dashboard` | DashboardPage | | |
|
|
238
|
+
| | | | |
|
|
239
|
+
|
|
240
|
+
### Admin Pages
|
|
241
|
+
|
|
242
|
+
| Route | Page | Purpose | From Journey |
|
|
243
|
+
|-------|------|---------|--------------|
|
|
244
|
+
| `/admin` | AdminDashboard | | |
|
|
245
|
+
| | | | |
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## 9. Features
|
|
250
|
+
|
|
251
|
+
| Feature | Needed | Details |
|
|
252
|
+
|---------|--------|---------|
|
|
253
|
+
| **i18n** | Yes/No | Languages: |
|
|
254
|
+
| **PWA** | Yes/No | |
|
|
255
|
+
| **Real-time** | Yes/No | Which entities: |
|
|
256
|
+
| **File uploads** | Yes/No | Which entities: |
|
|
257
|
+
| **Email notifications** | Yes/No | Triggers: |
|
|
258
|
+
| **Search** | Yes/No | Which entities: |
|
|
259
|
+
| **Export (CSV/PDF)** | Yes/No | Which entities: |
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## 10. Edge Cases & Error Handling
|
|
264
|
+
|
|
265
|
+
> What happens when things go wrong?
|
|
266
|
+
|
|
267
|
+
| Scenario | Handling |
|
|
268
|
+
|----------|----------|
|
|
269
|
+
| User submits invalid data | |
|
|
270
|
+
| Network connection lost | |
|
|
271
|
+
| Concurrent edit conflict | |
|
|
272
|
+
| External service down | |
|
|
273
|
+
| User tries unauthorized action | |
|
|
274
|
+
| | |
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## 11. Open Questions
|
|
279
|
+
|
|
280
|
+
> Anything unresolved? List here. **No coding until resolved.**
|
|
281
|
+
|
|
282
|
+
- [ ]
|
|
283
|
+
- [ ]
|
|
284
|
+
- [ ]
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Validation Checklist
|
|
289
|
+
|
|
290
|
+
Before starting Phase 1, ALL must be checked:
|
|
291
|
+
|
|
292
|
+
### Completeness
|
|
293
|
+
- [ ] Every user journey has numbered steps
|
|
294
|
+
- [ ] Every entity has fields, states, permissions defined
|
|
295
|
+
- [ ] Every business rule is explicit (not implied)
|
|
296
|
+
- [ ] Every page is linked to a journey
|
|
297
|
+
- [ ] No "TBD", "TODO", or empty fields
|
|
298
|
+
|
|
299
|
+
### Clarity
|
|
300
|
+
- [ ] Can explain app to someone unfamiliar in 2 minutes
|
|
301
|
+
- [ ] Can trace any page back to a user journey
|
|
302
|
+
- [ ] Can answer "who can do X to Y?" for any entity/action
|
|
303
|
+
- [ ] Can answer "what happens when Z fails?" for common scenarios
|
|
304
|
+
|
|
305
|
+
### User Validation
|
|
306
|
+
- [ ] User has reviewed this spec
|
|
307
|
+
- [ ] User has confirmed it's complete
|
|
308
|
+
- [ ] User has no outstanding questions
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
**All boxes checked? Proceed to Phase 1: SCAFFOLD.**
|