- Project Name: FinLens
- Document Type: System Architecture Document
- Audience: Architects; Senior Engineers; Product Owner; Future Contributors
- Document Nature: Living, controlled
- Stability: High (changes only when architectural principles change)
This document defines HOW the FinLens system is structured at a logical and conceptual level.
It explains:
- Major system components
- Responsibilities and boundaries
- Data flow between components
- Architectural principles and constraints
This document does NOT:
- Select programming languages or frameworks
- Define deployment pipelines
- Describe UI styling
- Specify exact class or file structures
Architecture exists to control complexity and protect product intent.
The following drivers shape all architectural decisions:
- Non-technical user clarity
- Offline-first operation
- Deterministic, auditable output
- Headless backend / decoupled frontend
- Long-lived report usability
- Future extensibility without refactoring
Headless, Pipeline-Oriented, Offline-First Architecture
- Backend produces immutable artifacts
- Frontend consumes artifacts only
- No runtime coupling between backend and frontend
| Pattern | Purpose |
|---|---|
| Pipeline | Clear stage separation |
| Plugin-like Services | Service isolation |
| Immutable Data | Auditability |
| Config-Driven Execution | Predictability |
| Progressive Disclosure | UX clarity |
Operator
finlens scan
Scan Orchestrator
Service Collectors
Enrichment Engine
Data Processor
Report Generator
Static UI + JSON
Responsibility:
- Entry point for execution
- Coordinates entire scan lifecycle
Key Characteristics:
- Stateless
- Configuration-driven
- No cloud logic
Constraints:
- Single command execution
- No runtime user interaction
Responsibility:
- Load and validate configuration files
Handles:
- Profiles
- Regions
- Services
- Defaults
Failure Behavior:
- Invalid config fails early
- Clear error reporting
Responsibility:
- Communicate with cloud APIs
- Collect raw resource data
Design Rules:
- One collector per cloud service
- No cross-service knowledge
- Read-only behavior
Failure Isolation:
- Failure affects only that service
Responsibility:
- Collect usage and cost data
- Normalize cost representation
Constraints:
- Best-effort collection
- Missing data handled explicitly
Responsibility:
- Transform raw data into insights
Examples:
- Utilization signals
- Health flags
- Optimization hints
Design Principle:
- Explainable logic only
- No opaque heuristics
Responsibility:
- Structure enriched data into final form
Key Output:
- Processed JSON representing account state
Constraints:
- Deterministic ordering
- Stable schema
Responsibility:
- Package data and UI assets
Produces:
- Self-contained report directory
- Metadata file
- Processed data file
Constraints:
- Portable
- Immutable after generation
Responsibility:
- Interpret and present processed data
Characteristics:
- No backend dependency
- No cloud calls
- Purely client-side logic
Config -> Collectors -> Enrichment -> Processing -> JSON
JSON -> UI -> Human decisions
There is no reverse flow.
| Layer | Responsibility |
|---|---|
| Orchestration | Flow control |
| Collection | Raw data |
| Enrichment | Insight generation |
| Processing | Data structure |
| Presentation | Visualization |
Each layer:
- Has one purpose
- Does not leak responsibility
Required steps:
- Add configuration entry
- Implement service collector
- Define enrichment rules
- Extend processor mappings
- UI automatically adapts
No existing service logic should be modified.
- Schema versioning required
- Backward compatibility preferred
- Breaking changes are explicit
| Constraint | Reason |
|---|---|
| No runtime backend | Offline requirement |
| No UI enrichment | Trust & auditability |
| Immutable reports | Compliance |
| Config-only execution | Simplicity |
| Risk | Mitigation |
|---|---|
| Over-engineering | Minimal viable layers |
| Tight coupling | Strict boundaries |
| Schema churn | Versioning discipline |
| UX overload | Progressive disclosure |
- Data is the contract
- UI never guesses
- Offline is first-class
- Isolation beats cleverness
- Humans over systems
| Document | Alignment |
|---|---|
| BRD | Decision-centric |
| FRD | Functional coverage |
| NFR | Offline, deterministic |
Changes to:
- Component boundaries
- Data flow direction
- Headless model
Require:
- Architectural review
- Impact analysis
- Document update
Architecture Document Status
- Complete
- Authoritative
- Implementation-guiding