ai-flow-dev 2.1.2 → 2.1.4
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/README.md +28 -40
- package/dist/cli.js +69 -47
- package/dist/cli.js.map +1 -1
- package/package.json +5 -5
- package/prompts/backend/flow-build-phase-0.md +96 -84
- package/prompts/backend/flow-build-phase-1.md +10 -18
- package/prompts/backend/flow-build-phase-10.md +199 -583
- package/prompts/backend/flow-build-phase-2.md +152 -86
- package/prompts/backend/flow-build-phase-3.md +108 -68
- package/prompts/backend/flow-build-phase-4.md +5 -8
- package/prompts/backend/flow-build-phase-5.md +39 -12
- package/prompts/backend/flow-build-phase-6.md +29 -8
- package/prompts/backend/flow-build-phase-7.md +121 -41
- package/prompts/backend/flow-build-phase-8.md +28 -65
- package/prompts/backend/flow-build-phase-9.md +267 -1298
- package/prompts/backend/flow-build.md +881 -957
- package/prompts/backend/flow-dev-commit.md +27 -50
- package/prompts/backend/flow-dev-feature.md +1929 -2017
- package/prompts/backend/flow-dev-fix.md +936 -964
- package/prompts/backend/flow-dev-refactor.md +672 -701
- package/prompts/backend/flow-dev-review.md +356 -389
- package/prompts/backend/flow-dev-work.md +1066 -1118
- package/prompts/backend/flow-docs-sync.md +31 -210
- package/prompts/frontend/flow-build-phase-0.md +503 -484
- package/prompts/frontend/flow-build-phase-1.md +445 -433
- package/prompts/frontend/flow-build-phase-2.md +910 -957
- package/prompts/frontend/flow-build-phase-3.md +692 -664
- package/prompts/frontend/flow-build-phase-4.md +478 -463
- package/prompts/frontend/flow-build-phase-5.md +488 -467
- package/prompts/frontend/flow-build-phase-6.md +571 -550
- package/prompts/frontend/flow-build-phase-7.md +560 -592
- package/prompts/frontend/flow-build-phase-8.md +17 -42
- package/prompts/frontend/flow-build.md +457 -503
- package/prompts/frontend/flow-docs-sync.md +24 -45
- package/prompts/mobile/flow-build-phase-0.md +104 -97
- package/prompts/mobile/flow-build-phase-1.md +137 -122
- package/prompts/mobile/flow-build-phase-2.md +123 -130
- package/prompts/mobile/flow-build-phase-3.md +144 -149
- package/prompts/mobile/flow-build-phase-4.md +140 -132
- package/prompts/mobile/flow-build-phase-5.md +70 -70
- package/prompts/mobile/flow-build-phase-6.md +136 -134
- package/prompts/mobile/flow-build-phase-7.md +24 -58
- package/prompts/mobile/flow-build-phase-8.md +17 -42
- package/prompts/mobile/flow-build.md +47 -97
- package/prompts/mobile/flow-docs-sync.md +23 -42
- package/prompts/shared/mermaid-guidelines.md +106 -0
- package/prompts/shared/scope-levels.md +126 -0
- package/prompts/shared/story-points.md +65 -0
- package/prompts/shared/task-format.md +86 -0
- package/templates/AGENT.template.md +194 -15
- package/templates/backend/README.template.md +2 -32
- package/templates/backend/ai-instructions.template.md +2 -32
- package/templates/backend/copilot-instructions.template.md +2 -22
- package/templates/backend/docs/api.template.md +89 -20
- package/templates/backend/docs/architecture.template.md +165 -53
- package/templates/backend/docs/business-flows.template.md +7 -14
- package/templates/backend/docs/code-standards.template.md +2 -38
- package/templates/backend/docs/contributing.template.md +2 -16
- package/templates/backend/docs/data-model.template.md +125 -21
- package/templates/backend/docs/operations.template.md +179 -50
- package/templates/backend/docs/testing.template.md +2 -42
- package/templates/backend/project-brief.template.md +2 -28
- package/templates/backend/specs/configuration.template.md +2 -14
- package/templates/backend/specs/security.template.md +2 -32
- package/templates/frontend/README.template.md +2 -18
- package/templates/frontend/ai-instructions.template.md +2 -20
- package/templates/frontend/docs/api-integration.template.md +12 -30
- package/templates/frontend/docs/components.template.md +2 -28
- package/templates/frontend/docs/error-handling.template.md +11 -27
- package/templates/frontend/docs/operations.template.md +8 -18
- package/templates/frontend/docs/performance.template.md +8 -18
- package/templates/frontend/docs/pwa.template.md +8 -18
- package/templates/frontend/docs/state-management.template.md +2 -28
- package/templates/frontend/docs/styling.template.md +2 -26
- package/templates/frontend/docs/testing.template.md +2 -28
- package/templates/frontend/project-brief.template.md +2 -16
- package/templates/frontend/specs/accessibility.template.md +8 -18
- package/templates/frontend/specs/configuration.template.md +2 -24
- package/templates/frontend/specs/security.template.md +10 -24
- package/templates/fullstack/README.template.md +17 -47
- package/templates/fullstack/ai-instructions.template.md +17 -45
- package/templates/fullstack/project-brief.template.md +16 -42
- package/templates/fullstack/specs/configuration.template.md +16 -42
- package/templates/mobile/README.template.md +11 -29
- package/templates/mobile/ai-instructions.template.md +11 -27
- package/templates/mobile/docs/app-store.template.md +11 -29
- package/templates/mobile/docs/architecture.template.md +14 -38
- package/templates/mobile/docs/native-features.template.md +16 -44
- package/templates/mobile/docs/navigation.template.md +9 -23
- package/templates/mobile/docs/offline-strategy.template.md +10 -26
- package/templates/mobile/docs/permissions.template.md +9 -23
- package/templates/mobile/docs/state-management.template.md +12 -32
- package/templates/mobile/docs/testing.template.md +14 -38
- package/templates/mobile/project-brief.template.md +12 -30
- package/templates/mobile/specs/build-configuration.template.md +10 -26
- package/templates/mobile/specs/deployment.template.md +9 -23
|
@@ -1,984 +1,937 @@
|
|
|
1
|
-
# Phase 2: Component Architecture
|
|
2
|
-
|
|
3
|
-
> **Duration:** 15-20 minutes
|
|
4
|
-
> **Purpose:** Define UI framework, component patterns, and frontend architecture
|
|
5
|
-
|
|
1
|
+
# Phase 2: Component Architecture
|
|
2
|
+
|
|
3
|
+
> **Duration:** 15-20 minutes
|
|
4
|
+
> **Purpose:** Define UI framework, component patterns, and frontend architecture
|
|
6
5
|
---
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
- Component
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- `docs/
|
|
20
|
-
- `
|
|
21
|
-
- Updates to `ai-instructions.md` - Tech stack section
|
|
22
|
-
|
|
6
|
+
## 📋 Context
|
|
7
|
+
|
|
8
|
+
You are in **Phase 2 of 7** of the frontend build process.
|
|
9
|
+
|
|
10
|
+
**What we're defining:**
|
|
11
|
+
- UI Framework selection (React/Vue/Angular/Svelte/Solid)
|
|
12
|
+
- Component architecture pattern
|
|
13
|
+
- Component library and tooling
|
|
14
|
+
- File organization strategy
|
|
15
|
+
|
|
16
|
+
**Documents to generate:**
|
|
17
|
+
- `docs/components.md` - Component architecture guide
|
|
18
|
+
- `docs/architecture.md` - Frontend system architecture
|
|
19
|
+
- Updates to `ai-instructions.md` - Tech stack section
|
|
23
20
|
---
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
**Recommendations:** Mark with ⭐ (recommended), 🔥 (popular), ⚡ (modern), 🏆 (enterprise)
|
|
32
|
-
|
|
21
|
+
## 🎯 Instructions
|
|
22
|
+
|
|
23
|
+
Ask questions **one at a time**, wait for user response before next question.
|
|
24
|
+
|
|
25
|
+
**Progress indicator:** Show "Question X/12" for each question.
|
|
26
|
+
|
|
27
|
+
**Recommendations:** Mark with ⭐ (recommended), 🔥 (popular), ⚡ (modern), 🏆 (enterprise)
|
|
33
28
|
---
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
**
|
|
79
|
-
- **
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
**
|
|
83
|
-
- **
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
**
|
|
90
|
-
- **
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
**
|
|
94
|
-
- **
|
|
95
|
-
- **Version:** Solid 1.8+ (latest stable)
|
|
96
|
-
|
|
29
|
+
## Question 2.1: UI Framework
|
|
30
|
+
|
|
31
|
+
**Question:** Which UI framework will you use?
|
|
32
|
+
|
|
33
|
+
**Context:** This is the foundation of your frontend. Choose based on team expertise, ecosystem, and project requirements.
|
|
34
|
+
|
|
35
|
+
**Options:**
|
|
36
|
+
|
|
37
|
+
A) ⭐ **React 18+** (Recommended - Largest ecosystem)
|
|
38
|
+
- Functional components + hooks
|
|
39
|
+
- Virtual DOM, component-based architecture
|
|
40
|
+
- Massive ecosystem (Next.js, Remix for SSR)
|
|
41
|
+
- Best for: Teams with React experience, large apps
|
|
42
|
+
- Meta-frameworks: Next.js 14+, Remix 2+, Vite
|
|
43
|
+
|
|
44
|
+
B) 🔥 **Vue 3** (Popular - Progressive framework)
|
|
45
|
+
- Composition API + reactivity system
|
|
46
|
+
- Single-file components (.vue)
|
|
47
|
+
- Excellent documentation
|
|
48
|
+
- Best for: Rapid development, gradual adoption
|
|
49
|
+
- Meta-framework: Nuxt 3
|
|
50
|
+
|
|
51
|
+
C) 🏆 **Angular 17+** (Enterprise - Batteries included)
|
|
52
|
+
- TypeScript-first, opinionated
|
|
53
|
+
- Dependency injection, RxJS
|
|
54
|
+
- Complete framework (router, HTTP, forms included)
|
|
55
|
+
- Best for: Large teams, enterprise apps
|
|
56
|
+
- Meta-framework: Analog (experimental)
|
|
57
|
+
|
|
58
|
+
D) ⚡ **Svelte 4 / SvelteKit** (Modern - Compiler-based)
|
|
59
|
+
- No virtual DOM, compiles to vanilla JS
|
|
60
|
+
- Less boilerplate, reactive by default
|
|
61
|
+
- Best for: Performance-critical apps
|
|
62
|
+
- Meta-framework: SvelteKit
|
|
63
|
+
|
|
64
|
+
E) 🚀 **Solid.js** (Modern - Fine-grained reactivity)
|
|
65
|
+
- JSX syntax, no virtual DOM
|
|
66
|
+
- Blazing fast performance
|
|
67
|
+
- Best for: Performance enthusiasts
|
|
68
|
+
- Meta-framework: SolidStart
|
|
69
|
+
|
|
70
|
+
**Your choice:** (A/B/C/D/E)
|
|
71
|
+
|
|
72
|
+
**Follow-up if A (React):**
|
|
73
|
+
- **Meta-framework:** Next.js 14+ / Remix 2 / Create React App / Vite?
|
|
74
|
+
- **Version:** React 18.2+ (latest stable)
|
|
75
|
+
|
|
76
|
+
**Follow-up if B (Vue):**
|
|
77
|
+
- **Meta-framework:** Nuxt 3 / Vite?
|
|
78
|
+
- **Version:** Vue 3.4+ (latest stable)
|
|
79
|
+
|
|
80
|
+
**Follow-up if C (Angular):**
|
|
81
|
+
- **Version:** Angular 17+ (latest stable with signals)
|
|
82
|
+
|
|
83
|
+
**Follow-up if D (Svelte):**
|
|
84
|
+
- **Meta-framework:** SvelteKit (recommended) / Vite?
|
|
85
|
+
- **Version:** Svelte 4+ (latest stable)
|
|
86
|
+
|
|
87
|
+
**Follow-up if E (Solid):**
|
|
88
|
+
- **Meta-framework:** SolidStart / Vite?
|
|
89
|
+
- **Version:** Solid 1.8+ (latest stable)
|
|
97
90
|
---
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
**If Yes:** TypeScript 5.3+ (latest stable)
|
|
124
|
-
|
|
91
|
+
## Question 2.2: TypeScript
|
|
92
|
+
|
|
93
|
+
**Question:** Will you use TypeScript?
|
|
94
|
+
|
|
95
|
+
**Context:** TypeScript adds static typing, improving code quality and developer experience.
|
|
96
|
+
|
|
97
|
+
**Options:**
|
|
98
|
+
|
|
99
|
+
A) ⭐ **Yes, strict mode** (Recommended)
|
|
100
|
+
- `"strict": true` in tsconfig.json
|
|
101
|
+
- Maximum type safety
|
|
102
|
+
- Best for: Production apps, large codebases
|
|
103
|
+
|
|
104
|
+
B) **Yes, relaxed mode**
|
|
105
|
+
- Some strict options disabled
|
|
106
|
+
- Gradual typing adoption
|
|
107
|
+
- Best for: Migrating from JavaScript
|
|
108
|
+
|
|
109
|
+
C) **No, JavaScript only**
|
|
110
|
+
- Pure JavaScript
|
|
111
|
+
- Best for: Small projects, prototypes
|
|
112
|
+
|
|
113
|
+
**Your choice:** (A/B/C)
|
|
114
|
+
|
|
115
|
+
**If Yes:** TypeScript 5.3+ (latest stable)
|
|
125
116
|
---
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
**Your choice:** (A/B/C/D/E)
|
|
160
|
-
|
|
117
|
+
## Question 2.3: Build Tool
|
|
118
|
+
|
|
119
|
+
**Question:** Which build tool will you use?
|
|
120
|
+
|
|
121
|
+
**Context:** Modern build tools provide fast development and optimized production builds.
|
|
122
|
+
|
|
123
|
+
**Options:**
|
|
124
|
+
|
|
125
|
+
A) ⭐ **Vite** (Recommended - Lightning fast)
|
|
126
|
+
- Instant HMR, ESM-based
|
|
127
|
+
- Optimized production builds
|
|
128
|
+
- Best for: Modern apps, all frameworks
|
|
129
|
+
|
|
130
|
+
B) **Webpack 5**
|
|
131
|
+
- Mature, highly configurable
|
|
132
|
+
- Large ecosystem of loaders/plugins
|
|
133
|
+
- Best for: Complex build requirements
|
|
134
|
+
|
|
135
|
+
C) **Turbopack** (Next.js only)
|
|
136
|
+
- Rust-based, ultra-fast
|
|
137
|
+
- Integrated with Next.js 13+
|
|
138
|
+
- Best for: Next.js projects
|
|
139
|
+
|
|
140
|
+
D) **esbuild**
|
|
141
|
+
- Extremely fast Go-based bundler
|
|
142
|
+
- Minimal configuration
|
|
143
|
+
- Best for: Simple builds
|
|
144
|
+
|
|
145
|
+
E) **Framework default**
|
|
146
|
+
- Use whatever the meta-framework provides
|
|
147
|
+
- (e.g., Next.js has built-in bundler)
|
|
148
|
+
|
|
149
|
+
**Your choice:** (A/B/C/D/E)
|
|
161
150
|
---
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
-
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
-
|
|
199
|
-
-
|
|
200
|
-
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
-
|
|
208
|
-
-
|
|
209
|
-
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
**Your choice:** (A/B/C/D)
|
|
217
|
-
|
|
151
|
+
## Question 2.4: Component Architecture Pattern
|
|
152
|
+
|
|
153
|
+
**Question:** How will you organize components?
|
|
154
|
+
|
|
155
|
+
**Context:** Component organization impacts maintainability and scalability.
|
|
156
|
+
|
|
157
|
+
**Options:**
|
|
158
|
+
|
|
159
|
+
A) ⭐ **Atomic Design** (Recommended - Scalable)
|
|
160
|
+
- Atoms → Molecules → Organisms → Templates → Pages
|
|
161
|
+
- Clear hierarchy, highly reusable
|
|
162
|
+
- Best for: Design systems, large apps
|
|
163
|
+
- Example:
|
|
164
|
+
```
|
|
165
|
+
components/
|
|
166
|
+
atoms/ (Button, Input, Label)
|
|
167
|
+
molecules/ (SearchBar, FormField)
|
|
168
|
+
organisms/ (Header, UserCard, DataTable)
|
|
169
|
+
templates/ (MainLayout, DashboardLayout)
|
|
170
|
+
pages/ (actual routes)
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
B) **Feature-based** (Domain-driven)
|
|
174
|
+
- Components organized by feature/domain
|
|
175
|
+
- Co-located code (components + hooks + tests)
|
|
176
|
+
- Best for: Feature-rich apps, microfront ends
|
|
177
|
+
- Example:
|
|
178
|
+
```
|
|
179
|
+
features/
|
|
180
|
+
auth/ (LoginForm, RegisterForm, hooks, services)
|
|
181
|
+
dashboard/ (DashboardView, widgets, hooks)
|
|
182
|
+
profile/ (ProfileForm, settings, hooks)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
C) **Flat structure** (Simple)
|
|
186
|
+
- All components in one folder
|
|
187
|
+
- Minimal hierarchy
|
|
188
|
+
- Best for: Small apps, prototypes
|
|
189
|
+
- Example:
|
|
190
|
+
```
|
|
191
|
+
components/ (all components here)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
D) **Hybrid** (Mix of Atomic + Feature-based)
|
|
195
|
+
- Shared components in atomic structure
|
|
196
|
+
- Feature-specific in feature folders
|
|
197
|
+
- Best for: Large, complex apps
|
|
198
|
+
- Example:
|
|
199
|
+
```
|
|
200
|
+
components/shared/ (atomic design)
|
|
201
|
+
features/ (feature-specific components)
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**Your choice:** (A/B/C/D)
|
|
218
205
|
---
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
**Use these exact formats** for frontend component diagrams mentioned in documentation:
|
|
223
|
-
|
|
206
|
+
#### 🎨 MERMAID COMPONENT DIAGRAM FORMATS - CRITICAL
|
|
207
|
+
|
|
208
|
+
**Use these exact formats** for frontend component diagrams mentioned in documentation:
|
|
224
209
|
---
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
P1 -->
|
|
262
|
-
P1 -->
|
|
263
|
-
|
|
264
|
-
P2 -->
|
|
265
|
-
P2 -->
|
|
266
|
-
|
|
267
|
-
P3 -->
|
|
268
|
-
P3 -->
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
H -->
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
S -->
|
|
279
|
-
|
|
280
|
-
PC -->
|
|
281
|
-
|
|
282
|
-
FI -->
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
style
|
|
286
|
-
style
|
|
287
|
-
style
|
|
288
|
-
style
|
|
289
|
-
style
|
|
290
|
-
style
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
**Use for:** Showing component organization, Atomic Design hierarchy, composition patterns
|
|
296
|
-
|
|
210
|
+
##### 1️⃣ Component Hierarchy (Atomic Design)
|
|
211
|
+
|
|
212
|
+
Use `graph TD` to show component organization from pages down to atoms:
|
|
213
|
+
|
|
214
|
+
````markdown
|
|
215
|
+
```mermaid
|
|
216
|
+
graph TD
|
|
217
|
+
subgraph "Pages"
|
|
218
|
+
P1[HomePage]
|
|
219
|
+
P2[ProductPage]
|
|
220
|
+
P3[CheckoutPage]
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
subgraph "Organisms"
|
|
224
|
+
H[Header]
|
|
225
|
+
HG[HeroSection]
|
|
226
|
+
PL[ProductList]
|
|
227
|
+
CF[CheckoutForm]
|
|
228
|
+
F[Footer]
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
subgraph "Molecules"
|
|
232
|
+
N[NavBar]
|
|
233
|
+
S[SearchBar]
|
|
234
|
+
PC[ProductCard]
|
|
235
|
+
FI[FormInput]
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
subgraph "Atoms"
|
|
239
|
+
B[Button]
|
|
240
|
+
I[Input]
|
|
241
|
+
L[Logo]
|
|
242
|
+
IC[Icon]
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
P1 --> H
|
|
246
|
+
P1 --> HG
|
|
247
|
+
P1 --> F
|
|
248
|
+
P2 --> H
|
|
249
|
+
P2 --> PL
|
|
250
|
+
P2 --> F
|
|
251
|
+
P3 --> H
|
|
252
|
+
P3 --> CF
|
|
253
|
+
P3 --> F
|
|
254
|
+
|
|
255
|
+
H --> N
|
|
256
|
+
H --> L
|
|
257
|
+
HG --> S
|
|
258
|
+
PL --> PC
|
|
259
|
+
CF --> FI
|
|
260
|
+
|
|
261
|
+
N --> B
|
|
262
|
+
S --> I
|
|
263
|
+
S --> B
|
|
264
|
+
PC --> B
|
|
265
|
+
PC --> IC
|
|
266
|
+
FI --> I
|
|
267
|
+
FI --> L
|
|
268
|
+
|
|
269
|
+
style P1 fill:#e1f5ff
|
|
270
|
+
style P2 fill:#e1f5ff
|
|
271
|
+
style P3 fill:#e1f5ff
|
|
272
|
+
style H fill:#fff4e6
|
|
273
|
+
style F fill:#fff4e6
|
|
274
|
+
style N fill:#e8f5e9
|
|
275
|
+
style B fill:#fce4ec
|
|
276
|
+
```
|
|
277
|
+
````
|
|
278
|
+
|
|
279
|
+
**Use for:** Showing component organization, Atomic Design hierarchy, composition patterns
|
|
297
280
|
---
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
P -->|user: User|
|
|
324
|
-
P -->|
|
|
325
|
-
P -->|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
H -->
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
style
|
|
337
|
-
style
|
|
338
|
-
style
|
|
339
|
-
style
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
-
|
|
346
|
-
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
**Use for:** Documenting data flow, props drilling, event handling patterns
|
|
350
|
-
|
|
281
|
+
##### 2️⃣ Component Tree with Props/Events
|
|
282
|
+
|
|
283
|
+
Use `graph LR` to show parent-child relationships and data flow:
|
|
284
|
+
|
|
285
|
+
````markdown
|
|
286
|
+
```mermaid
|
|
287
|
+
graph LR
|
|
288
|
+
subgraph "Parent Component"
|
|
289
|
+
P[UserDashboard]
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
subgraph "Child Components"
|
|
293
|
+
H[UserHeader]
|
|
294
|
+
PR[UserProfile]
|
|
295
|
+
AF[ActivityFeed]
|
|
296
|
+
S[Sidebar]
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
subgraph "Grandchild Components"
|
|
300
|
+
A[Avatar]
|
|
301
|
+
E[EditButton]
|
|
302
|
+
AI[ActivityItem]
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
P -->|user: User| H
|
|
306
|
+
P -->|user: User| PR
|
|
307
|
+
P -->|activities: Activity[]| AF
|
|
308
|
+
P -->|menuItems: MenuItem[]| S
|
|
309
|
+
|
|
310
|
+
H --> A
|
|
311
|
+
H --> E
|
|
312
|
+
AF --> AI
|
|
313
|
+
|
|
314
|
+
E -.->|onEdit(userId)| P
|
|
315
|
+
AI -.->|onLike(activityId)| AF
|
|
316
|
+
AF -.->|onUpdate()| P
|
|
317
|
+
|
|
318
|
+
style P fill:#e1f5ff
|
|
319
|
+
style H fill:#fff4e6
|
|
320
|
+
style PR fill:#fff4e6
|
|
321
|
+
style AF fill:#fff4e6
|
|
322
|
+
style S fill:#fff4e6
|
|
323
|
+
```
|
|
324
|
+
````
|
|
325
|
+
|
|
326
|
+
**Notation:**
|
|
327
|
+
- Solid arrow `-->|prop: Type|` = Props passed down
|
|
328
|
+
- Dotted arrow `-.->|event(args)|` = Events bubbled up
|
|
329
|
+
- Group related components in subgraphs
|
|
330
|
+
|
|
331
|
+
**Use for:** Documenting data flow, props drilling, event handling patterns
|
|
351
332
|
---
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
HP -.->
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
style
|
|
389
|
-
style
|
|
390
|
-
style
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
**Use for:** Showing folder structure, import relationships, file organization patterns
|
|
396
|
-
|
|
333
|
+
##### 3️⃣ Component File Organization
|
|
334
|
+
|
|
335
|
+
Use `graph TB` to show file/folder structure:
|
|
336
|
+
|
|
337
|
+
````markdown
|
|
338
|
+
```mermaid
|
|
339
|
+
graph TB
|
|
340
|
+
subgraph "src/components/"
|
|
341
|
+
subgraph "pages/"
|
|
342
|
+
HP[HomePage.tsx]
|
|
343
|
+
PP[ProductPage.tsx]
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
subgraph "organisms/"
|
|
347
|
+
H[Header/]
|
|
348
|
+
PL[ProductList/]
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
subgraph "molecules/"
|
|
352
|
+
N[NavBar/]
|
|
353
|
+
PC[ProductCard/]
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
subgraph "atoms/"
|
|
357
|
+
B[Button/]
|
|
358
|
+
I[Input/]
|
|
359
|
+
end
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
HP -.-> H
|
|
363
|
+
HP -.-> PL
|
|
364
|
+
H -.-> N
|
|
365
|
+
PL -.-> PC
|
|
366
|
+
PC -.-> B
|
|
367
|
+
|
|
368
|
+
style pages fill:#e1f5ff
|
|
369
|
+
style organisms fill:#fff4e6
|
|
370
|
+
style molecules fill:#e8f5e9
|
|
371
|
+
style atoms fill:#fce4ec
|
|
372
|
+
```
|
|
373
|
+
````
|
|
374
|
+
|
|
375
|
+
**Use for:** Showing folder structure, import relationships, file organization patterns
|
|
397
376
|
---
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
ROOT
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
PUBLIC -->
|
|
410
|
-
PUBLIC -->
|
|
411
|
-
PUBLIC -->
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
AUTH -->
|
|
415
|
-
AUTH -->
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
DASH -->
|
|
419
|
-
DASH -->
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
PROF -->
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
SETTINGS -->
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
style
|
|
429
|
-
style
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
**Use for:** Documenting route structure, showing protected routes, nested routing patterns
|
|
435
|
-
|
|
377
|
+
##### 4️⃣ Application Routing Structure
|
|
378
|
+
|
|
379
|
+
Use `graph TD` to show route hierarchy:
|
|
380
|
+
|
|
381
|
+
````markdown
|
|
382
|
+
```mermaid
|
|
383
|
+
graph TD
|
|
384
|
+
ROOT[/ Root Layout] --> PUBLIC[Public Routes]
|
|
385
|
+
ROOT --> AUTH[Protected Routes]
|
|
386
|
+
|
|
387
|
+
PUBLIC --> HOME[/]
|
|
388
|
+
PUBLIC --> LOGIN[/auth/login]
|
|
389
|
+
PUBLIC --> REGISTER[/auth/register]
|
|
390
|
+
PUBLIC --> RESET[/auth/reset-password]
|
|
391
|
+
|
|
392
|
+
AUTH --> DASH[/dashboard]
|
|
393
|
+
AUTH --> PROF[/profile]
|
|
394
|
+
AUTH --> SETTINGS[/settings]
|
|
395
|
+
|
|
396
|
+
DASH --> OVERVIEW[/dashboard/overview]
|
|
397
|
+
DASH --> ANALYTICS[/dashboard/analytics]
|
|
398
|
+
DASH --> REPORTS[/dashboard/reports]
|
|
399
|
+
|
|
400
|
+
PROF --> VIEW[/profile/:userId]
|
|
401
|
+
PROF --> EDIT[/profile/:userId/edit]
|
|
402
|
+
|
|
403
|
+
SETTINGS --> ACCOUNT[/settings/account]
|
|
404
|
+
SETTINGS --> PREFS[/settings/preferences]
|
|
405
|
+
|
|
406
|
+
style ROOT fill:#e1f5ff
|
|
407
|
+
style PUBLIC fill:#e8f5e9
|
|
408
|
+
style AUTH fill:#fff4e6
|
|
409
|
+
```
|
|
410
|
+
````
|
|
411
|
+
|
|
412
|
+
**Use for:** Documenting route structure, showing protected routes, nested routing patterns
|
|
436
413
|
---
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
-
|
|
442
|
-
-
|
|
443
|
-
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
-
|
|
453
|
-
-
|
|
454
|
-
-
|
|
455
|
-
- Preview at https://mermaid.live/ before saving
|
|
456
|
-
|
|
414
|
+
**Best Practices for Component Diagrams:**
|
|
415
|
+
|
|
416
|
+
1. **Color Code by Abstraction Level:**
|
|
417
|
+
- Pages/Routes: `#e1f5ff` (light blue)
|
|
418
|
+
- Organisms: `#fff4e6` (light orange)
|
|
419
|
+
- Molecules: `#e8f5e9` (light green)
|
|
420
|
+
- Atoms: `#fce4ec` (light pink)
|
|
421
|
+
|
|
422
|
+
2. **Use Subgraphs:** Group related components by type or feature
|
|
423
|
+
3. **Show Relationships:** Use solid arrows for composition, dotted for communication
|
|
424
|
+
4. **Label Props:** Include TypeScript types when helpful (`user: User`, `items: Product[]`)
|
|
425
|
+
5. **Keep It Readable:** Avoid overcrowding, use clear naming
|
|
426
|
+
|
|
427
|
+
**Common Formatting Rules:**
|
|
428
|
+
- Code fence: ` ```mermaid ` (lowercase, no spaces, three backticks)
|
|
429
|
+
- Start Mermaid syntax at column 0 (no indentation before code block)
|
|
430
|
+
- Use consistent colors across diagrams
|
|
431
|
+
- Preview at https://mermaid.live/ before saving
|
|
457
432
|
---
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
**
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
**
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
**
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
**
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
**
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
**Your choice:** (specify library or None)
|
|
501
|
-
|
|
433
|
+
## Question 2.5: Component Library
|
|
434
|
+
|
|
435
|
+
**Question:** Will you use a component library?
|
|
436
|
+
|
|
437
|
+
**Context:** Component libraries provide pre-built, accessible components.
|
|
438
|
+
|
|
439
|
+
**Options:**
|
|
440
|
+
|
|
441
|
+
**For React:**
|
|
442
|
+
A) ⭐ **Material UI (MUI)** - Comprehensive, Material Design
|
|
443
|
+
B) 🔥 **Chakra UI** - Accessible, themeable, modern
|
|
444
|
+
C) **shadcn/ui** - Copy-paste components, full control
|
|
445
|
+
D) **Ant Design** - Enterprise-focused, complete
|
|
446
|
+
E) **Headless UI** - Unstyled, accessible primitives
|
|
447
|
+
F) **None** - Build custom components
|
|
448
|
+
|
|
449
|
+
**For Vue:**
|
|
450
|
+
A) ⭐ **Vuetify** - Material Design, comprehensive
|
|
451
|
+
B) **Quasar** - Full framework, multiple platforms
|
|
452
|
+
C) **Element Plus** - Enterprise-focused
|
|
453
|
+
D) **PrimeVue** - Rich component set
|
|
454
|
+
E) **Headless UI Vue** - Unstyled primitives
|
|
455
|
+
F) **None** - Build custom components
|
|
456
|
+
|
|
457
|
+
**For Angular:**
|
|
458
|
+
A) ⭐ **Angular Material** - Official, Material Design
|
|
459
|
+
B) **PrimeNG** - Rich component set
|
|
460
|
+
C) **NG-ZORRO** - Ant Design for Angular
|
|
461
|
+
D) **None** - Build custom components
|
|
462
|
+
|
|
463
|
+
**For Svelte:**
|
|
464
|
+
A) **Skeleton** - Full-featured UI toolkit
|
|
465
|
+
B) **Carbon Components Svelte** - IBM Design
|
|
466
|
+
C) **Svelte Material UI** - Material Design
|
|
467
|
+
D) **None** - Build custom components
|
|
468
|
+
|
|
469
|
+
**For Solid:**
|
|
470
|
+
A) **Hope UI** - Chakra-inspired for Solid
|
|
471
|
+
B) **Solid UI** - Minimalist component library
|
|
472
|
+
C) **None** - Build custom components
|
|
473
|
+
|
|
474
|
+
**Your choice:** (specify library or None)
|
|
502
475
|
---
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
**
|
|
513
|
-
|
|
514
|
-
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
**
|
|
525
|
-
|
|
526
|
-
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
**
|
|
535
|
-
|
|
536
|
-
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
**
|
|
544
|
-
|
|
545
|
-
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
**
|
|
550
|
-
|
|
551
|
-
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
**Your choice:** (specify option)
|
|
556
|
-
|
|
476
|
+
## Question 2.6: State Management
|
|
477
|
+
|
|
478
|
+
**Question:** How will you manage global state?
|
|
479
|
+
|
|
480
|
+
**Context:** Choose based on app complexity and team preference.
|
|
481
|
+
|
|
482
|
+
**Options:**
|
|
483
|
+
|
|
484
|
+
**For React:**
|
|
485
|
+
A) ⭐ **Zustand** (Recommended - Simple, modern)
|
|
486
|
+
- Minimal boilerplate, hooks-based
|
|
487
|
+
- Best for: Most apps
|
|
488
|
+
B) **Redux Toolkit** - Predictable, DevTools
|
|
489
|
+
- Best for: Complex state, time-travel debugging
|
|
490
|
+
C) **Jotai** - Atomic state management
|
|
491
|
+
- Best for: Fine-grained state control
|
|
492
|
+
D) **Context API** - Built-in React
|
|
493
|
+
- Best for: Simple global state (theme, auth)
|
|
494
|
+
E) **None** - Local state only (useState, useReducer)
|
|
495
|
+
|
|
496
|
+
**For Vue:**
|
|
497
|
+
A) ⭐ **Pinia** (Recommended - Official)
|
|
498
|
+
- TypeScript-first, simple API
|
|
499
|
+
- Best for: Most Vue 3 apps
|
|
500
|
+
B) **Vuex 4** - Classic Vue state management
|
|
501
|
+
- Best for: Existing Vuex apps
|
|
502
|
+
C) **Composition API + provide/inject**
|
|
503
|
+
- Built-in Vue, simple
|
|
504
|
+
- Best for: Small to medium apps
|
|
505
|
+
|
|
506
|
+
**For Angular:**
|
|
507
|
+
A) ⭐ **NgRx** (Recommended - Redux for Angular)
|
|
508
|
+
- Reactive, RxJS-based
|
|
509
|
+
- Best for: Enterprise Angular apps
|
|
510
|
+
B) **Akita** - Simple, object-oriented
|
|
511
|
+
- Best for: Easier learning curve
|
|
512
|
+
C) **Services + RxJS** - Angular built-in
|
|
513
|
+
- Best for: Simple state needs
|
|
514
|
+
|
|
515
|
+
**For Svelte:**
|
|
516
|
+
A) ⭐ **Svelte Stores** (Built-in, recommended)
|
|
517
|
+
- Reactive stores, simple API
|
|
518
|
+
- Best for: Most Svelte apps
|
|
519
|
+
B) **None** - Component state only
|
|
520
|
+
|
|
521
|
+
**For Solid:**
|
|
522
|
+
A) ⭐ **Solid Store** (Built-in, recommended)
|
|
523
|
+
- Fine-grained reactivity
|
|
524
|
+
- Best for: Most Solid apps
|
|
525
|
+
B) **None** - Signals only
|
|
526
|
+
|
|
527
|
+
**Your choice:** (specify option)
|
|
557
528
|
---
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
-
|
|
569
|
-
-
|
|
570
|
-
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
**Your choice:** (A/B/C/D/E/F)
|
|
594
|
-
|
|
529
|
+
## Question 2.7: Data Fetching
|
|
530
|
+
|
|
531
|
+
**Question:** How will you fetch and cache server data?
|
|
532
|
+
|
|
533
|
+
**Context:** Modern data fetching libraries handle caching, revalidation, and loading states.
|
|
534
|
+
|
|
535
|
+
**Options:**
|
|
536
|
+
|
|
537
|
+
A) ⭐ **TanStack Query (React Query)** (Recommended)
|
|
538
|
+
- Works with React, Vue, Svelte, Solid
|
|
539
|
+
- Automatic caching, background updates
|
|
540
|
+
- Best for: REST APIs, GraphQL
|
|
541
|
+
- Features: Pagination, infinite scroll, optimistic updates
|
|
542
|
+
|
|
543
|
+
B) **SWR** (Stale-While-Revalidate)
|
|
544
|
+
- Lightweight, hooks-based (React)
|
|
545
|
+
- Best for: Simple data fetching
|
|
546
|
+
|
|
547
|
+
C) **Apollo Client** (GraphQL only)
|
|
548
|
+
- Complete GraphQL client
|
|
549
|
+
- Best for: GraphQL APIs
|
|
550
|
+
|
|
551
|
+
D) **RTK Query** (Redux Toolkit)
|
|
552
|
+
- Integrated with Redux
|
|
553
|
+
- Best for: Redux-based apps
|
|
554
|
+
|
|
555
|
+
E) **Axios + manual caching**
|
|
556
|
+
- Traditional approach
|
|
557
|
+
- Best for: Simple apps
|
|
558
|
+
|
|
559
|
+
F) **Native fetch + useState**
|
|
560
|
+
- No dependencies
|
|
561
|
+
- Best for: Minimal apps
|
|
562
|
+
|
|
563
|
+
**Your choice:** (A/B/C/D/E/F)
|
|
595
564
|
---
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
**
|
|
606
|
-
-
|
|
607
|
-
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
**
|
|
613
|
-
|
|
614
|
-
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
**
|
|
624
|
-
|
|
625
|
-
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
**
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
**
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
**
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
**Your choice:** (specify router or "meta-framework built-in")
|
|
640
|
-
|
|
565
|
+
## Question 2.8: Routing
|
|
566
|
+
|
|
567
|
+
**Question:** How will you handle routing?
|
|
568
|
+
|
|
569
|
+
**Context:** Most meta-frameworks include routing. For SPAs, you need a routing library.
|
|
570
|
+
|
|
571
|
+
**Options:**
|
|
572
|
+
|
|
573
|
+
**If using meta-framework (Next.js, Nuxt, SvelteKit, etc.):**
|
|
574
|
+
- ⭐ **Use built-in file-based routing** (Recommended)
|
|
575
|
+
- pages/ directory = routes
|
|
576
|
+
- No configuration needed
|
|
577
|
+
|
|
578
|
+
**If building SPA:**
|
|
579
|
+
|
|
580
|
+
**For React:**
|
|
581
|
+
A) ⭐ **React Router 6+** (Recommended)
|
|
582
|
+
- Industry standard
|
|
583
|
+
- Data loading, nested routes
|
|
584
|
+
B) **TanStack Router**
|
|
585
|
+
- Type-safe, modern
|
|
586
|
+
- Best for: TypeScript-heavy apps
|
|
587
|
+
C) **Wouter**
|
|
588
|
+
- Tiny, minimalist
|
|
589
|
+
- Best for: Small apps
|
|
590
|
+
|
|
591
|
+
**For Vue:**
|
|
592
|
+
A) ⭐ **Vue Router 4** (Official, recommended)
|
|
593
|
+
- Composition API support
|
|
594
|
+
- Nested routes, guards
|
|
595
|
+
|
|
596
|
+
**For Angular:**
|
|
597
|
+
A) ⭐ **Angular Router** (Built-in, only option)
|
|
598
|
+
|
|
599
|
+
**For Svelte:**
|
|
600
|
+
A) ⭐ **SvelteKit routing** (Built-in)
|
|
601
|
+
B) **Page.js** (for non-SvelteKit SPAs)
|
|
602
|
+
|
|
603
|
+
**For Solid:**
|
|
604
|
+
A) ⭐ **Solid Router** (Official)
|
|
605
|
+
B) **@solidjs/router**
|
|
606
|
+
|
|
607
|
+
**Your choice:** (specify router or "meta-framework built-in")
|
|
641
608
|
---
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
**
|
|
652
|
-
|
|
653
|
-
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
**
|
|
663
|
-
|
|
664
|
-
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
**
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
**
|
|
677
|
-
|
|
678
|
-
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
**
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
**Your choice:** (specify library or native)
|
|
688
|
-
|
|
609
|
+
## Question 2.9: Form Management
|
|
610
|
+
|
|
611
|
+
**Question:** How will you handle complex forms?
|
|
612
|
+
|
|
613
|
+
**Context:** Form libraries handle validation, errors, and submission state.
|
|
614
|
+
|
|
615
|
+
**Options:**
|
|
616
|
+
|
|
617
|
+
**For React:**
|
|
618
|
+
A) ⭐ **React Hook Form** (Recommended)
|
|
619
|
+
- Minimal re-renders, performance-focused
|
|
620
|
+
- Best for: Complex forms
|
|
621
|
+
B) **Formik**
|
|
622
|
+
- Popular, full-featured
|
|
623
|
+
- Best for: Traditional form handling
|
|
624
|
+
C) **Native HTML forms**
|
|
625
|
+
- No library
|
|
626
|
+
- Best for: Simple forms
|
|
627
|
+
|
|
628
|
+
**For Vue:**
|
|
629
|
+
A) ⭐ **VeeValidate 4**
|
|
630
|
+
- Composition API, flexible
|
|
631
|
+
- Best for: Complex forms
|
|
632
|
+
B) **Native v-model**
|
|
633
|
+
- Built-in Vue
|
|
634
|
+
- Best for: Simple forms
|
|
635
|
+
|
|
636
|
+
**For Angular:**
|
|
637
|
+
A) ⭐ **Reactive Forms** (Built-in, recommended)
|
|
638
|
+
- Strongly typed, testable
|
|
639
|
+
B) **Template-driven Forms**
|
|
640
|
+
- Simpler, less control
|
|
641
|
+
|
|
642
|
+
**For Svelte:**
|
|
643
|
+
A) **Svelte Native** (bind:value)
|
|
644
|
+
- Built-in two-way binding
|
|
645
|
+
- Best for: Most forms
|
|
646
|
+
B) **Felte** - Form library for Svelte
|
|
647
|
+
|
|
648
|
+
**For Solid:**
|
|
649
|
+
A) **Solid Forms**
|
|
650
|
+
- Form library for Solid
|
|
651
|
+
B) **Native** - Solid signals
|
|
652
|
+
|
|
653
|
+
**Your choice:** (specify library or native)
|
|
689
654
|
---
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
-
|
|
701
|
-
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
**If Tailwind:** Will you use any Tailwind plugins? (typography, forms, etc.)
|
|
727
|
-
|
|
655
|
+
## Question 2.10: Styling Approach
|
|
656
|
+
|
|
657
|
+
**Question:** How will you style components?
|
|
658
|
+
|
|
659
|
+
**Context:** Choose based on team preference, design system needs, and performance requirements.
|
|
660
|
+
|
|
661
|
+
**Options:**
|
|
662
|
+
|
|
663
|
+
A) ⭐ **Tailwind CSS** (Recommended - Utility-first)
|
|
664
|
+
- Rapid development, consistent design
|
|
665
|
+
- JIT compiler, small bundle
|
|
666
|
+
- Best for: Most modern apps
|
|
667
|
+
|
|
668
|
+
B) **CSS Modules** (Scoped CSS)
|
|
669
|
+
- Standard CSS, locally scoped
|
|
670
|
+
- Best for: Traditional CSS developers
|
|
671
|
+
|
|
672
|
+
C) **Styled Components / Emotion** (CSS-in-JS)
|
|
673
|
+
- Dynamic styles, themed
|
|
674
|
+
- Best for: Component libraries
|
|
675
|
+
|
|
676
|
+
D) **Sass/SCSS** (CSS preprocessor)
|
|
677
|
+
- Variables, mixins, nesting
|
|
678
|
+
- Best for: Traditional workflow
|
|
679
|
+
|
|
680
|
+
E) **Vanilla CSS** (Plain CSS files)
|
|
681
|
+
- No dependencies
|
|
682
|
+
- Best for: Simple apps
|
|
683
|
+
|
|
684
|
+
F) **UnoCSS** (Instant atomic CSS)
|
|
685
|
+
- Faster than Tailwind
|
|
686
|
+
- Best for: Performance enthusiasts
|
|
687
|
+
|
|
688
|
+
**Your choice:** (A/B/C/D/E/F)
|
|
689
|
+
|
|
690
|
+
**If Tailwind:** Will you use any Tailwind plugins? (typography, forms, etc.)
|
|
728
691
|
---
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
--
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
- Will you support
|
|
763
|
-
- Will you support multiple themes? (Yes/No/Maybe later)
|
|
764
|
-
|
|
692
|
+
## Question 2.11: Design Tokens / Theming
|
|
693
|
+
|
|
694
|
+
**Question:** Will you use design tokens for theming?
|
|
695
|
+
|
|
696
|
+
**Context:** Design tokens centralize colors, spacing, typography for consistency.
|
|
697
|
+
|
|
698
|
+
**Options:**
|
|
699
|
+
|
|
700
|
+
A) ⭐ **Yes, CSS Variables** (Recommended)
|
|
701
|
+
- Dynamic theming, runtime changes
|
|
702
|
+
- Example:
|
|
703
|
+
```css
|
|
704
|
+
:root {
|
|
705
|
+
--color-primary: #3B82F6;
|
|
706
|
+
--spacing-md: 1rem;
|
|
707
|
+
}
|
|
708
|
+
```
|
|
709
|
+
|
|
710
|
+
B) **Yes, JavaScript/TypeScript tokens**
|
|
711
|
+
- Exported constants
|
|
712
|
+
- Type-safe
|
|
713
|
+
|
|
714
|
+
C) **Yes, Component library tokens**
|
|
715
|
+
- Use library's theming system (MUI, Chakra, etc.)
|
|
716
|
+
|
|
717
|
+
D) **No, hardcoded values**
|
|
718
|
+
- Direct colors/sizes in styles
|
|
719
|
+
- Best for: Small apps
|
|
720
|
+
|
|
721
|
+
**Your choice:** (A/B/C/D)
|
|
722
|
+
|
|
723
|
+
**If Yes to tokens:**
|
|
724
|
+
- Will you support dark mode? (Yes/No)
|
|
725
|
+
- Will you support multiple themes? (Yes/No/Maybe later)
|
|
765
726
|
---
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
-
|
|
777
|
-
-
|
|
778
|
-
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
-
|
|
783
|
-
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
**
|
|
797
|
-
- **
|
|
798
|
-
- **
|
|
799
|
-
- **
|
|
800
|
-
- **
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
**
|
|
804
|
-
-
|
|
805
|
-
- **
|
|
806
|
-
- **None** - Skip E2E for now
|
|
807
|
-
|
|
727
|
+
## Question 2.12: Testing Strategy
|
|
728
|
+
|
|
729
|
+
**Question:** What will you test in components?
|
|
730
|
+
|
|
731
|
+
**Context:** Testing ensures components work correctly and don't break.
|
|
732
|
+
|
|
733
|
+
**Options:**
|
|
734
|
+
|
|
735
|
+
A) ⭐ **Unit + Component + E2E** (Recommended - Comprehensive)
|
|
736
|
+
- Unit: Vitest / Jest
|
|
737
|
+
- Component: Testing Library (React/Vue/Svelte Testing Library)
|
|
738
|
+
- E2E: Playwright / Cypress
|
|
739
|
+
- Best for: Production apps
|
|
740
|
+
|
|
741
|
+
B) **Component + E2E** (Pragmatic)
|
|
742
|
+
- Skip pure unit tests
|
|
743
|
+
- Focus on user behavior
|
|
744
|
+
- Best for: Most apps
|
|
745
|
+
|
|
746
|
+
C) **E2E only** (High-level)
|
|
747
|
+
- Test critical user paths
|
|
748
|
+
- Best for: Small apps, MVPs
|
|
749
|
+
|
|
750
|
+
D) **Minimal** (Unit only)
|
|
751
|
+
- Test utilities and hooks only
|
|
752
|
+
- Best for: Prototypes
|
|
753
|
+
|
|
754
|
+
**Your choice:** (A/B/C/D)
|
|
755
|
+
|
|
756
|
+
**Component testing framework:**
|
|
757
|
+
- **React:** React Testing Library (recommended)
|
|
758
|
+
- **Vue:** Vue Test Utils
|
|
759
|
+
- **Angular:** Jasmine/Karma (built-in)
|
|
760
|
+
- **Svelte:** Svelte Testing Library
|
|
761
|
+
- **Solid:** Solid Testing Library
|
|
762
|
+
|
|
763
|
+
**E2E testing framework:**
|
|
764
|
+
- ⭐ **Playwright** (Recommended - Modern, fast)
|
|
765
|
+
- **Cypress** (Popular, DX-focused)
|
|
766
|
+
- **None** - Skip E2E for now
|
|
808
767
|
---
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
-
|
|
820
|
-
-
|
|
821
|
-
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
-
|
|
826
|
-
-
|
|
827
|
-
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
-
|
|
832
|
-
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
-
|
|
837
|
-
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
**
|
|
843
|
-
- **
|
|
844
|
-
- **
|
|
845
|
-
- **
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
**
|
|
849
|
-
- **
|
|
850
|
-
- **
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
**
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
**Your choice:** (A/B/C)
|
|
876
|
-
|
|
768
|
+
## Question 2.13: API Integration Pattern
|
|
769
|
+
|
|
770
|
+
**Question:** How will you integrate with backend APIs?
|
|
771
|
+
|
|
772
|
+
**Context:** Define how your frontend communicates with backend services.
|
|
773
|
+
|
|
774
|
+
**Options:**
|
|
775
|
+
|
|
776
|
+
A) ⭐ **REST API with Fetch/Axios**
|
|
777
|
+
- Standard REST endpoints
|
|
778
|
+
- Client: Axios, Fetch API, or custom wrapper
|
|
779
|
+
- Best for: Most apps, simple integration
|
|
780
|
+
- Example: `GET /api/users`, `POST /api/users`
|
|
781
|
+
|
|
782
|
+
B) **GraphQL with Apollo/urql**
|
|
783
|
+
- Single endpoint, flexible queries
|
|
784
|
+
- Client: Apollo Client, urql, or TanStack Query GraphQL
|
|
785
|
+
- Best for: Complex data requirements, mobile apps
|
|
786
|
+
- Example: `query { users { id name } }`
|
|
787
|
+
|
|
788
|
+
C) **tRPC (TypeScript RPC)**
|
|
789
|
+
- End-to-end type safety
|
|
790
|
+
- Best for: TypeScript monorepos, type-safe APIs
|
|
791
|
+
- Example: `trpc.users.getById.useQuery({ id: '1' })`
|
|
792
|
+
|
|
793
|
+
D) **gRPC-Web**
|
|
794
|
+
- Protocol buffers, efficient binary format
|
|
795
|
+
- Best for: High-performance, microservices
|
|
796
|
+
- Example: `client.getUser({ id: '1' })`
|
|
797
|
+
|
|
798
|
+
**Your choice:** (A/B/C/D)
|
|
799
|
+
|
|
800
|
+
**If REST selected:**
|
|
801
|
+
- **API Client:** Axios / Fetch API / Custom wrapper
|
|
802
|
+
- **Base URL:** __
|
|
803
|
+
- **Request interceptors:** [Auth headers, error handling, logging]
|
|
804
|
+
- **Response interceptors:** [Error transformation, token refresh]
|
|
805
|
+
|
|
806
|
+
**If GraphQL selected:**
|
|
807
|
+
- **Client:** Apollo Client / urql / TanStack Query GraphQL
|
|
808
|
+
- **Endpoint:** __
|
|
809
|
+
- **Subscriptions:** [Yes/No - Real-time updates]
|
|
810
|
+
|
|
811
|
+
**API Layer Pattern:**
|
|
812
|
+
A) ⭐ **Service Layer** - Separate API functions
|
|
813
|
+
```
|
|
814
|
+
services/
|
|
815
|
+
api.ts (base client)
|
|
816
|
+
users.ts (user endpoints)
|
|
817
|
+
products.ts (product endpoints)
|
|
818
|
+
```
|
|
819
|
+
|
|
820
|
+
B) **Hooks/Composables Layer** - API calls in hooks
|
|
821
|
+
```
|
|
822
|
+
hooks/
|
|
823
|
+
useUsers.ts (API calls + state)
|
|
824
|
+
useProducts.ts
|
|
825
|
+
```
|
|
826
|
+
|
|
827
|
+
C) **Both** - Services + Hooks
|
|
828
|
+
```
|
|
829
|
+
services/ (API functions)
|
|
830
|
+
hooks/ (React hooks/Vue composables)
|
|
831
|
+
```
|
|
832
|
+
|
|
833
|
+
**Your choice:** (A/B/C)
|
|
877
834
|
---
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
**
|
|
888
|
-
|
|
889
|
-
-
|
|
890
|
-
-
|
|
891
|
-
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
**
|
|
899
|
-
|
|
900
|
-
-
|
|
901
|
-
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
**
|
|
905
|
-
|
|
906
|
-
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
**
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
**
|
|
916
|
-
- **
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
**Your answer:**
|
|
920
|
-
|
|
835
|
+
## Question 2.14: Error Boundaries / Global Error Handling
|
|
836
|
+
|
|
837
|
+
**Question:** How will you handle global errors?
|
|
838
|
+
|
|
839
|
+
**Context:** Catch and handle errors that occur during rendering, lifecycle methods, and constructors.
|
|
840
|
+
|
|
841
|
+
**Options:**
|
|
842
|
+
|
|
843
|
+
**For React:**
|
|
844
|
+
A) ⭐ **Error Boundaries** (Recommended)
|
|
845
|
+
- Catch component tree errors
|
|
846
|
+
- Show fallback UI
|
|
847
|
+
- Best for: React apps
|
|
848
|
+
- Example: `<ErrorBoundary><App /></ErrorBoundary>`
|
|
849
|
+
|
|
850
|
+
B) **Global Error Handler + Error Boundary**
|
|
851
|
+
- Window error handler + Error Boundaries
|
|
852
|
+
- Best for: Comprehensive error handling
|
|
853
|
+
|
|
854
|
+
**For Vue:**
|
|
855
|
+
A) ⭐ **errorHandler** (Built-in)
|
|
856
|
+
- Global error handler
|
|
857
|
+
- Best for: Vue apps
|
|
858
|
+
- Example: `app.config.errorHandler = (err, instance, info) => { ... }`
|
|
859
|
+
|
|
860
|
+
**For Angular:**
|
|
861
|
+
A) ⭐ **ErrorHandler** (Built-in)
|
|
862
|
+
- Global error handler service
|
|
863
|
+
- Best for: Angular apps
|
|
864
|
+
|
|
865
|
+
**Error Recovery Strategy:**
|
|
866
|
+
A) ⭐ **Show fallback UI** - Display error message, retry button
|
|
867
|
+
B) **Redirect to error page** - Navigate to `/error`
|
|
868
|
+
C) **Log and continue** - Log error, show minimal notification
|
|
869
|
+
D) **Combined** - Different strategies for different error types
|
|
870
|
+
|
|
871
|
+
**Error Logging:**
|
|
872
|
+
- **Tool:** Sentry / LogRocket / Console only
|
|
873
|
+
- **What to log:** [Error message, stack trace, user context, component tree]
|
|
874
|
+
|
|
875
|
+
**Your answer:**
|
|
921
876
|
---
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
```
|
|
928
|
-
=================================================
|
|
929
|
-
PHASE 2 SUMMARY: Component Architecture
|
|
930
|
-
=================================================
|
|
931
|
-
|
|
932
|
-
UI Framework: {{UI_FRAMEWORK}} {{VERSION}}
|
|
933
|
-
Meta-framework: {{META_FRAMEWORK}}
|
|
934
|
-
Build Tool: {{BUILD_TOOL}}
|
|
935
|
-
TypeScript: {{TYPESCRIPT}}
|
|
936
|
-
|
|
937
|
-
Component Pattern: {{COMPONENT_PATTERN}}
|
|
938
|
-
Component Library: {{COMPONENT_LIBRARY}}
|
|
939
|
-
State Management: {{STATE_MANAGEMENT}}
|
|
940
|
-
Data Fetching: {{DATA_FETCHING}}
|
|
941
|
-
|
|
942
|
-
Routing: {{ROUTING}}
|
|
943
|
-
Forms: {{FORM_LIBRARY}}
|
|
944
|
-
Styling: {{STYLING_APPROACH}}
|
|
945
|
-
Design Tokens: {{DESIGN_TOKENS}}
|
|
946
|
-
Dark Mode: {{DARK_MODE_SUPPORT}}
|
|
947
|
-
|
|
948
|
-
Testing:
|
|
949
|
-
- Component: {{COMPONENT_TEST_LIBRARY}}
|
|
950
|
-
- E2E: {{E2E_FRAMEWORK}}
|
|
951
|
-
|
|
952
|
-
API Integration: {{API_INTEGRATION_PATTERN}}
|
|
953
|
-
API Client: {{API_CLIENT}}
|
|
954
|
-
Error Handling: {{ERROR_HANDLING_STRATEGY}}
|
|
955
|
-
|
|
956
|
-
=================================================
|
|
957
|
-
```
|
|
958
|
-
|
|
959
|
-
**Ask for confirmation:**
|
|
960
|
-
"Does this look correct? (Yes to continue, No to restart phase 2)"
|
|
961
|
-
|
|
962
|
-
**If Yes:**
|
|
963
|
-
"✅ Phase 2 complete! Moving to Phase 3: State Management & Data Flow..."
|
|
964
|
-
|
|
965
|
-
**If No:**
|
|
966
|
-
"Restarting Phase 2..."
|
|
967
|
-
|
|
877
|
+
## 📝 Phase 2 Summary
|
|
878
|
+
|
|
879
|
+
After all questions, show summary:
|
|
880
|
+
|
|
881
|
+
```
|
|
968
882
|
---
|
|
969
|
-
|
|
970
|
-
## 🎯 Next Steps
|
|
971
|
-
|
|
972
|
-
After Phase 2 completion, you will:
|
|
973
|
-
1. Update `ai-instructions.md` with tech stack
|
|
974
|
-
2. Generate `docs/components.md` with component patterns
|
|
975
|
-
3. Generate `docs/architecture.md` with system architecture
|
|
976
|
-
4. Continue to Phase 3: State Management & Data Flow
|
|
977
|
-
|
|
883
|
+
PHASE 2 SUMMARY: Component Architecture
|
|
978
884
|
---
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
885
|
+
UI Framework: {{UI_FRAMEWORK}} {{VERSION}}
|
|
886
|
+
Meta-framework: {{META_FRAMEWORK}}
|
|
887
|
+
Build Tool: {{BUILD_TOOL}}
|
|
888
|
+
TypeScript: {{TYPESCRIPT}}
|
|
889
|
+
|
|
890
|
+
Component Pattern: {{COMPONENT_PATTERN}}
|
|
891
|
+
Component Library: {{COMPONENT_LIBRARY}}
|
|
892
|
+
State Management: {{STATE_MANAGEMENT}}
|
|
893
|
+
Data Fetching: {{DATA_FETCHING}}
|
|
894
|
+
|
|
895
|
+
Routing: {{ROUTING}}
|
|
896
|
+
Forms: {{FORM_LIBRARY}}
|
|
897
|
+
Styling: {{STYLING_APPROACH}}
|
|
898
|
+
Design Tokens: {{DESIGN_TOKENS}}
|
|
899
|
+
Dark Mode: {{DARK_MODE_SUPPORT}}
|
|
900
|
+
|
|
901
|
+
Testing:
|
|
902
|
+
- Component: {{COMPONENT_TEST_LIBRARY}}
|
|
903
|
+
- E2E: {{E2E_FRAMEWORK}}
|
|
904
|
+
|
|
905
|
+
API Integration: {{API_INTEGRATION_PATTERN}}
|
|
906
|
+
API Client: {{API_CLIENT}}
|
|
907
|
+
Error Handling: {{ERROR_HANDLING_STRATEGY}}
|
|
908
|
+
---
|
|
909
|
+
```
|
|
910
|
+
|
|
911
|
+
**Ask for confirmation:**
|
|
912
|
+
"Does this look correct? (Yes to continue, No to restart phase 2)"
|
|
913
|
+
|
|
914
|
+
**If Yes:**
|
|
915
|
+
"✅ Phase 2 complete! Moving to Phase 3: State Management & Data Flow..."
|
|
916
|
+
|
|
917
|
+
**If No:**
|
|
918
|
+
"Restarting Phase 2..."
|
|
919
|
+
---
|
|
920
|
+
## 🎯 Next Steps
|
|
921
|
+
|
|
922
|
+
After Phase 2 completion, you will:
|
|
923
|
+
1. Update `ai-instructions.md` with tech stack
|
|
924
|
+
2. Generate `docs/components.md` with component patterns
|
|
925
|
+
3. Generate `docs/architecture.md` with system architecture
|
|
926
|
+
4. Continue to Phase 3: State Management & Data Flow
|
|
927
|
+
---
|
|
928
|
+
**Phase:** 2 of 7
|
|
929
|
+
**Estimated time:** 15-20 minutes
|
|
930
|
+
**Documents updated:** ai-instructions.md, docs/components.md, docs/architecture.md
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
|
|
983
936
|
|
|
984
937
|
|