# duetds/duet-example-angular architecture

> Architecture diagram of the GitHub repository duetds/duet-example-angular, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/duetds/duet-example-angular
- Repository: https://github.com/duetds/duet-example-angular

## Overview

##### Main Application Structure

a. Client-Side Architecture (Single-Page Application)
- Divide it into the following logical layers:

##### Component Hierarchy

Core Components:
- App Component (Root)
- Header Component
- Index Page Component
- Investment Origin Component
- Investment Amount Component
- Summary Component
- Footer Component

##### Services Layer
Supporting services:
- Currency Formatter Service
- Routing Module

##### Design System Integration
- Duet Web Components (@duetds/angular)
- Duet Design Tokens
- Duet CSS Framework
- Duet Fonts

- Double lines: Component composition

##### Services (Bottom)

Specific elements:

##### Main Container

- Angular Application  |
- (Duet Example App)  |

##### Component Flow
**Header → Index Page → Investment Origin → Investment Amount → Summary → Footer**

##### Design System Integration

- Duet Design System |
- Components     |
- Tokens         |
- CSS Framework  |
- Fonts          |

##### Services

- Currency Formatter   |
- Service             |

##### Agreement model's relationship with components

Keep the abstraction level focused on the architectural components while showing the relationship between the Duet Design System and the application components. This will help developers understand both the application structure and how it leverages the design system.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph DuetSystem["Duet Design System Layer"]
        DuetComponents["@duetds/angular Components"]
        DuetTokens["Design Tokens"]
        DuetCSS["CSS Framework"]
        DuetFonts["Fonts"]
    end

    subgraph AppCore["Application Core"]
        AppModule["App Module"]:::core
        AppComponent["App Component"]:::core
        Router["Routing Module"]:::service
    end

    subgraph Components["Component Layer"]
        Header["Header Component"]:::component
        IndexPage["Index Page Component"]:::component
        InvestOrigin["Investment Origin Component"]:::component
        InvestAmount["Investment Amount Component"]:::component
        Summary["Summary Component"]:::component
        Footer["Footer Component"]:::component
    end

    subgraph Services["Services Layer"]
        CurrencyFormatter["Currency Formatter Service"]:::service
        Agreement["Agreement Model"]:::model
    end

    %% Relationships
    DuetSystem --> AppCore
    AppModule --> AppComponent
    AppComponent --> Header
    AppComponent --> Footer
    
    %% Component Flow
    Header --> IndexPage
    IndexPage --> InvestOrigin
    InvestOrigin --> InvestAmount
    InvestAmount --> Summary
    
    %% Service Dependencies
    Router --> IndexPage
    Router --> InvestOrigin
    Router --> InvestAmount
    Router --> Summary
    
    CurrencyFormatter --> InvestAmount
    CurrencyFormatter --> Summary
    
    Agreement --> InvestOrigin
    Agreement --> InvestAmount
    Agreement --> Summary

    %% Click Events
    click AppModule "https://github.com/duetds/duet-example-angular/blob/master/src/app/app.module.ts"
    click AppComponent "https://github.com/duetds/duet-example-angular/blob/master/src/app/app.component.ts"
    click Router "https://github.com/duetds/duet-example-angular/blob/master/src/app/app-routing.module.ts"
    click Header "https://github.com/duetds/duet-example-angular/blob/master/src/app/header/header.component.ts"
    click IndexPage "https://github.com/duetds/duet-example-angular/blob/master/src/app/index-page/index-page.component.ts"
    click InvestOrigin "https://github.com/duetds/duet-example-angular/blob/master/src/app/investment-origin/investment-origin.component.ts"
    click InvestAmount "https://github.com/duetds/duet-example-angular/blob/master/src/app/investment-amount/investment-amount.component.ts"
    click Summary "https://github.com/duetds/duet-example-angular/blob/master/src/app/summary/summary.component.ts"
    click Footer "https://github.com/duetds/duet-example-angular/blob/master/src/app/footer/footer.component.ts"
    click CurrencyFormatter "https://github.com/duetds/duet-example-angular/blob/master/src/app/currency-formatter.service.ts"
    click Agreement "https://github.com/duetds/duet-example-angular/blob/master/src/app/agreement.model.ts"

    %% Styling
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef component fill:#4CAF50,stroke:#2E7D32,color:white
    classDef service fill:#FF9800,stroke:#EF6C00,color:white
    classDef model fill:#9C27B0,stroke:#6A1B9A,color:white

    %% Legend
    subgraph Legend
        CoreL["Core Components"]:::core
        ComponentL["Application Components"]:::component
        ServiceL["Services"]:::service
        ModelL["Data Models"]:::model
    end
```
