@@ -44,22 +44,32 @@ managed — is decided early, hard to reverse, and disproportionately shapes the
4444quality. In practice these decisions are too often made by trend rather than by an explicit
4545trade-off analysis.
4646
47- ** Architecture Advisor** is a planned, fully client-side web app that turns that decision into
48- a transparent pipeline:
49-
50- ```
51- PROJECT FACTORS ─► QUALITY-ATTRIBUTE PRIORITIES ─► ARCHITECTURE FIT ─► ANALYSIS
52- (drivers & (a weighted "utility tree" of (how well each option (trade-offs, risks,
53- constraints) quality attributes, grounded satisfies the sensitivity, fitness
54- in ISO/IEC 25010:2023) prioritized QAs across functions, ADR/report)
55- 5 orthogonal dimensions)
47+ ** Architecture Advisor** is a fully client-side web app that turns that decision into a
48+ transparent pipeline:
49+
50+ ``` mermaid
51+ flowchart LR
52+ F["PROJECT FACTORS<br/><i>drivers & constraints</i>"]
53+ --> Q["QUALITY-ATTRIBUTE PRIORITIES<br/><i>weighted utility tree,<br/>ISO/IEC 25010:2023</i>"]
54+ --> A["ARCHITECTURE FIT<br/><i>how well each option satisfies<br/>the priorities, across 5 dimensions</i>"]
55+ --> O["ANALYSIS & OUTPUT<br/><i>trade-offs, risks, sensitivity,<br/>fitness functions, ADR / report</i>"]
5656```
5757
5858You answer a handful of questions about your project; the tool recommends an architecture
5959across five dimensions, ranks the alternatives, and — critically — ** shows the full
6060calculation** : which factor raised which quality attribute, and how that produced the score.
6161Experts get auditable numbers and editable weights; newcomers get plain-language explanations.
6262
63+ ** Two ways in.** Start from a ** Scenario Card Gallery** — searchable, tag-filterable cards for
64+ ten pre-built scenarios (startup MVP, regulated fintech, high-traffic e-commerce, IoT streaming,
65+ legacy modernization, …) — or open the ** Custom Architecture Wizard** (the dominant dashed
66+ "Build custom system" card): a foolproof guided builder that captures four universal variables
67+ (Primary System Goal · Domain/Industry · Hard Constraints · prioritized NFRs) and maps them onto
68+ the ** same frozen scoring engine** — there is exactly one scoring model, never a parallel one.
69+ Running a scenario briefly surfaces the engine's ** real** analysis stages as a developer terminal
70+ readout (weights → score 21 options → anti-patterns → rank), then reveals the result — no fake
71+ latency, and instant under ` prefers-reduced-motion ` .
72+
6373It adapts established methods — ** ISO/IEC 25010:2023** , ** ATAM** , ** Attribute-Driven Design** ,
6474and ** evolutionary-architecture fitness functions** — into an interactive tool, and is honest
6575about uncertainty: scores are * tunable heuristics, not facts* .
@@ -100,6 +110,42 @@ see the [content rollout plan](docs/03-blueprint/content-rollout-plan.md).
100110> [ evolution roadmap] ( docs/01-discovery-and-planning/discovery-and-planning.md#15-versioning-policy--evolution-roadmap )
101111> for what's deferred beyond v1.0.
102112
113+ ## Workflow — the immutable four-step journey
114+
115+ Every scenario flows through the same four steps; ** Step 3 is the engine** (the "professional
116+ analysis"). The flow never changes — only the inputs do.
117+
118+ ``` mermaid
119+ flowchart LR
120+ subgraph S1["① Scenario & factors"]
121+ G["Scenario Card Gallery<br/>(search · tags)"]
122+ W["Custom Wizard<br/>(4 variables)"]
123+ F["14 project factors"]
124+ G --> F
125+ W -->|"wizardToLevels()"| F
126+ end
127+ subgraph S2["② Quality priorities"]
128+ QA["Derived ISO/IEC 25010<br/>weights (editable)"]
129+ end
130+ subgraph S3["③ Professional analysis"]
131+ E["Frozen scoring engine<br/>+ honest analysis stepper"]
132+ end
133+ subgraph S4["④ Strategic output"]
134+ R["Recommendation · radar ·<br/>sensitivity · ADR / report / share"]
135+ end
136+ S1 --> S2 --> S3 --> S4
137+ ```
138+
139+ - ** ① Scenario & factors** — pick a preset card, build a custom system with the wizard, or set the
140+ 14 factors directly. The wizard and presets both resolve to the same 14 factor levels.
141+ - ** ② Quality priorities** — the engine derives the twelve ISO/IEC 25010 quality-attribute weights;
142+ experts can pin/override any weight (the rest re-balance around it).
143+ - ** ③ Professional analysis** — the frozen engine scores all 21 architectures across the five
144+ dimensions. A brief, skippable terminal stepper surfaces the real pipeline stages, then the
145+ ranked result appears. ** Live factor edits recompute instantly** (no stepper).
146+ - ** ④ Strategic output** — the recommendation with a trade-off radar, sensitivity, anti-pattern
147+ warnings and migration paths; export an ADR (MADR), a full report, CSV/JSON, or a share link.
148+
103149## Run it locally
104150
105151> ** Prerequisite:** Node ** 24** (LTS) — the version is pinned in [ ` .nvmrc ` ] ( .nvmrc ) and used by all
@@ -128,7 +174,7 @@ traceable:
128174| 2 | [ Requirement Analysis] ( docs/02-requirement-analysis/ ) | [ SRS] ( docs/02-requirement-analysis/software-requirements-specification.md ) | 🔬 In progress |
129175| 3 | [ Blueprint (Design)] ( docs/03-blueprint/ ) | [ Design spec] ( docs/03-blueprint/design-specification.md ) + [ Model Data Sheet] ( docs/03-blueprint/model-data-sheet.md ) + [ Architecture Reader] ( docs/03-blueprint/architecture-reader.md ) + [ Content Rollout Plan] ( docs/03-blueprint/content-rollout-plan.md ) + [ UI prototype] ( docs/03-blueprint/prototype/index.html ) | 🔬 In progress |
130176| 4 | [ Development] ( docs/04-development/ ) | Source code (` src/ ` , scoring engine, components) | ✅ v1.0 implemented |
131- | 5 | [ Testing / QA] ( docs/05-testing-qa/ ) | [ Test plan] ( docs/05-testing-qa/test-plan.md ) — 99 Vitest + Playwright E2E + 3 model guards + content guard ; CI gates size/audit ; 14/16 AC automated | 🔬 In progress |
177+ | 5 | [ Testing / QA] ( docs/05-testing-qa/ ) | [ Test plan] ( docs/05-testing-qa/test-plan.md ) — 127 Vitest + 14 Playwright E2E + 6 guards ( model / docs / app-config / content / bundle-size / SEO) ; CI gates size/axe ; 14/16 AC automated | 🔬 In progress |
132178| 6 | [ Deployment / Release] ( docs/06-deployment/ ) | [ Live on GitHub Pages] ( https://programmershinobi.github.io/architecture-advisor/ ) via ` deploy.yml ` (CI/CD) | ✅ Live |
133179| 7 | [ Maintenance & Iteration] ( docs/07-maintenance/ ) | [ Changelog] ( CHANGELOG.md ) , Dependabot, issue/PR templates, [ security policy] ( SECURITY.md ) | 🔄 Ongoing |
134180
@@ -169,6 +215,82 @@ The canonical statement is [SRS §2.3 — Operating Environment](docs/02-require
1692155 . ** Actionable & shareable** — export an ADR (MADR) and a full report; share via URL.
1702166 . ** Open & evolving** — community-built, improving across versions.
171217
218+ ## Extending — scenarios, the Custom Wizard & the Step-3 UI
219+
220+ Everything below is ** typed, injectable config** — you add data, not logic. The frozen scoring
221+ model (` src/config/{factors,dimensions,qualityAttributes,factorQaMatrix}.ts ` ) is verified by
222+ ` npm run verify:model ` and must not change; new * scenarios* never touch it.
223+
224+ ### Add a preset scenario
225+
226+ Presets are strictly-typed ` Preset[] ` . Append one to [ ` src/config/presets.ts ` ] ( src/config/presets.ts )
227+ and give it filter tags in [ ` src/config/presetTags.ts ` ] ( src/config/presetTags.ts ) — the Card Gallery
228+ picks it up automatically. Helper presets are ` calibrated: false ` ; the five ratified ones stay
229+ ` true ` and are bit-pinned by the guards.
230+
231+ ``` ts
232+ // src/config/presets.ts
233+ {
234+ id : ' edge-cdn' ,
235+ label : { en : ' Edge / CDN app' , id : ' Aplikasi edge / CDN' },
236+ description : { en : ' Globally distributed, latency-critical, cache-heavy.' , id : ' …' },
237+ levels : levels ([1 , 2 , 1 , 1 , 2 , 2 , 1 , 1 , 2 , 1 , 0 , 1 , 0 , 2 ]), // 14 factors, values 0–2
238+ calibrated : false ,
239+ },
240+
241+ // src/config/presetTags.ts
242+ export const PRESET_TAGS = { /* … */ ' edge-cdn' : [' high-scale' , ' realtime' ] };
243+ ```
244+
245+ A unit test (` src/config/presets.test.ts ` ) pins each helper preset's engine outcome, so a bad
246+ scenario fails the build rather than silently drifting.
247+
248+ ### Add / modify a Custom Wizard question
249+
250+ The wizard is driven entirely by [ ` src/config/customWizard.ts ` ] ( src/config/customWizard.ts ) . Each
251+ option declares the factor ** nudges** it applies; the pure bridge
252+ [ ` src/lib/customWizard.ts ` ] ( src/lib/customWizard.ts ) combines them (ordered override from a moderate
253+ baseline, hard constraints last) into the 14 factor levels the frozen engine scores. ** No component
254+ edits are needed** — ` CustomWizard.tsx ` iterates this config.
255+
256+ ``` ts
257+ // src/config/customWizard.ts → add an option to the "goal" question
258+ {
259+ id : ' batch-etl' ,
260+ label : { en : ' Run heavy batch / ETL' , id : ' Jalankan batch / ETL berat' },
261+ hint : { en : ' Scheduled data pipelines at volume' , id : ' …' },
262+ levels : { dataVolume : 2 , async : 2 , scale : 2 , realtime : 0 }, // only real factor ids, 0–2
263+ },
264+ ```
265+
266+ ` wizardToLevels() ` is unit-tested (` src/lib/customWizard.test.ts ` ): every nudge must reference a
267+ real factor id at a valid level, and the output is always a complete, valid ` Levels ` object — even
268+ when the user answers nothing (it falls back to a balanced baseline; the engine can never crash).
269+
270+ ### Modify the Step-3 terminal UI (analysis stepper)
271+
272+ The developer-centric readout lives in
273+ [ ` src/components/advisor/AnalysisStepper.tsx ` ] ( src/components/advisor/AnalysisStepper.tsx ) . The
274+ stages are dict keys — edit the ` STAGES ` array and their strings in
275+ [ ` src/i18n/dict.ts ` ] ( src/i18n/dict.ts ) (` analysis.run.* ` ). Keep the stages ** honest** (they name
276+ real pipeline steps) and the total duration short; the component already renders nothing under
277+ ` prefers-reduced-motion ` . It is triggered by ` analysisRun ` in ` App.tsx ` , which increments on an
278+ explicit analyze action (preset/wizard apply) — never on a live factor edit.
279+
280+ ### Component map (Advisor tab)
281+
282+ | Area | Component | Notes |
283+ | ---| ---| ---|
284+ | Scenario gallery + wizard entry | [ ` components/advisor/PresetBar.tsx ` ] ( src/components/advisor/PresetBar.tsx ) | search, tag filters, dominant custom card |
285+ | Custom wizard (lazy modal) | [ ` components/advisor/CustomWizard.tsx ` ] ( src/components/advisor/CustomWizard.tsx ) | iterates the wizard config |
286+ | Wizard → engine bridge (pure) | [ ` lib/customWizard.ts ` ] ( src/lib/customWizard.ts ) | ` wizardToLevels() ` — the only mapping |
287+ | ① Project factors | [ ` components/advisor/FactorInputs.tsx ` ] ( src/components/advisor/FactorInputs.tsx ) · ` FactorField.tsx ` | 14 factors, per-level examples |
288+ | ② Quality priorities + adjuster | [ ` components/advisor/PrioritiesCard.tsx ` ] ( src/components/advisor/PrioritiesCard.tsx ) · ` QaOverridePanel.tsx ` | derived + editable weights |
289+ | ③ Analysis stepper | [ ` components/advisor/AnalysisStepper.tsx ` ] ( src/components/advisor/AnalysisStepper.tsx ) | honest terminal readout |
290+ | ③ Recommendation | ` DimensionCards.tsx ` · ` DimensionDetail.tsx ` · ` RadarPanel.tsx ` | ranked result + radar |
291+ | ④ Export / share | [ ` components/chrome/Toolbar.tsx ` ] ( src/components/chrome/Toolbar.tsx ) | ADR / report / CSV / JSON / share |
292+ | Pure scoring engine (frozen) | [ ` lib/scoring.ts ` ] ( src/lib/scoring.ts ) | ` rank() ` — the single source of truth |
293+
172294## Contributing
173295
174296Contributions are welcome — code, documentation, translations, and model review. Start with
0 commit comments