Link to the interactive prototype in Figma: Figma link
Source: docs/architecture/assets/context.mmd
graph TD
subgraph "Architecture Evaluation Tool"
AET["Architecture Evaluation Tool"]
end
subgraph "External Actors"
User["User"]
end
subgraph "External Systems"
PlantUML[("PlantUML Renderer")]
Storage[("Local Storage / Database")]
end
%% Interactions
User <-->|"Use web UI"| AET
AET -->|"Render component diagrams"| PlantUML
AET -->|"Store diagrams, matrices, diffs"| Storage
Source: docs/architecture/assets/use-cases.mmd
flowchart TD
subgraph Actors
User["User"]
end
subgraph UseCases
UC1(["Upload PlantUML Diagram"]):::uc
UC2(["Evaluate Architecture Matrix"]):::uc
UC3(["Compare Versions (Diff)"]):::uc
UC4(["Export Report"]):::uc
end
classDef uc fill:#eef,stroke:#336,stroke-width:1px
User --> UC1
User --> UC2
User --> UC3
User --> UC4
Source: docs/architecture/assets/components.puml
@startuml
skinparam componentStyle rectangle
skinparam wrapWidth 200
skinparam maxMessageSize 200
package "Architecture Evaluation Tool" {
[Web UI] as WebUI
[Upload Controller] as UploadController
[PlantUML Parser] as Parser
[Matrix Engine] as MatrixEngine
[Diff Engine] as DiffEngine
[Renderer Adapter] as RendererAdapter
[Storage] as Storage
}
WebUI --> UploadController : upload .puml
UploadController --> Parser : parse components
Parser --> MatrixEngine : build matrix model
WebUI --> MatrixEngine : edit scores / weights
WebUI --> DiffEngine : compare versions
MatrixEngine --> Storage : persist evaluations
DiffEngine --> Storage : read prior versions
WebUI --> RendererAdapter : preview diagram
RendererAdapter --> Parser : leverage PlantUML libs
note right of MatrixEngine
Calculates derived metrics and
quality attribute scores
end note
note right of DiffEngine
Computes structural/metric diffs
between two architecture versions
end note
@enduml
Source: docs/architecture/assets/seq-user-story.mmd
sequenceDiagram
participant User as User
participant UI as Browser UI
participant API as Backend API
participant Parser as PlantUML Parser
participant Matrix as Matrix Engine
participant Store as Storage
User->>UI: Select .puml and start evaluation
UI->>API: POST /diagrams (file)
API->>Parser: Parse components/relations
Parser-->>API: Parsed model
API->>Matrix: Initialize evaluation matrix
Matrix-->>API: Matrix model
API->>Store: Persist diagram + matrix
Store-->>API: Saved
API-->>UI: 201 Created + matrix data
UI->>UI: Render matrix and metrics
Source: docs/architecture/assets/seq-diff.mmd
sequenceDiagram
participant User as User
participant UI as Browser UI
participant API as Backend API
participant Store as Storage
participant Diff as Diff Engine
participant Render as Renderer Adapter
User->>UI: Select Version A and Version B
UI->>API: GET /diff?from=A&to=B
API->>Store: Fetch snapshot A
Store-->>API: Snapshot A
API->>Store: Fetch snapshot B
Store-->>API: Snapshot B
API->>Diff: Compute structural + metric diff
Diff-->>API: Diff summary + changed elements
API->>Render: Generate PlantUML diff preview
Render-->>API: Diff image/URL
API-->>UI: Diff payload (summary + visuals)
UI->>UI: Display changes and progress indicators
Derived from docs/requirements/quality-requirements.md#performance (QAS201: input-to-visual-update under 100ms).
Source: docs/architecture/assets/seq-qas.mmd
sequenceDiagram
%% QAS201: Responsive Matrix Interaction (<100ms)
participant User as User
participant UI as Browser UI
participant Calc as Client-side Matrix Engine
participant API as Backend API
User->>UI: Edit cell (score/weight)
UI->>Calc: Recompute derived metrics (debounced)
Calc-->>UI: Updated totals/visuals
UI->>UI: Update DOM (under 100ms)
Note over UI: Optimistic UI, Web Worker if needed
alt Background sync (throttled)
UI->>API: PATCH /matrix (delta)
API-->>UI: 200 OK
end
This section documents the five most important architectural decisions made during the design phase, including the rationale, alternatives considered, and trade-offs.
Decision: Adopt hexagonal architecture with clear separation between domain, application, and infrastructure layers.
Rationale:
Alternatives Considered:
Trade-offs:
Implementation:
app/domain/) contains entities, repositories
(interfaces), and parsers (interfaces)app/application/) contains use cases and
orchestrationapp/infrastructure/) provides concrete
implementations (in-memory storage, regex parser)app/presentation/) handles HTTP API concernsImpact: This decision enables the team to develop and test core functionality independently of storage and parsing implementations, supporting iterative development and early validation.
Decision: Perform matrix calculations and updates on the client-side (Flutter Web) with optimistic UI updates and background synchronization to the backend.
Rationale:
Alternatives Considered:
Trade-offs:
Implementation:
Impact: This decision directly addresses the performance quality requirement (QAS201) and enables the responsive matrix interaction that is critical for user satisfaction.
Decision: Package the entire application (frontend, backend, nginx) using Docker Compose for single-command deployment.
Rationale:
Alternatives Considered:
Trade-offs:
docker-compose up), reproducible
environments, easy for non-technical usersImplementation:
Impact: This decision enables frequent customer demos and early feedback cycles, which were emphasized as critical for project success. It also supports the educational use case where students need quick, reliable deployment.
Decision: Use PlantUML component diagrams as the standard input format and implement a regex-based parser for component and relationship extraction.
Rationale:
Alternatives Considered:
Trade-offs:
Implementation:
RegexPlantUMLParser in app/infrastructure/parsing/plantuml_parser.pyParseError exceptionsImpact: This decision establishes the foundation for all functionality. The parser’s accuracy (QAS302) directly affects the quality of the evaluation matrix. The regex approach allows rapid MVP delivery while maintaining the option to migrate to a library-based parser if needed.
Decision: Implement parsing, storage, and evaluation as independent, composable services with clear interfaces.
Rationale:
Alternatives Considered:
Trade-offs:
Implementation:
DiagramService: Orchestrates diagram upload, parsing, and
persistencePlantUMLParser: Abstract interface for parsing (implemented by
RegexPlantUMLParser)DiagramRepository: Abstract interface for persistence (implemented
by in-memory storage)DiagramStorage: Abstract interface for file storage (implemented by
local file system)MatrixEngine and DiffEngine as separate servicesImpact: This decision enables the team to deliver functionality incrementally (parsing in Sprint 2, matrix in Sprint 3, diff in Sprint 5) while maintaining clean architecture. It also supports the contingency plan of swapping parsers if PlantUML parsing proves unreliable.
Notes on Design Decisions:
Notes:
docs/architecture/assets/.
Generate images into the same folder or subfolders as needed.Progress tracking:
Storage with timestamps.Diff Engine computes deltas between snapshots to visualize
structural changes and quality score trends.