# asyncapi/website architecture

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

- Interactive diagram: https://gitdiagram.com/asyncapi/website
- Repository: https://github.com/asyncapi/website

## Overview

##### Main Components
- Next.js Web Application:
– Pages directory: The “pages” folder (with subdirectories for blog, community, casestudies, etc.) shows that the site’s routing and view layers are built with Next.js React pages.
– Context Providers: React context files (in “context”) that manage global state like AppContext, BlogContext, DocsContext, etc.
– MDX and Markdown Docs: Markdown files in “markdown” directories that provide the content for blog posts and documentation, with the ability to import shared fragments from “assets/docs/fragments”.
– Styling: CSS with Tailwind (tailwind.config.ts and styles) that styles the components.

- Build and Deployment Pipeline:
– Scripts folder: Custom scripts (e.g., build-docs.ts, build-pages.ts, etc.) to process markdown, build RSS feeds, dashboards, and more.
– GitHub Workflows: A whole suite of CI/CD workflows under “.github/workflows” that handle tests, builds, auto-deployment, labeling issues, and even custom tasks like regenerating meeting videos.
– Docker and Netlify: Dockerfile and netlify configuration files (netlify.toml, netlify/functions, etc.) indicating containerized development and serverless function support.

- Supporting Infrastructure and Tools:
– Storybook: The “.storybook” directory allows for development and documentation of UI components.
– Configuration Files: The “config” folder holds static JSON/YAML data (e.g., finance data, case studies, etc.) that the site uses to dynamically render pages.
– Testing and Type Systems: “tests” directory with multiple tests and “types” directory for TypeScript definitions that ensure code integrity.

##### Relationships and Data Flows
- Frontend Layer:
– The Next.js application uses React components, which are organized as pages and shared components.
– Pages load content from static markdown files and imported configuration data, then pass that to React components through context providers.

- Build Process:
– Custom scripts in the “scripts” folder pre-process markdown content and configuration files before the Next.js build.
– GitHub Workflows automatically trigger testing (including linting and unit tests) and then build the production version of the website.

- Deployment and External Integrations:
– The built site is deployed to Netlify, which uses additional Netlify Functions (in “netlify/functions” and “netlify/edge-functions”) for specific backend tasks such as serving schema files and handling newsletter subscriptions.
– Docker is supported for local development to mimic production-like deployments.

##### Important Architectural Patterns and Technologies
- Component-Based Architecture: Using a large collection of reusable components.
- Static Site Generation and Incremental Static Regeneration: Leveraging Next.js to serve pre-built pages for performance.
- CI/CD Patterns: Automated testing, linting, and deployment workflows via GitHub Actions.
- Serverless Functions: Utilization of Netlify Functions to extend backend capabilities without a traditional server.
- Theming and Styling: Tailwind CSS is used for styling, often coupled with Storybook to iterate on component design.

## Diagram (Mermaid)

```mermaid
graph TD
    Client["Client (Browser)"]:::client

    subgraph "Frontend Layer: Next.js Application"
        A1["Pages & Routing"]:::frontend
        A2["Component Library"]:::frontend
        A3["Context Providers"]:::frontend
        A4["MDX/Markdown Content"]:::frontend
        A4b["Docs Fragments"]:::frontend
        A5["Styling"]:::frontend
    end

    subgraph "Build & Deployment Pipeline"
        B1["Build Scripts"]:::build
        B2["GitHub Workflows"]:::build
        B3["Docker & Netlify Integration"]:::build
    end

    subgraph "Supporting Infrastructure & Tools"
        C1["Storybook"]:::tool
        C2["Configuration Files"]:::tool
        C3["Testing and Type Systems"]:::tool
    end

    Client -->|"requests"| A1
    A4b -->|"includes"| A4
    A4 -->|"providesContent"| A1
    A3 -->|"providesContext"| A1
    A2 -->|"rendersUI"| A1
    A5 -->|"styles"| A2

    C2 -->|"feeds"| B1
    A4 -->|"preprocessedBy"| B1
    B2 -->|"triggersBuild"| B1
    B2 -->|"deploys"| B3
    B1 -->|"buildsPages"| A1
    B3 -->|"deploysSite"| A1
    B2 -->|"runsTests"| C3

    C1 -->|"documents"| A2
    C3 -->|"testsComponents"| A2

    click A1 "https://github.com/asyncapi/website/tree/master/pages"
    click A2 "https://github.com/asyncapi/website/tree/master/components"
    click A3 "https://github.com/asyncapi/website/tree/master/context"
    click A4 "https://github.com/asyncapi/website/tree/master/markdown"
    click A4b "https://github.com/asyncapi/website/tree/master/assets/docs/fragments"
    click A5 "https://github.com/asyncapi/website/blob/master/tailwind.config.ts"
    click A5 "https://github.com/asyncapi/website/blob/master/styles/globals.css"
    click B1 "https://github.com/asyncapi/website/tree/master/scripts"
    click B2 "https://github.com/asyncapi/website/tree/master/.github/workflows"
    click B3 "https://github.com/asyncapi/website/tree/master/Dockerfile"
    click B3 "https://github.com/asyncapi/website/blob/master/netlify.toml"
    click B3 "https://github.com/asyncapi/website/tree/master/netlify/functions"
    click B3 "https://github.com/asyncapi/website/tree/master/netlify/edge-functions"
    click C1 "https://github.com/asyncapi/website/blob/master/.storybook"
    click C2 "https://github.com/asyncapi/website/tree/master/config"
    click C3 "https://github.com/asyncapi/website/tree/master/tests"
    click C3 "https://github.com/asyncapi/website/tree/master/types"

    classDef client fill:#ffcc00,stroke:#333,stroke-width:2px;
    classDef frontend fill:#bbf,stroke:#1f77b4,stroke-width:2px;
    classDef build fill:#cfc,stroke:#2ca02c,stroke-width:2px;
    classDef tool fill:#fcc,stroke:#d62728,stroke-width:2px;
```
