# titicacadev/triple-frontend architecture

> Architecture diagram of the GitHub repository titicacadev/triple-frontend, 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/titicacadev/triple-frontend
- Repository: https://github.com/titicacadev/triple-frontend

## Overview

##### High-Level Architecture Overview

a. Core Framework Layer:
- Next.js integration packages (triple-web-nextjs, triple-web-nextjs-pages) at the foundation
- Core utilities and type definitions packages

b. Component Layer:
- Main UI component library (tds-ui)
- Specialized widget components (tds-widget)
- Document handling components (triple-document, triple-email-document)

c. Feature Layer:
- Functional packages (router, fetcher, i18n)
- Experimental features (ab-experiments)
- Cross-cutting concerns (middlewares)

##### Package Dependencies

- Core infrastructure (blue)
- UI components (green)
- Utilities (gray)
- Feature modules (orange)

##### Integration Points

Integration areas:
- Storybook integration for component documentation
- Next.js framework integration
- Testing utilities and infrastructure
- Build and deployment pipeline

##### Component Architecture

For the UI component section:
- Components by type (basic, composite, specialized)
- Theme system integration (tds-theme)
- Shared utilities and hooks
- State management patterns

##### Development Infrastructure

A section showing:
- GitHub Actions workflows
- Testing framework integration
- Documentation generation
- Build system configuration

- Rectangles for packages
- Hexagons for core services
- Circles for integration points
- Double rectangles for framework components

Key Considerations:
##### Development workflow and tools

- Infrastructure and core utilities at the bottom
- UI components and widgets in the middle
- Application-specific integrations at the top

This will create a clear visualization of how the Triple Frontend system is structured and how its various components interact while maintaining a focus on its primary purpose as a component library and frontend framework.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Development Infrastructure"
        DevTools[".husky & .vscode"]
        Storybook[".storybook"]
        Testing["Testing Framework"]
        Docs["Documentation"]
        GHActions["GitHub Actions"]
    end

    subgraph "Feature Layer"
        Router["Router"]:::feature
        Fetcher["Fetcher"]:::feature
        I18n["i18n"]:::feature
        ABExp["AB Experiments"]:::feature
        Middleware["Middlewares"]:::feature
        Constants["Constants"]:::feature
    end

    subgraph "Component Layer"
        TdsUI["TDS UI Library"]:::component
        TdsWidget["TDS Widget"]:::component
        TdsTheme["TDS Theme"]:::component
        DocHandling["Document Handling"]:::component
        EmailDoc["Email Document"]:::component
    end

    subgraph "Core Framework Layer"
        NextJS["Next.js Integration"]:::core
        NextJSPages["Next.js Pages"]:::core
        CoreUtils["Core Utilities"]:::core
        TypeDefs["Type Definitions"]:::core
    end

    subgraph "Integration Points"
        TestUtils["Test Utilities"]:::integration
        WebUtils["Web Utilities"]:::integration
        NextExamples["Next.js Examples"]:::integration
    end

    %% Relationships
    TdsUI --> TdsTheme
    TdsWidget --> TdsUI
    DocHandling --> TdsUI
    EmailDoc --> DocHandling

    Router --> CoreUtils
    Fetcher --> CoreUtils
    I18n --> CoreUtils
    ABExp --> CoreUtils
    Middleware --> CoreUtils

    NextJS --> TypeDefs
    NextJSPages --> NextJS
    NextExamples --> NextJS

    TdsUI --> CoreUtils
    TdsWidget --> CoreUtils

    TestUtils --> CoreUtils
    WebUtils --> CoreUtils

    %% Styling
    classDef core fill:#2374ab
    classDef component fill:#57a773
    classDef feature fill:#ff8c42
    classDef integration fill:#937666

    %% Click Events
    click Router "https://github.com/titicacadev/triple-frontend/tree/main/packages/router"
    click Fetcher "https://github.com/titicacadev/triple-frontend/tree/main/packages/fetcher"
    click I18n "https://github.com/titicacadev/triple-frontend/tree/main/packages/i18n"
    click ABExp "https://github.com/titicacadev/triple-frontend/tree/main/packages/ab-experiments"
    click Middleware "https://github.com/titicacadev/triple-frontend/tree/main/packages/middlewares"
    click Constants "https://github.com/titicacadev/triple-frontend/tree/main/packages/constants"
    click TdsUI "https://github.com/titicacadev/triple-frontend/tree/main/packages/tds-ui"
    click TdsWidget "https://github.com/titicacadev/triple-frontend/tree/main/packages/tds-widget"
    click TdsTheme "https://github.com/titicacadev/triple-frontend/tree/main/packages/tds-theme"
    click DocHandling "https://github.com/titicacadev/triple-frontend/tree/main/packages/triple-document"
    click EmailDoc "https://github.com/titicacadev/triple-frontend/tree/main/packages/triple-email-document"
    click NextJS "https://github.com/titicacadev/triple-frontend/tree/main/packages/triple-web-nextjs"
    click NextJSPages "https://github.com/titicacadev/triple-frontend/tree/main/packages/triple-web-nextjs-pages"
    click CoreUtils "https://github.com/titicacadev/triple-frontend/tree/main/packages/view-utilities"
    click TypeDefs "https://github.com/titicacadev/triple-frontend/tree/main/packages/type-definitions"
    click TestUtils "https://github.com/titicacadev/triple-frontend/tree/main/packages/triple-web-test-utils"
    click WebUtils "https://github.com/titicacadev/triple-frontend/tree/main/packages/triple-web-utils"
    click NextExamples "https://github.com/titicacadev/triple-frontend/tree/main/examples/nextjs-app"
    click Storybook "https://github.com/titicacadev/triple-frontend/blob/main/.storybook"
    click Testing "https://github.com/titicacadev/triple-frontend/blob/main/jest.config.js"
    click Docs "https://github.com/titicacadev/triple-frontend/tree/main/stories"
    click GHActions "https://github.com/titicacadev/triple-frontend/tree/main/.github/workflows"
    click DevTools "https://github.com/titicacadev/triple-frontend/blob/main/.husky"
```
