ai-spector 0.1.0
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/LICENSE +21 -0
- package/README.md +150 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +173 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/analyze.d.ts +9 -0
- package/dist/commands/analyze.d.ts.map +1 -0
- package/dist/commands/analyze.js +62 -0
- package/dist/commands/analyze.js.map +1 -0
- package/dist/commands/bootstrap.d.ts +4 -0
- package/dist/commands/bootstrap.d.ts.map +1 -0
- package/dist/commands/bootstrap.js +58 -0
- package/dist/commands/bootstrap.js.map +1 -0
- package/dist/commands/graph-impact.d.ts +10 -0
- package/dist/commands/graph-impact.d.ts.map +1 -0
- package/dist/commands/graph-impact.js +31 -0
- package/dist/commands/graph-impact.js.map +1 -0
- package/dist/commands/graph-merge.d.ts +11 -0
- package/dist/commands/graph-merge.d.ts.map +1 -0
- package/dist/commands/graph-merge.js +88 -0
- package/dist/commands/graph-merge.js.map +1 -0
- package/dist/commands/graph-query.d.ts +10 -0
- package/dist/commands/graph-query.d.ts.map +1 -0
- package/dist/commands/graph-query.js +31 -0
- package/dist/commands/graph-query.js.map +1 -0
- package/dist/commands/graph-visualize.d.ts +10 -0
- package/dist/commands/graph-visualize.d.ts.map +1 -0
- package/dist/commands/graph-visualize.js +72 -0
- package/dist/commands/graph-visualize.js.map +1 -0
- package/dist/commands/init.d.ts +6 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +47 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/validate.d.ts +10 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +89 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/config/load.d.ts +21 -0
- package/dist/config/load.d.ts.map +1 -0
- package/dist/config/load.js +77 -0
- package/dist/config/load.js.map +1 -0
- package/dist/config/types.d.ts +22 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +2 -0
- package/dist/config/types.js.map +1 -0
- package/dist/graph/InMemoryGraph.d.ts +20 -0
- package/dist/graph/InMemoryGraph.d.ts.map +1 -0
- package/dist/graph/InMemoryGraph.js +181 -0
- package/dist/graph/InMemoryGraph.js.map +1 -0
- package/dist/graph/defaults.d.ts +10 -0
- package/dist/graph/defaults.d.ts.map +1 -0
- package/dist/graph/defaults.js +10 -0
- package/dist/graph/defaults.js.map +1 -0
- package/dist/graph/impact.d.ts +32 -0
- package/dist/graph/impact.d.ts.map +1 -0
- package/dist/graph/impact.js +88 -0
- package/dist/graph/impact.js.map +1 -0
- package/dist/graph/knowledge.d.ts +53 -0
- package/dist/graph/knowledge.d.ts.map +1 -0
- package/dist/graph/knowledge.js +79 -0
- package/dist/graph/knowledge.js.map +1 -0
- package/dist/graph/load.d.ts +4 -0
- package/dist/graph/load.d.ts.map +1 -0
- package/dist/graph/load.js +12 -0
- package/dist/graph/load.js.map +1 -0
- package/dist/graph/loadGraph.d.ts +3 -0
- package/dist/graph/loadGraph.d.ts.map +1 -0
- package/dist/graph/loadGraph.js +7 -0
- package/dist/graph/loadGraph.js.map +1 -0
- package/dist/graph/merge.d.ts +15 -0
- package/dist/graph/merge.d.ts.map +1 -0
- package/dist/graph/merge.js +63 -0
- package/dist/graph/merge.js.map +1 -0
- package/dist/graph/query.d.ts +18 -0
- package/dist/graph/query.d.ts.map +1 -0
- package/dist/graph/query.js +132 -0
- package/dist/graph/query.js.map +1 -0
- package/dist/registry/build.d.ts +3 -0
- package/dist/registry/build.d.ts.map +1 -0
- package/dist/registry/build.js +53 -0
- package/dist/registry/build.js.map +1 -0
- package/dist/registry/slug.d.ts +4 -0
- package/dist/registry/slug.d.ts.map +1 -0
- package/dist/registry/slug.js +16 -0
- package/dist/registry/slug.js.map +1 -0
- package/dist/types.d.ts +45 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/util/fs.d.ts +6 -0
- package/dist/util/fs.d.ts.map +1 -0
- package/dist/util/fs.js +24 -0
- package/dist/util/fs.js.map +1 -0
- package/dist/util/paths.d.ts +16 -0
- package/dist/util/paths.d.ts.map +1 -0
- package/dist/util/paths.js +19 -0
- package/dist/util/paths.js.map +1 -0
- package/dist/visualize/html.d.ts +13 -0
- package/dist/visualize/html.d.ts.map +1 -0
- package/dist/visualize/html.js +374 -0
- package/dist/visualize/html.js.map +1 -0
- package/dist/visualize/stats.d.ts +21 -0
- package/dist/visualize/stats.d.ts.map +1 -0
- package/dist/visualize/stats.js +45 -0
- package/dist/visualize/stats.js.map +1 -0
- package/documents.json +64 -0
- package/package.json +65 -0
- package/scaffold/.ai-spector/.docflow/config/analyze.graphify.json +40 -0
- package/scaffold/.ai-spector/.docflow/config/completeness-rules.basic-design.json +18 -0
- package/scaffold/.ai-spector/.docflow/config/completeness-rules.detail-design.json +57 -0
- package/scaffold/.ai-spector/.docflow/config/completeness-rules.srs.json +72 -0
- package/scaffold/.ai-spector/.docflow/config/dag.basic-design.json +38 -0
- package/scaffold/.ai-spector/.docflow/config/dag.detail-design.json +64 -0
- package/scaffold/.ai-spector/.docflow/config/dag.srs.json +87 -0
- package/scaffold/.ai-spector/.docflow/config/data-source.json +5 -0
- package/scaffold/.ai-spector/.docflow/config/index.docs.json +22 -0
- package/scaffold/.ai-spector/.docflow/config/workflow.dependencies.json +271 -0
- package/scaffold/.ai-spector/.docflow/extract/patch.example.json +20 -0
- package/scaffold/.ai-spector/.docflow/state.json +11 -0
- package/scaffold/.ai-spector/docflow.config.json +7 -0
- package/scaffold/.ai-spector/index/README.md +18 -0
- package/scaffold/.ai-spector/index/basic-design.md +5 -0
- package/scaffold/.ai-spector/index/srs.md +5 -0
- package/scaffold/.cursor/commands/_cli-failures.md +110 -0
- package/scaffold/.cursor/commands/_graph.md +48 -0
- package/scaffold/.cursor/commands/_prerequisites.md +48 -0
- package/scaffold/.cursor/commands/_workflow.md +50 -0
- package/scaffold/.cursor/commands/analyze.md +92 -0
- package/scaffold/.cursor/commands/generate-basic-design.md +26 -0
- package/scaffold/.cursor/commands/generate-detail-design.md +19 -0
- package/scaffold/.cursor/commands/generate-srs.md +63 -0
- package/scaffold/.cursor/commands/graph-impact.md +45 -0
- package/scaffold/.cursor/commands/index-docs.md +36 -0
- package/scaffold/.cursor/commands/sync-graph.md +30 -0
- package/scaffold/.cursor/commands/validate-graph.md +28 -0
- package/scaffold/.cursor/commands/visualize-graph.md +24 -0
- package/scaffold/.cursor/skills/ai-spector/SKILL.md +39 -0
- package/scaffold/docs/data-source/README.md +7 -0
- package/schemas/rules.impact.json +17 -0
- package/schemas/rules.traceability.json +30 -0
- package/schemas/schema.extract-patch.json +19 -0
- package/schemas/schema.graph.json +83 -0
- package/schemas/schema.knowledge.json +107 -0
- package/templates/basic_design/db-design-template.md +177 -0
- package/templates/basic_design/detail-api-template.md +278 -0
- package/templates/basic_design/detail-screen-template.md +281 -0
- package/templates/basic_design/list-api-template.md +130 -0
- package/templates/basic_design/list-screen-template.md +242 -0
- package/templates/detail_design/common/architecture-overview-template.md +302 -0
- package/templates/detail_design/common/deployment-infrastructure-template.md +461 -0
- package/templates/detail_design/common/error-handling-patterns-template.md +460 -0
- package/templates/detail_design/common/integration-patterns-template.md +410 -0
- package/templates/detail_design/common/performance-standards-template.md +406 -0
- package/templates/detail_design/common/security-patterns-template.md +395 -0
- package/templates/detail_design/feature-detail-design-template.md +773 -0
- package/templates/detail_design/feature-list-template.md +39 -0
- package/templates/srs/1-introduction.md +58 -0
- package/templates/srs/2-overall-description.md +91 -0
- package/templates/srs/3-use-case-detail-template.md +142 -0
- package/templates/srs/3-use-cases.md +53 -0
- package/templates/srs/4-system-feature-detail-template.md +131 -0
- package/templates/srs/4-system-features-list-template.md +39 -0
- package/templates/srs/5-data-requirements.md +59 -0
- package/templates/srs/6-external-interfaces.md +56 -0
- package/templates/srs/7-quality-attributes.md +74 -0
- package/templates/srs/8-internationalization.md +36 -0
- package/templates/srs/9-other-requirements.md +46 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# Screen Map: <Project Name>
|
|
2
|
+
|
|
3
|
+
> This document provides the design system overview, screen map (navigation flow), screen index, and common UI building blocks. For detailed layout and interactions per screen, see the Detail Screen document for each screen.
|
|
4
|
+
|
|
5
|
+
**Source Requirements:** SRS Section 6.1 (User Interfaces)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Design System Overview
|
|
10
|
+
|
|
11
|
+
**Color Palette:**
|
|
12
|
+
- Primary: <Color>
|
|
13
|
+
- Secondary: <Color>
|
|
14
|
+
- Accent: <Color>
|
|
15
|
+
- Background: <Color>
|
|
16
|
+
- Text: <Color>
|
|
17
|
+
|
|
18
|
+
**Typography:**
|
|
19
|
+
- Headings: <Font family, sizes>
|
|
20
|
+
- Body: <Font family, sizes>
|
|
21
|
+
- Buttons: <Font family, sizes>
|
|
22
|
+
|
|
23
|
+
**Spacing:**
|
|
24
|
+
- Base unit: <8px/4px>
|
|
25
|
+
- Component spacing: <Guidelines>
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 2. Screen Map (Navigation Flow)
|
|
30
|
+
|
|
31
|
+
> This diagram shows the relationships and navigation flow between all screens in the application.
|
|
32
|
+
|
|
33
|
+
**Mermaid Flowchart:**
|
|
34
|
+
```mermaid
|
|
35
|
+
flowchart TD
|
|
36
|
+
A[Login] --> B[Dashboard]
|
|
37
|
+
B --> C[Screen 1]
|
|
38
|
+
B --> D[Screen 2]
|
|
39
|
+
B --> E[Screen 3]
|
|
40
|
+
B --> F[Screen 4]
|
|
41
|
+
C --> G[Screen 5]
|
|
42
|
+
D --> G
|
|
43
|
+
E --> G
|
|
44
|
+
F --> G
|
|
45
|
+
G --> B
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Detailed Navigation Map:**
|
|
49
|
+
```
|
|
50
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
51
|
+
│ Screen Relationship Map │
|
|
52
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
53
|
+
|
|
54
|
+
Entry Point: Login Screen
|
|
55
|
+
│
|
|
56
|
+
├─→ Dashboard (Main Hub)
|
|
57
|
+
│ │
|
|
58
|
+
│ ├─→ Screen 1 (via Navigation Menu)
|
|
59
|
+
│ │ ├─→ Screen 1A (via Action Button)
|
|
60
|
+
│ │ └─→ Screen 1B (via Action Button)
|
|
61
|
+
│ │
|
|
62
|
+
│ ├─→ Screen 2 (via Navigation Menu)
|
|
63
|
+
│ │ └─→ Screen 2A (via Modal/Detail View)
|
|
64
|
+
│ │
|
|
65
|
+
│ ├─→ Screen 3 (via Navigation Menu)
|
|
66
|
+
│ │
|
|
67
|
+
│ └─→ Screen 4 (via Navigation Menu)
|
|
68
|
+
│ └─→ Screen 4A (via Action Button)
|
|
69
|
+
│
|
|
70
|
+
└─→ [Other Entry Points]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Navigation Patterns:**
|
|
74
|
+
- **Primary Navigation:** <Menu type - Sidebar/Top Nav/Bottom Nav>
|
|
75
|
+
- **Secondary Navigation:** <Breadcrumbs/Back buttons>
|
|
76
|
+
- **Modal/Overlay Screens:** <List screens that appear as modals>
|
|
77
|
+
- **Deep Links:** <Screens accessible via direct URL>
|
|
78
|
+
|
|
79
|
+
**User Role-Based Navigation:**
|
|
80
|
+
- **<Role 1>:** <List accessible screens>
|
|
81
|
+
- **<Role 2>:** <List accessible screens>
|
|
82
|
+
- **<Role 3>:** <List accessible screens>
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 3. Quick Reference: Common UI Elements
|
|
87
|
+
|
|
88
|
+
> Use these ASCII patterns as building blocks when describing components in detail screens.
|
|
89
|
+
|
|
90
|
+
**Card Component:**
|
|
91
|
+
```
|
|
92
|
+
┌─────────────────────────────┐
|
|
93
|
+
│ [Icon] Title │
|
|
94
|
+
│ ─────────────────────────── │
|
|
95
|
+
│ Content text here │
|
|
96
|
+
│ [Action Button] │
|
|
97
|
+
└─────────────────────────────┘
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Button:**
|
|
101
|
+
```
|
|
102
|
+
┌──────────────┐
|
|
103
|
+
│ Button Text │
|
|
104
|
+
└──────────────┘
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Input Field:**
|
|
108
|
+
```
|
|
109
|
+
┌──────────────────────────────┐
|
|
110
|
+
│ Label │
|
|
111
|
+
│ ┌──────────────────────────┐ │
|
|
112
|
+
│ │ Input text here │ │
|
|
113
|
+
│ └──────────────────────────┘ │
|
|
114
|
+
└──────────────────────────────┘
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Table/List:**
|
|
118
|
+
```
|
|
119
|
+
┌──────┬──────────┬──────────┐
|
|
120
|
+
│ Col1 │ Col2 │ Col3 │
|
|
121
|
+
├──────┼──────────┼──────────┤
|
|
122
|
+
│ Data │ Data │ Data │
|
|
123
|
+
│ Data │ Data │ Data │
|
|
124
|
+
└──────┴──────────┴──────────┘
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Modal/Dialog:**
|
|
128
|
+
```
|
|
129
|
+
┌─────────────────────┐
|
|
130
|
+
│ [X] Modal Title │
|
|
131
|
+
├─────────────────────┤
|
|
132
|
+
│ │
|
|
133
|
+
│ Modal Content │
|
|
134
|
+
│ │
|
|
135
|
+
│ [Cancel] [OK] │
|
|
136
|
+
└─────────────────────┘
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## 4. Screen Index
|
|
142
|
+
|
|
143
|
+
| Screen | Section (Detail Screen) | User Role | Purpose |
|
|
144
|
+
|--------|-------------------------|-----------|---------|
|
|
145
|
+
| <Screen 1> | 5 | <Role> | <Purpose> |
|
|
146
|
+
| <Screen 2> | 6 | <Role> | <Purpose> |
|
|
147
|
+
| <Screen 3> | 7 | <Role> | <Purpose> |
|
|
148
|
+
|
|
149
|
+
> Each screen has a corresponding section in the Detail Screen document with wireframe, layout, and interactions.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 5. Responsive Design Considerations
|
|
154
|
+
|
|
155
|
+
**Breakpoints:**
|
|
156
|
+
- Mobile: <Width>
|
|
157
|
+
- Tablet: <Width>
|
|
158
|
+
- Desktop: <Width>
|
|
159
|
+
|
|
160
|
+
**Mobile Adaptations:**
|
|
161
|
+
- <Adaptation 1>
|
|
162
|
+
- <Adaptation 2>
|
|
163
|
+
|
|
164
|
+
**Tablet Adaptations:**
|
|
165
|
+
- <Adaptation 1>
|
|
166
|
+
- <Adaptation 2>
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## 6. Common UI Patterns
|
|
171
|
+
|
|
172
|
+
**Buttons:**
|
|
173
|
+
- Primary: <Style>
|
|
174
|
+
- Secondary: <Style>
|
|
175
|
+
- Danger: <Style>
|
|
176
|
+
|
|
177
|
+
**Forms:**
|
|
178
|
+
- Input fields: <Style>
|
|
179
|
+
- Validation messages: <Style>
|
|
180
|
+
- Submit buttons: <Style>
|
|
181
|
+
|
|
182
|
+
**Tables/Lists:**
|
|
183
|
+
- Row style: <Style>
|
|
184
|
+
- Hover state: <Style>
|
|
185
|
+
- Selection: <Style>
|
|
186
|
+
|
|
187
|
+
**Modals/Dialogs:**
|
|
188
|
+
- Size: <Dimensions>
|
|
189
|
+
- Overlay: <Style>
|
|
190
|
+
- Close button: <Position>
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 7. Accessibility Considerations
|
|
195
|
+
|
|
196
|
+
**Keyboard Navigation:**
|
|
197
|
+
- <Requirement 1>
|
|
198
|
+
- <Requirement 2>
|
|
199
|
+
|
|
200
|
+
**Screen Reader Support:**
|
|
201
|
+
- <Requirement 1>
|
|
202
|
+
- <Requirement 2>
|
|
203
|
+
|
|
204
|
+
**Color Contrast:**
|
|
205
|
+
- <Requirement>
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## 8. Visual Resources
|
|
210
|
+
|
|
211
|
+
**Design Tools:**
|
|
212
|
+
> Reference tools used (Figma, Axure, Uizard, etc.)
|
|
213
|
+
|
|
214
|
+
**Wireframe Files:**
|
|
215
|
+
- Low-fidelity: `<path/to/wireframe.png>` or `<Figma Link>`
|
|
216
|
+
- High-fidelity: `<path/to/mockup.png>` or `<Figma Link>`
|
|
217
|
+
|
|
218
|
+
**Prototype Links:**
|
|
219
|
+
> Add links to interactive prototypes when available.
|
|
220
|
+
- Interactive prototype: `<Figma/InVision/Other Link>`
|
|
221
|
+
|
|
222
|
+
**Image Placeholders:**
|
|
223
|
+
> For markdown documents, you can reference images:
|
|
224
|
+
```markdown
|
|
225
|
+

|
|
226
|
+

|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## 9. Notes
|
|
232
|
+
|
|
233
|
+
**Visual Guidelines:**
|
|
234
|
+
> Tips for creating better visual mockups:
|
|
235
|
+
- Use consistent spacing (8px grid system)
|
|
236
|
+
- Show actual content examples, not just "Lorem ipsum"
|
|
237
|
+
- Include error states and empty states
|
|
238
|
+
- Show hover/active states for interactive elements
|
|
239
|
+
|
|
240
|
+
**Future Enhancements:**
|
|
241
|
+
- <Enhancement 1>
|
|
242
|
+
- <Enhancement 2>
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
# Architecture Overview: <Project Name>
|
|
2
|
+
|
|
3
|
+
> This document describes the system-wide architecture, technology stack, design principles, and architectural patterns used across all features.
|
|
4
|
+
|
|
5
|
+
**Source Requirements:** SRS Section 2 (Overall Description), Section 7 (Quality Attributes)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Overview
|
|
10
|
+
|
|
11
|
+
**Purpose:**
|
|
12
|
+
> Describe the purpose of this architecture document and its scope.
|
|
13
|
+
|
|
14
|
+
**Architecture Principles:**
|
|
15
|
+
- <Principle 1: e.g., Microservices architecture, separation of concerns>
|
|
16
|
+
- <Principle 2: e.g., API-first design>
|
|
17
|
+
- <Principle 3: e.g., Scalability and high availability>
|
|
18
|
+
- <Principle 4: e.g., Security by design>
|
|
19
|
+
|
|
20
|
+
**Design Goals:**
|
|
21
|
+
- <Goal 1>
|
|
22
|
+
- <Goal 2>
|
|
23
|
+
- <Goal 3>
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 2. System Context (C4 Level 1)
|
|
28
|
+
|
|
29
|
+
> High-level view showing the system and its relationships with users and external systems.
|
|
30
|
+
|
|
31
|
+
```mermaid
|
|
32
|
+
C4Context
|
|
33
|
+
title System Context Diagram
|
|
34
|
+
|
|
35
|
+
Person(user, "User", "End user of the system")
|
|
36
|
+
System(softwareSystem, "<System Name>", "Provides core functionality")
|
|
37
|
+
System_Ext(emailSystem, "Email Service", "External email service")
|
|
38
|
+
System_Ext(paymentSystem, "Payment Gateway", "External payment service")
|
|
39
|
+
|
|
40
|
+
Rel(user, softwareSystem, "Uses")
|
|
41
|
+
Rel(softwareSystem, emailSystem, "Sends emails via")
|
|
42
|
+
Rel(softwareSystem, paymentSystem, "Processes payments via")
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**External Systems:**
|
|
46
|
+
- <External System 1>: <Purpose and relationship>
|
|
47
|
+
- <External System 2>: <Purpose and relationship>
|
|
48
|
+
|
|
49
|
+
**Users:**
|
|
50
|
+
- <User Type 1>: <Role and interaction>
|
|
51
|
+
- <User Type 2>: <Role and interaction>
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 3. Container Architecture (C4 Level 2)
|
|
56
|
+
|
|
57
|
+
> Shows the high-level technical building blocks (applications, databases, file systems, etc.).
|
|
58
|
+
|
|
59
|
+
```mermaid
|
|
60
|
+
C4Container
|
|
61
|
+
title Container Diagram
|
|
62
|
+
|
|
63
|
+
Person(user, "User")
|
|
64
|
+
System_Boundary(systemBoundary, "<System Name>") {
|
|
65
|
+
Container(webApp, "Web Application", "React/Next.js", "Provides UI")
|
|
66
|
+
Container(api, "API Gateway", "Node.js/Express", "REST API")
|
|
67
|
+
Container(authService, "Authentication Service", "Node.js", "Handles authentication")
|
|
68
|
+
ContainerDb(database, "Database", "PostgreSQL", "Stores data")
|
|
69
|
+
Container(messageQueue, "Message Queue", "RabbitMQ", "Handles async processing")
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
System_Ext(emailService, "Email Service")
|
|
73
|
+
|
|
74
|
+
Rel(user, webApp, "Uses")
|
|
75
|
+
Rel(webApp, api, "API calls")
|
|
76
|
+
Rel(api, authService, "Validates tokens")
|
|
77
|
+
Rel(api, database, "Reads from and writes to")
|
|
78
|
+
Rel(api, messageQueue, "Publishes messages")
|
|
79
|
+
Rel(messageQueue, emailService, "Sends emails")
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Containers:**
|
|
83
|
+
|
|
84
|
+
| Container | Technology | Purpose | Responsibilities |
|
|
85
|
+
|-----------|------------|---------|------------------|
|
|
86
|
+
| Web Application | <Tech Stack> | <Purpose> | <Responsibilities> |
|
|
87
|
+
| API Gateway | <Tech Stack> | <Purpose> | <Responsibilities> |
|
|
88
|
+
| Database | <DBMS> | <Purpose> | <Responsibilities> |
|
|
89
|
+
| Message Queue | <MQ Technology> | <Purpose> | <Responsibilities> |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 4. Component Architecture (C4 Level 3)
|
|
94
|
+
|
|
95
|
+
> Shows how containers are broken down into components (for key containers only).
|
|
96
|
+
|
|
97
|
+
**Example: API Gateway Components**
|
|
98
|
+
|
|
99
|
+
```mermaid
|
|
100
|
+
C4Component
|
|
101
|
+
title API Gateway Component Diagram
|
|
102
|
+
|
|
103
|
+
Container_Boundary(apiGateway, "API Gateway") {
|
|
104
|
+
Component(authController, "Auth Controller", "Express Router", "Handles authentication endpoints")
|
|
105
|
+
Component(userController, "User Controller", "Express Router", "Handles user management")
|
|
106
|
+
Component(validationMiddleware, "Validation Middleware", "Express Middleware", "Validates requests")
|
|
107
|
+
Component(errorHandler, "Error Handler", "Express Middleware", "Handles errors")
|
|
108
|
+
ComponentDb(database, "Database")
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
Rel(authController, validationMiddleware, "Uses")
|
|
112
|
+
Rel(authController, errorHandler, "Uses")
|
|
113
|
+
Rel(userController, validationMiddleware, "Uses")
|
|
114
|
+
Rel(userController, database, "Reads from and writes to")
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## 5. Technology Stack
|
|
120
|
+
|
|
121
|
+
**Frontend:**
|
|
122
|
+
- Framework: <React/Vue/Angular>
|
|
123
|
+
- Language: <TypeScript/JavaScript>
|
|
124
|
+
- Build Tool: <Webpack/Vite>
|
|
125
|
+
- State Management: <Redux/Zustand>
|
|
126
|
+
- UI Library: <Material-UI/Ant Design>
|
|
127
|
+
|
|
128
|
+
**Backend:**
|
|
129
|
+
- Runtime: <Node.js/Python/Java>
|
|
130
|
+
- Framework: <Express/FastAPI/Spring Boot>
|
|
131
|
+
- Language: <TypeScript/Python/Java>
|
|
132
|
+
|
|
133
|
+
**Database:**
|
|
134
|
+
- Primary Database: <PostgreSQL/MySQL/MongoDB>
|
|
135
|
+
- Caching: <Redis/Memcached>
|
|
136
|
+
- Search: <Elasticsearch/OpenSearch> (if applicable)
|
|
137
|
+
|
|
138
|
+
**Infrastructure:**
|
|
139
|
+
- Containerization: <Docker>
|
|
140
|
+
- Orchestration: <Kubernetes/Docker Compose>
|
|
141
|
+
- Cloud Provider: <AWS/Azure/GCP>
|
|
142
|
+
- CI/CD: <GitHub Actions/Jenkins/GitLab CI>
|
|
143
|
+
|
|
144
|
+
**Other Services:**
|
|
145
|
+
- Message Queue: <RabbitMQ/Apache Kafka>
|
|
146
|
+
- Monitoring: <Prometheus/Grafana>
|
|
147
|
+
- Logging: <ELK Stack/CloudWatch>
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 6. Architectural Patterns
|
|
152
|
+
|
|
153
|
+
**Pattern 1: <Pattern Name>**
|
|
154
|
+
- **Description:** <Description of the pattern>
|
|
155
|
+
- **Rationale:** <Why this pattern is used>
|
|
156
|
+
- **Implementation:** <How it's implemented>
|
|
157
|
+
|
|
158
|
+
**Pattern 2: <Pattern Name>**
|
|
159
|
+
- **Description:** <Description>
|
|
160
|
+
- **Rationale:** <Rationale>
|
|
161
|
+
- **Implementation:** <Implementation>
|
|
162
|
+
|
|
163
|
+
**Common Patterns:**
|
|
164
|
+
- **Layered Architecture:** <Description>
|
|
165
|
+
- **Microservices:** <Description>
|
|
166
|
+
- **Event-Driven Architecture:** <Description>
|
|
167
|
+
- **API Gateway Pattern:** <Description>
|
|
168
|
+
- **Database per Service:** <Description>
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## 7. Design Principles
|
|
173
|
+
|
|
174
|
+
**Separation of Concerns:**
|
|
175
|
+
> Each component/module should have a single, well-defined responsibility.
|
|
176
|
+
|
|
177
|
+
**Loose Coupling:**
|
|
178
|
+
> Components should interact through well-defined interfaces, minimizing dependencies.
|
|
179
|
+
|
|
180
|
+
**High Cohesion:**
|
|
181
|
+
> Related functionality should be grouped together within components.
|
|
182
|
+
|
|
183
|
+
**Scalability:**
|
|
184
|
+
> System should be designed to handle growth in users, data, and transactions.
|
|
185
|
+
|
|
186
|
+
**Security:**
|
|
187
|
+
> Security should be built into every layer of the architecture.
|
|
188
|
+
|
|
189
|
+
**Observability:**
|
|
190
|
+
> System should provide visibility into its operations through logging, monitoring, and tracing.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 8. System Boundaries
|
|
195
|
+
|
|
196
|
+
**Internal Components:**
|
|
197
|
+
- <Component 1>
|
|
198
|
+
- <Component 2>
|
|
199
|
+
|
|
200
|
+
**External Dependencies:**
|
|
201
|
+
- <External Service 1>: <Purpose, SLA>
|
|
202
|
+
- <External Service 2>: <Purpose, SLA>
|
|
203
|
+
|
|
204
|
+
**Integration Points:**
|
|
205
|
+
- <Integration Point 1>: <Protocol, format>
|
|
206
|
+
- <Integration Point 2>: <Protocol, format>
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## 9. Data Flow
|
|
211
|
+
|
|
212
|
+
**High-Level Data Flow:**
|
|
213
|
+
|
|
214
|
+
```mermaid
|
|
215
|
+
flowchart LR
|
|
216
|
+
User[User] -->|Request| WebApp[Web Application]
|
|
217
|
+
WebApp -->|API Call| APIGateway[API Gateway]
|
|
218
|
+
APIGateway -->|Query| Database[(Database)]
|
|
219
|
+
APIGateway -->|Publish| MessageQueue[Message Queue]
|
|
220
|
+
MessageQueue -->|Process| WorkerService[Worker Service]
|
|
221
|
+
WorkerService -->|Update| Database
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Data Flow Patterns:**
|
|
225
|
+
- **Request-Response:** <Description>
|
|
226
|
+
- **Event-Driven:** <Description>
|
|
227
|
+
- **Batch Processing:** <Description>
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## 10. Non-Functional Requirements
|
|
232
|
+
|
|
233
|
+
**Performance:**
|
|
234
|
+
- API Response Time: <Target, e.g., < 200ms for 95th percentile>
|
|
235
|
+
- Throughput: <Target, e.g., 1000 requests/second>
|
|
236
|
+
- Database Query Time: <Target>
|
|
237
|
+
|
|
238
|
+
**Scalability:**
|
|
239
|
+
- Horizontal Scaling: <Approach>
|
|
240
|
+
- Vertical Scaling: <Approach>
|
|
241
|
+
- Auto-scaling: <Configuration>
|
|
242
|
+
|
|
243
|
+
**Availability:**
|
|
244
|
+
- Target Uptime: <99.9%>
|
|
245
|
+
- Disaster Recovery: <Strategy>
|
|
246
|
+
- Backup Strategy: <Strategy>
|
|
247
|
+
|
|
248
|
+
**Security:**
|
|
249
|
+
- Authentication: <Method>
|
|
250
|
+
- Authorization: <Method>
|
|
251
|
+
- Data Encryption: <At rest, in transit>
|
|
252
|
+
- Compliance: <Standards>
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## 11. Deployment Architecture
|
|
257
|
+
|
|
258
|
+
**Environments:**
|
|
259
|
+
- Development: <Description>
|
|
260
|
+
- Staging: <Description>
|
|
261
|
+
- Production: <Description>
|
|
262
|
+
|
|
263
|
+
**Deployment Strategy:**
|
|
264
|
+
- <Blue-Green/Canary/Rolling Update>
|
|
265
|
+
|
|
266
|
+
**Infrastructure Components:**
|
|
267
|
+
- Load Balancer: <Type and configuration>
|
|
268
|
+
- Application Servers: <Number and configuration>
|
|
269
|
+
- Database: <Configuration and replication>
|
|
270
|
+
- Caching Layer: <Configuration>
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## 12. References
|
|
275
|
+
|
|
276
|
+
**Related Documents:**
|
|
277
|
+
- [Security Patterns](../common/security-patterns-template.md)
|
|
278
|
+
- [Performance Standards](../common/performance-standards-template.md)
|
|
279
|
+
- [Integration Patterns](../common/integration-patterns-template.md)
|
|
280
|
+
- [Deployment & Infrastructure](../common/deployment-infrastructure-template.md)
|
|
281
|
+
- [Basic Design - API Design](../../basic_design/api-design-template.md)
|
|
282
|
+
- [Basic Design - Database Design](../../basic_design/db-design-template.md)
|
|
283
|
+
|
|
284
|
+
**SRS References:**
|
|
285
|
+
- SRS Section 2: Overall Description
|
|
286
|
+
- SRS Section 7: Quality Attributes
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## 13. Notes
|
|
291
|
+
|
|
292
|
+
**Design Decisions:**
|
|
293
|
+
- <Decision 1>: <Rationale>
|
|
294
|
+
- <Decision 2>: <Rationale>
|
|
295
|
+
|
|
296
|
+
**Trade-offs:**
|
|
297
|
+
- <Trade-off 1>: <Decision and rationale>
|
|
298
|
+
- <Trade-off 2>: <Decision and rationale>
|
|
299
|
+
|
|
300
|
+
**Future Considerations:**
|
|
301
|
+
- <Future enhancement 1>
|
|
302
|
+
- <Future enhancement 2>
|