# adityakishore0/scrollx-ui architecture

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

- Interactive diagram: https://gitdiagram.com/adityakishore0/scrollx-ui
- Repository: https://github.com/adityakishore0/scrollx-ui

## Overview

##### Project type and purpose
- This is a Next.js-based documentation and showcase website for the ScrollX-UI React component library.
- Its purpose is to display docs (written in MDX), interactive demos, and auto-generated API/source views of UI components.

##### File structure
- Top-level config and infra:
- .github/workflows → CI/CD (lint, tests, release)
- .husky, commitlint.config.js → Git hooks & commit conventions
- next.config.js, tailwind.config.ts, tsconfig.json, vercel.json → build & deployment settings
- src/app → Next.js AppRouter routes:
- /docs/[[…slug]] → MDX docs pages
- /showcase → full-page component gallery
- /registry → demo & parent registries
- /templates, /debug, homepage, layout files
- src/components & src/base/ui-kit → the actual ScrollX-UI component library & demo wrappers
- src/content/docs → raw .mdx files for documentation
- src/lib (mdx.ts) & src/utils → MDX compilation and code-fetching actions (getComponentSourceAction, getParentSourceAction)
- public → static assets (images, favicon, manifest, robots.txt)

##### README for additional insights
- Confirms it’s an open-source, MIT-licensed UI toolkit with community contributions.

##### Detail without overthinking
- Break the system into as many logical components as you need to cover build, deploy, runtime, and content flows.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Environment
    Developer["Developer\nIDE & Git"]:::code
    subgraph "CI/CD Pipeline"
        Workflows["Workflows\n.github/workflows/"]:::pipeline
        HuskyDir["Husky Hooks\n.husky/"]:::pipeline
        Commitlint["Commitlint\ncommitlint.config.js"]:::pipeline
        PreCommit["pre-commit Hook\n.husky/pre-commit"]:::pipeline
        CommitMsg["commit-msg Hook\n.husky/commit-msg"]:::pipeline
    end

    Developer --> Workflows
    Developer --> HuskyDir
    Developer --> Commitlint
    Developer --> PreCommit
    Developer --> CommitMsg

    %% Build & Configuration
    subgraph "Build & Configuration" 
        NextConfig["next.config.js"]:::code
        TailwindConfig["tailwind.config.ts"]:::code
        TSConfig["tsconfig.json"]:::code
        PostCSS["postcss.config.mjs"]:::code
        PNPMFile["pnpmfile.js"]:::code
    end

    Workflows --> NextConfig
    Workflows --> TailwindConfig
    Workflows --> TSConfig
    Workflows --> PostCSS
    Workflows --> PNPMFile

    %% Build Artifacts
    Artifacts["Build Artifacts\npnpm build output"]:::code
    NextConfig --> Artifacts
    TailwindConfig --> Artifacts
    TSConfig --> Artifacts
    PostCSS --> Artifacts
    PNPMFile --> Artifacts

    %% Deployment Platform
    Vercel["Vercel\nvercel.json"]:::infra
    Artifacts --> Vercel

    %% Next.js Frontend
    subgraph "Next.js Frontend (App Router)" 
        AppRoot["src/app/"]:::code
        Page["page.tsx\nsrc/app/page.tsx"]:::code
        Layout["layout.tsx\nsrc/app/layout.tsx"]:::code
        DocsPage["Docs Route\nsrc/app/docs/[[...slug]]/page.tsx"]:::code
        Showcase["Showcase\nsrc/app/showcase/page.tsx"]:::code
        RegistryPage["Registry\nsrc/app/registry/registry.tsx"]:::code
        Templates["Templates\nsrc/app/templates/page.tsx"]:::code
        Debug["Debug\nsrc/app/debug/page.tsx"]:::code
    end

    Vercel --> AppRoot
    AppRoot --> Page
    AppRoot --> Layout
    AppRoot --> DocsPage
    AppRoot --> Showcase
    AppRoot --> RegistryPage
    AppRoot --> Templates
    AppRoot --> Debug

    %% MDX Processor
    subgraph "MDX Processor" 
        MDXLib["mdx.ts\nsrc/lib/mdx.ts"]:::pipeline
        Utils["utils.ts\nsrc/lib/utils.ts"]:::pipeline
        GetComp["getComponentSourceAction.ts\nsrc/actions/getComponentSourceAction.ts"]:::pipeline
        GetParent["getParentSourceAction.ts\nsrc/actions/getParentSourceAction.ts"]:::pipeline
    end

    DocsPage --> MDXLib
    MDXLib --> Utils
    MDXLib --> GetComp
    MDXLib --> GetParent

    Content["Docs Content\nsrc/content/docs"]:::static
    Content --> MDXLib

    %% Component Library
    subgraph "Component Library" 
        BaseUI["ui-kit\nsrc/base/ui-kit/ui/"]:::code
        AccordionUI["accordion.tsx\nsrc/components/ui/accordion.tsx"]:::code
        AlertUI["alert-dialog.tsx\nsrc/components/ui/alert-dialog.tsx"]:::code
        ButtonUI["button.tsx\nsrc/components/ui/button.tsx"]:::code
    end

    DocsPage --> AccordionUI
    DocsPage --> AlertUI
    DocsPage --> ButtonUI

    %% Demo Harness & Registries
    subgraph "Demo Harness & Registries" 
        DemosDir["demos\nsrc/components/demos/"]:::code
        AccordionDemo["accordion-demo.tsx\nsrc/components/demos/accordion-demo.tsx"]:::code
        AlertDemo["alertdialog-demo.tsx\nsrc/components/demos/alertdialog-demo.tsx"]:::code
        RegistryFiles["Registry Data\nsrc/app/registry/demos.ts & parents.ts"]:::code
    end

    Showcase --> DemosDir
    DemosDir --> AccordionDemo
    DemosDir --> AlertDemo
    RegistryPage --> RegistryFiles

    %% Static Assets
    StaticAssets["Static Assets\npublic/"]:::static

    %% Runtime Flow to Browser
    AppRoot -->|"serves pages"| Page
    AppRoot -->|"serves pages"| DocsPage
    AppRoot -->|"serves pages"| Showcase
    AppRoot -->|"serves pages"| RegistryPage
    AppRoot -->|"serves pages"| Templates
    AppRoot -->|"serves pages"| Debug
    AppRoot --> StaticAssets
    AppRoot --> BaseUI
    AppRoot --> DemosDir
    AppRoot --> MDXLib

    Page --> Browser
    DocsPage --> Browser
    Showcase --> Browser
    RegistryPage --> Browser
    Templates --> Browser
    Debug --> Browser

    Browser["End User\nWeb Browser"]:::user

    %% Click Events
    click HuskyDir "https://github.com/adityakishore0/scrollx-ui/tree/main/.husky/"
    click Workflows "https://github.com/adityakishore0/scrollx-ui/tree/main/.github/workflows/"
    click Commitlint "https://github.com/adityakishore0/scrollx-ui/blob/main/commitlint.config.js"
    click PreCommit "https://github.com/adityakishore0/scrollx-ui/tree/main/.husky/pre-commit"
    click CommitMsg "https://github.com/adityakishore0/scrollx-ui/tree/main/.husky/commit-msg"
    click NextConfig "https://github.com/adityakishore0/scrollx-ui/blob/main/next.config.js"
    click TailwindConfig "https://github.com/adityakishore0/scrollx-ui/blob/main/tailwind.config.ts"
    click TSConfig "https://github.com/adityakishore0/scrollx-ui/blob/main/tsconfig.json"
    click PostCSS "https://github.com/adityakishore0/scrollx-ui/blob/main/postcss.config.mjs"
    click PNPMFile "https://github.com/adityakishore0/scrollx-ui/blob/main/pnpmfile.js"
    click Vercel "https://github.com/adityakishore0/scrollx-ui/blob/main/vercel.json"
    click AppRoot "https://github.com/adityakishore0/scrollx-ui/tree/main/src/app/"
    click Page "https://github.com/adityakishore0/scrollx-ui/blob/main/src/app/page.tsx"
    click Layout "https://github.com/adityakishore0/scrollx-ui/blob/main/src/app/layout.tsx"
    click DocsPage "https://github.com/adityakishore0/scrollx-ui/blob/main/src/app/docs/[[...slug]]/page.tsx"
    click Showcase "https://github.com/adityakishore0/scrollx-ui/blob/main/src/app/showcase/page.tsx"
    click RegistryPage "https://github.com/adityakishore0/scrollx-ui/blob/main/src/app/registry/registry.tsx"
    click Templates "https://github.com/adityakishore0/scrollx-ui/blob/main/src/app/templates/page.tsx"
    click Debug "https://github.com/adityakishore0/scrollx-ui/blob/main/src/app/debug/page.tsx"
    click MDXLib "https://github.com/adityakishore0/scrollx-ui/blob/main/src/lib/mdx.ts"
    click Utils "https://github.com/adityakishore0/scrollx-ui/blob/main/src/lib/utils.ts"
    click GetComp "https://github.com/adityakishore0/scrollx-ui/blob/main/src/actions/getComponentSourceAction.ts"
    click GetParent "https://github.com/adityakishore0/scrollx-ui/blob/main/src/actions/getParentSourceAction.ts"
    click Content "https://github.com/adityakishore0/scrollx-ui/tree/main/src/content/docs"
    click BaseUI "https://github.com/adityakishore0/scrollx-ui/tree/main/src/base/ui-kit/ui/"
    click AccordionUI "https://github.com/adityakishore0/scrollx-ui/blob/main/src/components/ui/accordion.tsx"
    click AlertUI "https://github.com/adityakishore0/scrollx-ui/blob/main/src/components/ui/alert-dialog.tsx"
    click ButtonUI "https://github.com/adityakishore0/scrollx-ui/blob/main/src/components/ui/button.tsx"
    click DemosDir "https://github.com/adityakishore0/scrollx-ui/tree/main/src/components/demos/"
    click AccordionDemo "https://github.com/adityakishore0/scrollx-ui/blob/main/src/components/demos/accordion-demo.tsx"
    click AlertDemo "https://github.com/adityakishore0/scrollx-ui/blob/main/src/components/demos/alertdialog-demo.tsx"

    %% Styles
    classDef code fill:#D0E8FF,stroke:#0366D6,stroke-width:1px
    classDef pipeline fill:#E6FFFA,stroke:#009E6B,stroke-width:1px
    classDef infra fill:#FFF4E5,stroke:#D9822B,stroke-width:1px
    classDef static fill:#F5F5F5,stroke:#A0A0A0,stroke-width:1px
    classDef user fill:#F0E6FF,stroke:#8A2BE2,stroke-width:1px
```
