# noaignite/accelerator architecture

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

## Overview

##### Main Components
- Monorepo Layer: Represent the Turborepo structure as the overarching container, indicating that multiple packages/apps coexist and share a unified build, dev, and dependency management infrastructure.
- Apps:
- Docs: The documentation website (likely built with Next.js, as seen by the files in the “docs” folder).
- Packages/Libraries:
- @noaignite/centra-mocks: Provides mocks for interacting with the Centra API.
- @noaignite/centra-types: Contains TypeScript type definitions and API interfaces for Centra.
- @noaignite/create-app: A CLI tool to scaffold new projects/templates.
- @noaignite/react-centra-checkout: React helper components and API clients for Centra checkout.
- @noaignite/react-utils: Common React utility functions/components.
- @noaignite/tailwind-typography: A Tailwind CSS plugin for responsive typography.
- @noaignite/types and @noaignite/utils: Shared helper functions and type utilities.
- Shared “repo” configurations: eslint-config, prettier-config, typescript-config, etc.

##### Relationships and Interactions
- That the “docs” app depends on specific configuration files and on various packages (for instance, shared types or utilities) to render documentation correctly.
- That the CLI tool (create-app) kick-starts new projects and interacts with (or consumes) templates found in its own subfolders.
- Reliance of many packages on common configuration packages (ESLint, Prettier, and TS Config) which are meant to enforce uniform coding standards across the monorepo.
- That utilities and types are shared across multiple other packages. The lines connecting these packages should show bi-directional or dependent relationships.
- Finally, representing the CI/CD and tooling layer (GitHub workflows, Husky hooks, and turborepo’s orchestration configuration) provides a full picture of the automated build/test pipeline.

##### Architectural Patterns & Design Principles
- Modular design: Each package (or app) is self-contained and loosely coupled but integrates through the monorepo’s dependency management.
- Shared configuration: Central ESLint, Prettier, and TypeScript settings reduce duplication.
- CLI scaffolding: The “create-app” package hints at a factory or template-based approach to generating new projects.
- The separation of presentation (Docs app and React components) and core utilities (Types and Utils) follows software best practices for separation of concerns.

##### Relevant Technologies and Frameworks
- Turborepo for managing the monorepo.
- TypeScript for static type checking across all packages.
- React for any UI components (e.g., in react-centra-checkout and react-utils).
- Next.js for the docs site, given the configuration and file structure present in the docs folder.
- TailwindCSS in the tailwind-typography package.
- GitHub Actions (workflows) and Husky for linting, testing, and pre-commit hooks.
- ESLint, Prettier, and the shared TS Configs as part of the developer experience.

## Diagram (Mermaid)

```mermaid
flowchart TD
    M["Monorepo Layer"]:::monorepo

    subgraph "Apps"
        A1["Docs App (Next.js)"]:::app
    end

    subgraph "Packages"
        subgraph "API Integration"
            A2["Centra Mocks (API Mocks)"]:::lib
            A3["Centra Types (Type Definitions)"]:::lib
        end
        subgraph "CLI Tools"
            A4["Create App (CLI Scaffolding Tool)"]:::lib
        end
        subgraph "React Components"
            A5["React Centra Checkout"]:::lib
            A6["React Utils"]:::lib
        end
        subgraph "Styling"
            A7["Tailwind Typography"]:::lib
        end
        subgraph "Shared Utilities"
            A8["Shared Types"]:::lib
            A9["Shared Utils"]:::lib
        end
        subgraph "Shared Configurations"
            A10["ESLint Config"]:::config
            A11["Prettier Config"]:::config
            A12["TypeScript Config"]:::config
        end
    end

    B1["CI/CD & Tooling"]:::tool

    %% Monorepo Layer connects to all internal components
    M --> A1
    M --> A2
    M --> A3
    M --> A4
    M --> A5
    M --> A6
    M --> A7
    M --> A8
    M --> A9
    M --> A10
    M --> A11
    M --> A12

    %% Dependencies and interactions from Apps
    A1 -->|"dependsOn"| A10
    A1 -->|"dependsOn"| A11
    A1 -->|"dependsOn"| A12
    A1 -->|"uses"| A8
    A1 -->|"uses"| A9

    %% Interactions from React Components
    A5 -->|"integrates"| A2
    A5 -->|"integrates"| A3
    A5 -->|"shares"| A8
    A5 -->|"shares"| A9

    A6 -->|"integrates"| A2
    A6 -->|"integrates"| A3
    A6 -->|"shares"| A8
    A6 -->|"shares"| A9

    %% CI/CD and Tooling orchestrates the Monorepo
    B1 -->|"orchestrates"| M

    %% Click Events
    click M "https://github.com/noaignite/accelerator/blob/main/Root of the repository with Turborepo configuration (e.g., turbo.json, pnpm-workspace.yaml)"
    click A1 "https://github.com/noaignite/accelerator/tree/main/docs/"
    click A2 "https://github.com/noaignite/accelerator/tree/main/packages/centra-mocks/"
    click A3 "https://github.com/noaignite/accelerator/tree/main/packages/centra-types/"
    click A4 "https://github.com/noaignite/accelerator/tree/main/packages/create-app/"
    click A5 "https://github.com/noaignite/accelerator/tree/main/packages/react-centra-checkout/"
    click A6 "https://github.com/noaignite/accelerator/tree/main/packages/react-utils/"
    click A7 "https://github.com/noaignite/accelerator/tree/main/packages/tailwind-typography/"
    click A8 "https://github.com/noaignite/accelerator/tree/main/packages/types/"
    click A9 "https://github.com/noaignite/accelerator/tree/main/packages/utils/"
    click A10 "https://github.com/noaignite/accelerator/tree/main/packages/eslint-config/"
    click A11 "https://github.com/noaignite/accelerator/tree/main/packages/prettier-config/"
    click A12 "https://github.com/noaignite/accelerator/tree/main/packages/typescript-config/"
    click B1 "https://github.com/noaignite/accelerator/tree/main/.github/ and .husky/"

    %% Styles
    classDef monorepo fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;
    classDef app fill:#cce5ff,stroke:#1f6fb2,stroke-width:2px;
    classDef lib fill:#d4edda,stroke:#28a745,stroke-width:2px;
    classDef config fill:#fff3cd,stroke:#ffc107,stroke-width:2px;
    classDef tool fill:#f8d7da,stroke:#dc3545,stroke-width:2px;
```
