# jetstreamgg/tarmac architecture

> Architecture diagram of the GitHub repository jetstreamgg/tarmac, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jetstreamgg/tarmac
- Repository: https://github.com/jetstreamgg/tarmac

## Overview

##### Main Components
- Monorepo Management and Build Tools:
– The root of the project includes configuration files (pnpm-lock.yaml, pnpm-workspace.yaml, .nvmrc, etc.), CI/CD workflows (.github/workflows), changesets for versioning, and other tooling (e.g., eslint, prettier, husky).
- Apps:
– integration-ui: A dedicated UI layer focused on interacting with widgets (look at its extensive components and modules, e.g., landing, layout, tokens, UI elements).
– webapp: Another application that includes similar functionality (different pages, modules for balances, trade, rewards, etc.) with its own tests and Playwright configuration.
- Packages:
– hooks: Contains a rich set of React hooks for interacting with the Maker protocol (with contracts, decentralized storage, trading, rewards, adjustments, etc.).
– widgets: Importable UI widgets like Trade, Rewards, Savings, Upgrade, SealModule, etc. that provide core user interface components.
– utils: General-purpose helpers for formatting, chain information, math operations, localization, etc.
- Internationalization & Localization:
– Integration with Lingui (scripts for message extraction and compilation) which is used across apps and packages.
- Testing & CI:
– Several test directories under apps (e2e tests for webapp, for instance) and packages, along with helper scripts for launching test environments (Tenderly testnet, etc.).

##### Relationships and Interactions
- Monorepo as the Foundation:
– At the highest level, show a “Monorepo” container that uses pnpm workspaces to manage dependencies and shared configurations.
- Dependency Flow between Apps and Packages:
- Internal Components within Apps:
– Within each app (integration-ui and webapp), break down into submodules or domains (for example, modules like landing, layout, tokens, auth in integration-ui; modules like balances, trade, rewards, upgrade in webapp). These indicate a separation of concerns (often following UI design conventions – a mix of concerns from business logic to presentation).
- Hooks as the Business Logic Bridge:
– The hooks package encapsulates many of the protocol interactions. Show that components in the apps call these hooks for data fetching and blockchain contract integrations.
- Widgets as Reusable UI Building Blocks:
– Demonstrate that the UI components (both in apps and potentially as standalone components in widget libraries) are imported from the widgets package. Indicate that they interact with state managed by the hooks package.
- Utilities’ Role:
- Testing & Deployment:
– Represent test setups (e2e tests, configuration for Tenderly testnets) and scripts that manage deployments (like Vercel’s configuration and deploy folder).

##### Architectural Patterns and Design Principles
- Modularity & Separation of Concerns:
– The clear division between apps and packages shows an adherence to modular design. Emphasize how each package (hooks, widgets, utils) plays a targeted role.
- Reusability:
– Packages can be published and reused across different projects, so highlight dependency injection or import relationships that promote code reuse.
- UI Composition:
– The heavy use of React and TypeScript (observed from the .tsx file extensions) implies a component-based UI architecture.
- Workflow & Configuration Management:
– Use of changesets, CI workflows, and environment configurations underscores a strong emphasis on deployment, versioning, and testing practices.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Monorepo (pnpm workspaces)"]:::build
    B["Build Tools & Config"]:::build
    A --> B

    subgraph "Apps"
        IUI["App: integration-ui"]:::app
        WEB["App: webapp"]:::app
    end

    subgraph "Packages"
        H["Package: hooks (React hooks)"]:::pkg
        W["Package: widgets (UI widgets)"]:::pkg
        U["Package: utils (Helpers)"]:::pkg
    end

    I18N["Internationalization (Lingui)"]:::i18n
    CI["Testing & CI"]:::test

    A --> IUI
    A --> WEB
    A --> I18N
    A --> CI

    IUI -->|"uses"| H
    IUI -->|"uses"| W
    IUI -->|"uses"| U

    WEB -->|"uses"| H
    WEB -->|"uses"| W
    WEB -->|"uses"| U

    IUI -->|"localizes"| I18N
    WEB -->|"localizes"| I18N

    WEB -->|"e2e_tests"| CI
    B -->|"configures"| CI

    class A,B build
    class IUI,WEB app
    class H,W,U pkg
    class I18N i18n
    class CI test

    click B "https://github.com/jetstreamgg/tarmac/blob/development/pnpm-lock.yaml"
    click IUI "https://github.com/jetstreamgg/tarmac/tree/development/apps/integration-ui"
    click WEB "https://github.com/jetstreamgg/tarmac/tree/development/apps/webapp"
    click H "https://github.com/jetstreamgg/tarmac/tree/development/packages/hooks"
    click W "https://github.com/jetstreamgg/tarmac/tree/development/packages/widgets"
    click U "https://github.com/jetstreamgg/tarmac/tree/development/packages/utils"
    click I18N "https://github.com/jetstreamgg/tarmac/blob/development/lingui.config.ts"
    click CI "https://github.com/jetstreamgg/tarmac/tree/development/.github/workflows"
```
