@donotdev/cli 0.0.6 → 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 +25 -7
- package/dist/bin/commands/build.js +156 -158
- package/dist/bin/commands/bump.js +153 -153
- package/dist/bin/commands/cacheout.js +154 -154
- package/dist/bin/commands/create-app.js +184 -156
- package/dist/bin/commands/create-project.js +154 -154
- package/dist/bin/commands/deploy.js +470 -470
- package/dist/bin/commands/dev.js +155 -155
- package/dist/bin/commands/emu.js +155 -155
- package/dist/bin/commands/format.js +154 -154
- package/dist/bin/commands/lint.js +157 -154
- package/dist/bin/commands/preview.js +155 -155
- package/dist/bin/commands/sync-secrets.js +155 -155
- 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 +524 -497
- package/package.json +1 -1
- package/templates/app-demo/src/config/app.ts.example +12 -0
- package/templates/app-next/src/config/app.ts.example +75 -48
- package/templates/app-vite/index.html.example +71 -37
- package/templates/app-vite/src/config/app.ts.example +75 -47
- 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/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/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/guides/{AGENT_START_HERE.md.example → dndev/AGENT_START_HERE.md.example} +22 -0
- package/templates/root-consumer/guides/dndev/COMPONENTS_CRUD.md.example +231 -0
- package/templates/root-consumer/guides/{SETUP_AUTH.md.example → dndev/SETUP_AUTH.md.example} +30 -0
- 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/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/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_CRUD.md.example +0 -1244
- package/templates/root-consumer/guides/SETUP_FUNCTIONS.md.example +0 -114
- /package/templates/root-consumer/guides/{COMPONENTS_ADV.md.example → dndev/COMPONENTS_ADV.md.example} +0 -0
- /package/templates/root-consumer/guides/{COMPONENTS_ATOMIC.md.example → dndev/COMPONENTS_ATOMIC.md.example} +0 -0
- /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/{INDEX.md.example → dndev/INDEX.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_APP_CONFIG.md.example → dndev/SETUP_APP_CONFIG.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_BILLING.md.example → dndev/SETUP_BILLING.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_PAGES.md.example → dndev/SETUP_PAGES.md.example} +0 -0
- /package/templates/root-consumer/guides/{SETUP_PWA.md.example → dndev/SETUP_PWA.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/{USE_ROUTING.md.example → dndev/USE_ROUTING.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.**
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview {{APP_NAME}} Create Entity Wrapper
|
|
3
|
-
* @description Wrapper for framework's createEntity with {{APP_NAME}}-specific configuration
|
|
4
|
-
* @version 0.0.1
|
|
5
|
-
* @since 0.0.1
|
|
6
|
-
* @author AMBROISE PARK Consulting
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { createEntity as frameworkCreateEntity } from '@donotdev/functions/firebase';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* {{APP_NAME}} entity creation
|
|
13
|
-
* Wraps the framework function with {{APP_NAME}}-specific configuration
|
|
14
|
-
*
|
|
15
|
-
* @version 0.0.1
|
|
16
|
-
* @since 0.0.1
|
|
17
|
-
* @author AMBROISE PARK Consulting
|
|
18
|
-
*/
|
|
19
|
-
export const createEntity = frameworkCreateEntity;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// functions/src/crud/deleteEntity.ts
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview {{APP_NAME}} Delete Entity Wrapper
|
|
5
|
-
* @description Wrapper for framework's deleteEntity with {{APP_NAME}}-specific configuration
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { deleteEntity as frameworkDeleteEntity } from '@donotdev/functions/firebase';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* {{APP_NAME}} entity deletion
|
|
12
|
-
* Wraps the framework function with {{APP_NAME}}-specific configuration
|
|
13
|
-
*/
|
|
14
|
-
export const deleteEntity = frameworkDeleteEntity;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// functions/src/crud/getEntity.ts
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview {{APP_NAME}} Get Entity Wrapper
|
|
5
|
-
* @description Wrapper for framework's getEntity with {{APP_NAME}}-specific configuration
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { getEntity as frameworkGetEntity } from '@donotdev/functions/firebase';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* {{APP_NAME}} entity retrieval
|
|
12
|
-
* Wraps the framework function with {{APP_NAME}}-specific configuration
|
|
13
|
-
*/
|
|
14
|
-
export const getEntity = frameworkGetEntity;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// functions/src/crud/index.ts
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview {{APP_NAME}} CRUD Functions
|
|
5
|
-
* @description Exports all CRUD-related functions for the {{APP_NAME}} app
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export { createEntity } from './createEntity';
|
|
9
|
-
export { updateEntity } from './updateEntity';
|
|
10
|
-
export { deleteEntity } from './deleteEntity';
|
|
11
|
-
export { getEntity } from './getEntity';
|
|
12
|
-
export { listEntities } from './listEntities';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// functions/src/crud/listEntities.ts
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview {{APP_NAME}} List Entities Wrapper
|
|
5
|
-
* @description Wrapper for framework's listEntities with {{APP_NAME}}-specific configuration
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { listEntities as frameworkListEntities } from '@donotdev/functions/firebase';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* {{APP_NAME}} entities listing
|
|
12
|
-
* Wraps the framework function with {{APP_NAME}}-specific configuration
|
|
13
|
-
*/
|
|
14
|
-
export const listEntities = frameworkListEntities;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// functions/src/crud/updateEntity.ts
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @fileoverview {{APP_NAME}} Update Entity Wrapper
|
|
5
|
-
* @description Wrapper for framework's updateEntity with {{APP_NAME}}-specific configuration
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { updateEntity as frameworkUpdateEntity } from '@donotdev/functions/firebase';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* {{APP_NAME}} entity update
|
|
12
|
-
* Wraps the framework function with {{APP_NAME}}-specific configuration
|
|
13
|
-
*/
|
|
14
|
-
export const updateEntity = frameworkUpdateEntity;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# CRUD 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/crud` (CRUD operations and forms)
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Core Hook
|
|
10
|
-
|
|
11
|
-
- **useCrud** - React hook for CRUD operations (create, read, update, delete, query) with automatic validation and backend abstraction.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Service
|
|
16
|
-
|
|
17
|
-
- **getCrudService** - Get CrudService singleton instance for direct service access.
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## Form Components
|
|
22
|
-
|
|
23
|
-
- **EntityFormRenderer** - Renders complete entity forms with automatic field mapping.
|
|
24
|
-
- **FormFieldRenderer** - Renders individual form fields based on schema.
|
|
25
|
-
- **FormLayout** - Form layout component with spacing and structure.
|
|
26
|
-
- **CrudButton** - Button component integrated with CRUD operations.
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Form Field Components
|
|
31
|
-
|
|
32
|
-
- **TextFieldComponent** - Text input field component.
|
|
33
|
-
- **NumberFieldComponent** - Number input field component.
|
|
34
|
-
- **TextAreaComponent** - Textarea input field component.
|
|
35
|
-
- **PasswordFieldComponent** - Password input field component.
|
|
36
|
-
- **DateFieldComponent** - Date picker field component.
|
|
37
|
-
- **CheckboxFieldComponent** - Checkbox field component.
|
|
38
|
-
- **RadioFieldComponent** - Radio button field component.
|
|
39
|
-
- **DropdownComponent** - Single-select dropdown field component.
|
|
40
|
-
- **MultiDropdownComponent** - Multi-select dropdown field component.
|
|
41
|
-
- **FileFieldComponent** - File upload field component.
|
|
42
|
-
- **ImageFieldComponent** - Image upload field component.
|
|
43
|
-
- **AvatarFieldComponent** - Avatar upload field component.
|
|
44
|
-
- **BadgeFieldComponent** - Badge display/input field component.
|
|
45
|
-
- **PhoneNumberComponent** - Phone number input field component.
|
|
46
|
-
- **GeoPointFieldComponent** - Geographic point input field component.
|
|
47
|
-
- **MapFieldComponent** - Map picker field component.
|
|
48
|
-
- **TimestampFieldComponent** - Timestamp input field component.
|
|
49
|
-
- **ReferenceFieldComponent** - Reference/link field component.
|
|
50
|
-
- **MultiInputTextFieldComponent** - Multiple text inputs field component.
|
|
51
|
-
- **ButtonFieldComponent** - Button field component.
|
|
52
|
-
- **HiddenFieldComponent** - Hidden field component.
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
## Controlled Fields
|
|
57
|
-
|
|
58
|
-
- **ControlledFields** - Controlled form field components with validation.
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## Utilities
|
|
63
|
-
|
|
64
|
-
- **loadDeterministicRange** - Load deterministic range from collections.
|
|
65
|
-
- **upsertDeterministic** - Upsert with deterministic ID.
|
|
66
|
-
- **appendToCollection** - Append item to collection.
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
**All props documented in JSDoc** - Hover in IDE for complete reference.
|