# siddhant-pragyan-sinha/asyncapi-website architecture

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

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

## Overview

##### Main Components
- Frontend Application: Represent the Next.js–based web app which includes:
- Pages (the “pages” folder that holds routes like /blog, /docs, /tools, etc.)
- UI Components (the “components” folder with reusable pieces like Buttons, Nav Bars, etc.)
- Context Providers (React contexts from the “context” folder)
- CSS styling (Tailwind CSS in “styles” and tailwind.config file)
- MDX integration and Storybook (the “.storybook” folder)
- Content & Data Sources:
- Markdown files (in “markdown” folder for blog posts, docs, tutorials, etc.)
- Config files (in “config” directory that hold JSON/YAML data for finance, case studies, etc.)
- Assets & Static Files (the “public” folder contains images, logos, translations, and SEO metadata)
- Build & Static Generation:
- Build Scripts (from the “scripts” folder that assembles blog posts, dashboards, and transforms markdown)
- Next.js build process (which outputs static pages to the “.next” folder)
- Serverless & Deployment Infrastructure:
- Netlify Functions (in the “netlify/functions” and “netlify/edge-functions” folders for dynamic processing, API integration, and schema fetching)
- Docker support (Dockerfile and related container configuration for local development and production)
- CI/CD Pipelines (GitHub workflows under “.github/workflows” that automate builds, testing, linting, and deployment)

##### Relationships & Data Flow
- How MDX/Markdown content (from the “markdown” folder) and configuration data (from “config”) feed into components via Next.js’s static generation.
- Data flow from imported assets and images (from “public”) to the rendered UI.
- Build Scripts perform pre-processing tasks (like converting markdown and generating RSS/blog lists) and then output data for Next.js to serve.
- Serverless functions on Netlify are invoked by the web app (or indirectly by proxy rules in netlify.toml) to handle dynamic content (for example, rewriting requests for JSON schema definitions).
- CI/CD Pipelines (via GitHub Actions) coordinate running tests, builds, and deployments (including Docker builds for local/production environments).

##### Architectural Patterns & Design Principles
- Static Site Generation / SSR: Show how Next.js consumes static and externally generated content and uses React components for dynamic interactivity.
- Separation of Concerns: The architecture clearly separates UI components, markdown content, configuration data, and backend serverless functions.
- CI/CD Automation: Emphasize the role of GitHub workflows and Netlify in automated testing, deployment, and edge function processing.
- Extensibility: The use of Storybook for component development and a modular component structure enables easy UI extension.

##### Relevant Technologies
- Next.js (React framework for SSR and static site generation)
- Tailwind CSS (for styling)
- Storybook (for UI workshop and documentation)
- Node.js & npm – for running build scripts, development server, and managing dependencies
- Docker (for containerized development/production)
- Netlify (for deployment, serverless functions, and edge functions)
- YAML, JSON, and Markdown as content and configuration formats
- Git and GitHub Actions for source control and CI/CD

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Content & Data Sources
    subgraph "Content & Data Sources"
        md["\"Markdown Files\""]:::content
        cf["\"Config Files\""]:::content
        assets["\"Assets & Static Files\""]:::content
    end

    %% Build & Static Generation
    subgraph "Build & Static Generation"
        bs["\"Build Scripts\""]:::build
        nxt["\"Next.js Build Process\""]:::build
    end

    %% Frontend (Next.js Application)
    subgraph "Frontend (Next.js Application)"
        pages["\"Pages\""]:::frontend
        ui["\"UI Components\""]:::frontend
        ctx["\"Context Providers\""]:::frontend
        css["\"CSS Styling\""]:::frontend
        story["\"Storybook\""]:::frontend
        mdx["\"MDX Components\""]:::frontend
    end

    %% Serverless & Deployment Infrastructure
    subgraph "Serverless & Deployment Infrastructure"
        netlify["\"Netlify Functions\""]:::serverless
        edge["\"Edge Functions\""]:::serverless
        docker["\"Docker Support\""]:::serverless
        cicd["\"CI/CD Pipelines\""]:::serverless
    end

    %% Data Flow from Content Sources to Build Process
    md -->|"process"| bs
    cf -->|"process"| bs
    assets -->|"process"| bs
    bs -->|"build"| nxt

    %% Next.js Build Process feeding Frontend Pages
    nxt -->|"render"| pages

    %% Frontend Application component composition
    pages -->|"uses"| ui
    pages -->|"provides"| ctx
    pages -->|"styles with"| css
    pages -->|"integrates"| story
    pages -->|"renders"| mdx

    %% Frontend calling Serverless functions
    pages -->|"api_call"| netlify
    pages -->|"edge_call"| edge

    %% CI/CD and Docker integration with Build Process and Deployment
    cicd -->|"triggers"| bs
    cicd -->|"builds_with"| docker
    cicd -->|"orchestrates"| nxt

    %% Class Definitions for color styling
    classDef frontend fill:#E3F2FD,stroke:#1E88E5,stroke-width:2px;
    classDef content fill:#F1F8E9,stroke:#4CAF50,stroke-width:2px;
    classDef build fill:#FFF3E0,stroke:#FB8C00,stroke-width:2px;
    classDef serverless fill:#FBE9E7,stroke:#D84315,stroke-width:2px;

    %% Click Events
    click pages "https://github.com/siddhant-pragyan-sinha/asyncapi-website/tree/master/pages"
    click ui "https://github.com/siddhant-pragyan-sinha/asyncapi-website/tree/master/components"
    click ctx "https://github.com/siddhant-pragyan-sinha/asyncapi-website/tree/master/context"
    click css "https://github.com/siddhant-pragyan-sinha/asyncapi-website/tree/master/styles"
    click css "https://github.com/siddhant-pragyan-sinha/asyncapi-website/blob/master/tailwind.config.ts"
    click story "https://github.com/siddhant-pragyan-sinha/asyncapi-website/blob/master/.storybook"
    click mdx "https://github.com/siddhant-pragyan-sinha/asyncapi-website/tree/master/components/MDX"
    click md "https://github.com/siddhant-pragyan-sinha/asyncapi-website/tree/master/markdown"
    click cf "https://github.com/siddhant-pragyan-sinha/asyncapi-website/tree/master/config"
    click assets "https://github.com/siddhant-pragyan-sinha/asyncapi-website/tree/master/public"
    click bs "https://github.com/siddhant-pragyan-sinha/asyncapi-website/tree/master/scripts"
    click netlify "https://github.com/siddhant-pragyan-sinha/asyncapi-website/tree/master/netlify/functions"
    click edge "https://github.com/siddhant-pragyan-sinha/asyncapi-website/tree/master/netlify/edge-functions"
    click docker "https://github.com/siddhant-pragyan-sinha/asyncapi-website/tree/master/Dockerfile"
    click cicd "https://github.com/siddhant-pragyan-sinha/asyncapi-website/tree/master/.github/workflows"
```
