# torque-labs/torque-public architecture

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

- Interactive diagram: https://gitdiagram.com/torque-labs/torque-public
- Repository: https://github.com/torque-labs/torque-public

## Overview

1. The Next.js web app (under apps/web), which demonstrates the integration of the Torque UI kit and Torque SDK.
##### The Torque UI Kit library (inside packages/ui) which provides reusable UI components.
3. Several configuration packages (in packages/config-eslint, packages/config-tailwind, and packages/config-typescript) for standardizing project settings.
4. Extensive documentation (in the docs folder) that covers usage, developer guides, API references, and integrations.

- Apps: specifically, the “web” Next.js application.
- Packages: including “ui” (the main UI kit library) and the config packages (eslint-config, tailwind-config, typescript-config).
- Documentation: shown as an external supportive component that informs both end users and developers.

- For the “apps” section:

- For the “packages” section:

- An orchestration layer:
- Usage of Turborepo by drawing a “Turborepo” or “Monorepo Orchestrator” component. This layer manages installing dependencies, running development servers (npm run dev), building (npm run build), and starting production servers (npm run start).

- Additional external interactions:
- If needed, add nodes for external tooling (e.g., Node.js and npm) which are used to build and develop the entire repository.
- That the repository’s documentation (found in the docs folder) is available to guide integration and usage, pointing to both developers and marketers.

- Use clear, descriptive labels for every component (e.g., “Next.js Web App”, “Torque UI Kit”, “ESLint Config”, “Tailwind Config”, “TypeScript Config”, “Turborepo Build Pipeline”, “Documentation”).
- Present dependency lines that show “import” or “dependency” relationships—for example, the web app relying on components from the UI kit, and the shared configurations flowing into both the app and package build processes.

- Architectural patterns:
- The project follows a modular monorepo architecture, which supports reusability, consistency, and integrated development through Turborepo.
- That the separation of concerns is evident between runtime applications (the web app) and the UI library, along with configuration separation for development and production tools.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Torque Public Repository (Monorepo)"
        subgraph "Apps"
            WebApp["Next.js Web App<br>- src/app<br>- components<br>- next.config.js<br>- tailwind.config.ts"]:::runtime
        end
        subgraph "Packages"
            UI["Torque UI Kit<br>- components<br>- hooks<br>- providers<br>- utils"]:::runtime
            ESLint["ESLint Config"]:::config
            Tailwind["Tailwind Config"]:::config
            TS["TypeScript Config"]:::config
        end
    end

    Documentation["Documentation"]:::doc
    TurborepoOrch["Turborepo Orchestrator"]:::orchestrator
    ExternalTools["Node.js & npm"]:::external

    WebApp -->|"uses"| UI

    TurborepoOrch --> WebApp
    TurborepoOrch --> UI
    TurborepoOrch --> ESLint
    TurborepoOrch --> Tailwind
    TurborepoOrch --> TS

    ESLint -.->|"configures"| WebApp
    Tailwind -.->|"configures"| WebApp
    TS -.->|"configures"| WebApp

    Documentation ==> WebApp
    Documentation ==> UI

    ExternalTools --> TurborepoOrch

    click WebApp "https://github.com/torque-labs/torque-public/tree/main/apps/web"
    click UI "https://github.com/torque-labs/torque-public/tree/main/packages/ui"
    click ESLint "https://github.com/torque-labs/torque-public/tree/main/packages/config-eslint"
    click Tailwind "https://github.com/torque-labs/torque-public/tree/main/packages/config-tailwind"
    click TS "https://github.com/torque-labs/torque-public/tree/main/packages/config-typescript"
    click Documentation "https://github.com/torque-labs/torque-public/tree/main/docs"
    click TurborepoOrch "https://github.com/torque-labs/torque-public/blob/main/turbo.json"

    classDef runtime fill:#C8E6C9,stroke:#1B5E20,stroke-width:2px;
    classDef config fill:#BBDEFB,stroke:#0D47A1,stroke-width:2px;
    classDef doc fill:#E1BEE7,stroke:#4A148C,stroke-width:2px;
    classDef orchestrator fill:#FFE082,stroke:#FF6F00,stroke-width:2px;
    classDef external fill:#CFD8DC,stroke:#37474F,stroke-width:2px;
```
