# tauri-apps/tauri-docs architecture

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

- Interactive diagram: https://gitdiagram.com/tauri-apps/tauri-docs
- Repository: https://github.com/tauri-apps/tauri-docs

## Overview

##### Project Type and Purpose
- This is a static documentation site generator for Tauri 2.0, built on the Astro framework with a Lunaria theme/renderer.
- It’s a monorepo (pnpm workspace) that also houses several Node-based code-generation packages (CLI generators, config generator, API generator, releases generator, compatibility table, etc.).
- The output is a fully static site deployed to Netlify, with multilingual content, assets, and some dynamic artifacts (RSS, service-worker manifest, etc.).

##### File Structure
- Top-level:
- Configuration: astro.config.mjs, lunaria.config.json, netlify.toml, tsconfig.json, .github/workflows
- Monorepo: pnpm-workspace.yaml / packages/* (code generators and Tauri core package)
- Source code for site: src/ (assets, components/, content/, pages/, schemas/, styles/)
- Build scripts:
- packages/*/build.ts invoke generation of JSON, markdown, compatibility tables, CLI scaffolds, etc.
- Astro build pipeline reads src/content (MDX/MD), src/components (*.astro), assembles pages under src/pages (dynamic feeds, LLM TODOs).
- CI/CD:
- GitHub Actions (.github/workflows) runs checks, labeling, tests.
- Netlify deploy triggered on merges, using netlify.toml for headers/redirects.

##### README for Additional Insights
- Repo hosts “Tauri 2.0 documentation” at https://tauri.app
- Encourages contributions, Gitpod/Codespaces support.

a. Main Components
1. Monorepo Root
- pnpm workspace, TypeScript configs, GitHub Actions, Netlify config
2. Code-Generation Services (Node TS packages)
- cli-generator, config-generator, js-api-generator, releases-generator, compatibility-table, etc.
3. Static Site Generator
- Astro + Lunaria (renderer.config.ts, components.ts, style.css)
4. Content Sources
- src/content (MDX/MD), public/assets, locale JSON
5. Build Pipeline
- “pnpm build” scripts that run generators, then astro build
6. CI/CD
- GitHub Actions => tests/linting => triggers netlify deploy
7. Hosting
- Netlify serving static assets, with headers/redirects from public/_headers, _redirects

b. Relationships and Data Flows
- Content authors edit src/content →
- Generators in packages/ produce JSON/TypeScript artifacts →
- Astro (lunaria) reads src/components + src/content + generated artifacts →
- Astro build outputs public/dist (static HTML/CSS/JS) →
- Netlify picks up /dist, applies _redirects/_headers →
- End users browse docs at tauri.app

c. Architectural Patterns and Principles
- Monorepo with workspace packages to share code and generators
- Static Site Generation (SSG) with partial “pre-rendered dynamic” via .ts page endpoints (feed.xml.ts)
- Component-based UI (Astro .astro components) + content-based pages (MDX)
- Separation of concerns: content vs. presentation vs. code generators vs. pipeline

d. Key Technologies, Frameworks, Libraries
- Astro (SSG framework)
- Lunaria renderer and theme (custom Astro integration)
- pnpm workspace & TypeScript
- Node-based code generators (ts-node build scripts)
- Netlify (hosting and deploy)
- GitHub Actions (CI/CD)

##### Final Recommendations
- Astro’s plugin (lunaria/renderer.config.ts) as part of SSG.
- GitHub Actions workflow triggers (on push/PR) feeding into build.
- Don’t clutter: group src/components and src/content under “Static Site Source.”

## Diagram (Mermaid)

```mermaid
flowchart TD
  subgraph "Content Sources"
    CONTENT["src/content/ (MDX/MD)"]:::content
    ASSETS["public/assets/, public/d2/, locales.json"]:::content
  end

  subgraph "Code-Generation Services"
    CLI["CLI Generator"]:::codegen
    CONFG["Config Generator"]:::codegen
    JSAPI["JS API Generator"]:::codegen
    REL["Releases Generator"]:::codegen
    COMPAT["Compatibility Table Generator"]:::codegen
  end

  subgraph "Static Site Generator (Astro + Lunaria)"
    ASTRO["Astro Build"]:::pipeline
    LUNARIA["Lunaria Renderer & Theme"]:::module
    COMPONENTS["src/components/"]:::module
    PAGES["src/pages/ (TS endpoints)"]:::module
    STYLES["src/styles/"]:::module
  end

  subgraph "CI/CD (GitHub Actions)"
    GHA["GitHub Actions Workflows"]:::ci
  end

  subgraph "Hosting (Netlify)"
    NETLIFY["Netlify"]:::hosting
  end

  CONTENT -->|feeds into| CLI
  CONTENT -->|feeds into| CONFG
  CONTENT -->|feeds into| JSAPI
  CONTENT -->|feeds into| REL
  CONTENT -->|feeds into| COMPAT

  ASSETS -->|assets to| ASTRO

  CLI -->|generates artifacts for| ASTRO
  CONFG -->|generates artifacts for| ASTRO
  JSAPI -->|generates artifacts for| ASTRO
  REL -->|generates artifacts for| ASTRO
  COMPAT -->|generates artifacts for| ASTRO

  COMPONENTS --> ASTRO
  PAGES --> ASTRO
  STYLES --> ASTRO
  LUNARIA --> ASTRO

  GHA -->|triggers build| ASTRO
  ASTRO -->|produces static site| NETLIFY
  NETLIFY -->|serves docs to| BROWSER[End Users]:::external

  click CLI "https://github.com/tauri-apps/tauri-docs/blob/v2/packages/cli-generator/build.ts"
  click CONFG "https://github.com/tauri-apps/tauri-docs/blob/v2/packages/config-generator/build.ts"
  click JSAPI "https://github.com/tauri-apps/tauri-docs/blob/v2/packages/js-api-generator/build.ts"
  click REL "https://github.com/tauri-apps/tauri-docs/blob/v2/packages/releases-generator/build.ts"
  click COMPAT "https://github.com/tauri-apps/tauri-docs/blob/v2/packages/compatibility-table/build.ts"
  click CONTENT "https://github.com/tauri-apps/tauri-docs/tree/v2/src/content/"
  click ASSETS "https://github.com/tauri-apps/tauri-docs/tree/v2/public/assets/"
  click COMPONENTS "https://github.com/tauri-apps/tauri-docs/tree/v2/src/components/"
  click PAGES "https://github.com/tauri-apps/tauri-docs/blob/v2/src/pages/feed.xml.ts"
  click STYLES "https://github.com/tauri-apps/tauri-docs/blob/v2/src/styles/theme.scss"
  click ASTRO "https://github.com/tauri-apps/tauri-docs/blob/v2/astro.config.mjs"
  click LUNARIA "https://github.com/tauri-apps/tauri-docs/blob/v2/lunaria/renderer.config.ts"
  click GHA "https://github.com/tauri-apps/tauri-docs/blob/v2/.github/workflows/check.yml"
  click NETLIFY "https://github.com/tauri-apps/tauri-docs/blob/v2/netlify.toml"

  classDef codegen fill:#DDEEFF,stroke:#0088CC
  classDef content fill:#EEFFDD,stroke:#22AA00
  classDef module fill:#E0E0FF,stroke:#0000CC
  classDef pipeline fill:#FFE0B2,stroke:#CC6600
  classDef ci fill:#F0F0F0,stroke:#888888
  classDef hosting fill:#F3E5F5,stroke:#6A1B9A
  classDef external fill:#FFFFFF,stroke:#000000,stroke-dasharray:5 5
```
