# airchains-network/docs architecture

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

- Interactive diagram: https://gitdiagram.com/airchains-network/docs
- Repository: https://github.com/airchains-network/docs

## Overview

##### Project type and purpose
- This is a documentation-centric static website built with the Docusaurus framework.
- Purpose: host and render Markdown-based docs (guides, API references, tutorials) for the Airchains blockchain platform.

##### File structure
- Top-level:
- docusaurus.config.js, sidebars.js – Docusaurus site config and sidebar definitions
- package.json / package-lock.json – Node.js build and dependency config
- .github/workflows/deploy.yml – CI/CD pipeline for automatic builds & deploys
- docs/ – all Markdown content organized by topic (api-reference, rollups, develop, etc.)
- src/ – custom React components and CSS overrides used by the Docusaurus theme
- static/ – static assets (images, .nojekyll file) copied verbatim to output
- babel.config.js – Babel settings for custom JSX code in src/

##### README for additional insights
- Confirms use of Node.js and Docusaurus
- Emphasizes contribution workflow and CI/CD via GitHub Actions

a. Main components:
- Authoring environment: Markdown files in docs/ + custom components in src/
- Build system: Node.js + Docusaurus CLI + Babel
- CI/CD pipeline: GitHub Actions (.github/workflows/deploy.yml)
- Static file output: HTML/CSS/JS bundles + static assets
- Hosting layer: GitHub Pages, Netlify, or another CDN (implied by deploy.yml)
- Browser/Client: end-users render static site and search via built-in Algolia or local search index
b. Relationships and interactions:
1. Developer pushes changes (docs/, src/, config) → triggers GitHub Actions
2. CI job installs Node.js → npm install → npm run build (Docusaurus builds)
3. Build outputs under /build (static HTML, JS, CSS, assets)
4. CI deploy step copies /build to hosting (GitHub Pages / CDN)
5. End-user browser fetches static assets over HTTPS → renders pages + client-side React enhancements (e.g., SearchBar.js)
c. Architectural patterns and design principles:
– Static Site Generator (SSG) pattern: pre-render content at build time
– Component-based UI via React for custom theming and dynamic features (search bar, navigation)
– Content/config separation: docs Markdown vs. theme/config files
– CI/CD automation for continuous documentation delivery
d. Key technologies/frameworks:
– Docusaurus v2 (React, MDX support)
– Node.js (v18+) build runtime
– Babel for JSX transpilation
– GitHub Actions for CI/CD
– Optional: Algolia or local search indexing

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Actors and Layers
    devl["Developer"]:::client

    subgraph "Source Code"
        MD["Markdown Content (docs/)"]:::source
        api["API Reference Content"]:::source
        tut["Tutorials & Guides Content (docs/rollups/, docs/develop/, etc.)"]:::source
        conf["Docusaurus Site Configuration (docusaurus.config.js)"]:::source
        sidebar["Sidebar Definitions (sidebars.js)"]:::source
        pkg["Node.js Build & Dependency Config (package.json, package-lock.json)"]:::source
        babel["Build Configuration (babel.config.js)"]:::source
        comps["Custom React Components (src/components/)"]:::source
        mdx_ex["exercise.js"]:::source
        mdx_introzk["intro-to-zkfhe.js"]:::source
        mdx_intro["introduction.js"]:::source
        mdx_up["under-progress.js"]:::source
        theme["Theme Overrides (SearchBar.js)"]:::source
        css["Custom CSS Overrides (src/css/custom.css)"]:::source
        pages_i["Custom Pages (src/pages/index.js)"]:::source
        pages_md["Custom Pages (src/pages/markdown-page.md)"]:::source
        static["Static Assets (static/)"]:::source
    end

    ci["CI/CD (GitHub Actions)"]:::process
    build["Docusaurus Build (Node.js, Babel)"]:::process
    build_out["Build Output (/build)"]:::artifact
    host["Hosting/CDN (GitHub Pages/Netlify)"]:::service
    dev["Local Dev Server (npm run start)"]:::process
    browser["Client Browser (React runtime, Search)"]:::client

    %% Flows
    devl -->|push changes| MD
    devl -->|push changes| conf
    MD -->|trigger build| ci
    conf -->|used in build| ci
    pkg -->|dependencies| ci
    comps -->|source components| ci

    ci -->|npm install & npm run build| build
    build -->|outputs static files| build_out
    build_out -->|deploy artifacts| host
    ci -->|deploy step| host

    devl -->|npm run start| dev
    dev -->|serve locally| browser

    host -->|serve over HTTPS| browser

    %% Click Events
    click MD "https://github.com/airchains-network/docs/tree/main/docs/"
    click api "https://github.com/airchains-network/docs/blob/main/docs/api-reference/index.md"
    click tut "https://github.com/airchains-network/docs/tree/main/docs/rollups/"
    click conf "https://github.com/airchains-network/docs/blob/main/docusaurus.config.js"
    click sidebar "https://github.com/airchains-network/docs/blob/main/sidebars.js"
    click pkg "https://github.com/airchains-network/docs/blob/main/package.json"
    click babel "https://github.com/airchains-network/docs/blob/main/babel.config.js"
    click comps "https://github.com/airchains-network/docs/tree/main/src/components/"
    click mdx_ex "https://github.com/airchains-network/docs/blob/main/src/components/docs/exercise.js"
    click mdx_introzk "https://github.com/airchains-network/docs/blob/main/src/components/docs/intro-to-zkfhe.js"
    click mdx_intro "https://github.com/airchains-network/docs/blob/main/src/components/docs/introduction.js"
    click mdx_up "https://github.com/airchains-network/docs/blob/main/src/components/docs/under-progress.js"
    click theme "https://github.com/airchains-network/docs/blob/main/src/theme/SearchBar.js"
    click css "https://github.com/airchains-network/docs/blob/main/src/css/custom.css"
    click pages_i "https://github.com/airchains-network/docs/blob/main/src/pages/index.js"
    click pages_md "https://github.com/airchains-network/docs/blob/main/src/pages/markdown-page.md"
    click static "https://github.com/airchains-network/docs/tree/main/static/"

    %% Styles
    classDef source fill:#fde2e4,stroke:#b71c1c,color:#000
    classDef process fill:#e3f2fd,stroke:#1565c0,color:#000
    classDef artifact fill:#fff3e0,stroke:#ef6c00,color:#000
    classDef service fill:#e8f5e9,stroke:#2e7d32,color:#000
    classDef client fill:#f3e5f5,stroke:#6a1b9a,color:#000
```
