# electron/website architecture

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

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

## Overview

##### Project type and purpose
- This is a static‐site project for the Electron website (electronjs.org) built with Docusaurus (a React-based static site generator).
- It also includes an npm package (“create-electron-documentation”) for automating doc scaffolding, and integrates with Crowdin (for translations), Algolia DocSearch, and GitHub Actions for CI/CD.

##### File structure
- Top‐level content folders:
- blog/           ← Markdown blog posts
- docs/           ← Mirrored Electron API & tutorials
- create-electron-documentation/  ← Standalone CLI package
- i18n/           ← Localization source files
- static/         ← Static assets (images, logos, etc.)
- Core build code:
- src/            ← Docusaurus custom React components, pages, plugins, transformers
- scripts/        ← Pre-build, i18n, API‐history, and other data‐prep scripts
- .github/        ← GitHub Actions workflows
- Config & metadata:
- docusaurus.config.ts, sidebars.js, package.json, tsconfig.json, .eslintrc.js, .prettierrc

##### README insights
- Built with Node.js (v22), Yarn, Docusaurus.
- Uses a “pre-build” step to pull in Electron repo docs.
- Crowdin manages translations; GitHub Actions automate doc updates, builds, and deploys.
- Algolia DocSearch provides search indexing.

## Diagram (Mermaid)

```mermaid
flowchart TB
  subgraph "Content Sources"
    Blog["blog/"]:::content
    Docs["docs/"]:::content
    Templates["create-electron-documentation/templates"]:::content
  end

  subgraph "Pre-build & Transform Scripts"
    PreBuild["scripts/pre-build.ts"]:::process
    Tasks["scripts/tasks/"]:::process
    Utils["scripts/utils/"]:::process
    Transformers["src/transformers/"]:::process
  end

  subgraph "Docusaurus Build Engine"
    Config["docusaurus.config.ts"]:::build
    Sidebars["sidebars.js"]:::build
    Theme["src/theme/"]:::build
    Components["src/components/"]:::build
    Pages["src/pages/"]:::build
    Plugins["src/plugins/"]:::build
    StylesCSS["src/css/"]:::build
    StylesSCSS["src/theme/**/*.scss"]:::build
  end

  subgraph "Localization Pipeline"
    LocaleSrc["i18n/"]:::loc
    CrowdinCfg["crowdin.yml"]:::loc
    PrepI18n["scripts/prepare-i18n-content.ts"]:::loc
    Glossary["scripts/update-crowdin-glossary.ts"]:::loc
    L10nSrc["scripts/update-l10n-sources.ts"]:::loc
  end

  subgraph "CI/CD Infrastructure"
    Workflows[".github/workflows/"]:::ci
    Matchers[".github/problem-matchers/"]:::ci
  end

  subgraph "External Services"
    CrowdinServ["Crowdin"]:::external
    Algolia["Algolia DocSearch"]:::external
    CDN["CDN/Hosting"]:::external
  end

  Runtime["Build Output (build/)"]:::deployment

  %% Content to Pre-build
  Blog --> PreBuild
  Docs --> PreBuild
  Templates --> PreBuild

  %% Pre-build to transformers
  PreBuild --> Tasks
  PreBuild --> Utils
  PreBuild --> Transformers

  %% Transform to build engine
  Transformers --> Config

  %% Config to build internals
  Config --> Sidebars
  Config --> Theme
  Config --> Components
  Config --> Pages
  Config --> Plugins
  Config --> StylesCSS
  Config --> StylesSCSS

  %% Build to runtime
  StylesSCSS --> Runtime

  %% Localization flow
  PrepI18n --> CrowdinServ
  CrowdinServ --> LocaleSrc
  LocaleSrc --> Config
  Glossary --> CrowdinServ
  L10nSrc --> CrowdinServ

  %% CI/CD orchestration
  Workflows --> PreBuild
  Workflows --> PrepI18n
  Workflows --> Config
  Workflows --> Runtime

  %% External integrations
  Config --> Algolia
  Runtime --> CDN

  %% Click Events
  click Blog "https://github.com/electron/website/tree/main/blog/"
  click Docs "https://github.com/electron/website/tree/main/docs/"
  click Templates "https://github.com/electron/website/tree/main/create-electron-documentation/templates"
  click PreBuild "https://github.com/electron/website/blob/main/scripts/pre-build.ts"
  click Tasks "https://github.com/electron/website/tree/main/scripts/tasks/"
  click Utils "https://github.com/electron/website/tree/main/scripts/utils/"
  click Transformers "https://github.com/electron/website/tree/main/src/transformers/"
  click Config "https://github.com/electron/website/blob/main/docusaurus.config.ts"
  click Sidebars "https://github.com/electron/website/blob/main/sidebars.js"
  click Theme "https://github.com/electron/website/tree/main/src/theme/"
  click Components "https://github.com/electron/website/tree/main/src/components/"
  click Pages "https://github.com/electron/website/tree/main/src/pages/"
  click Plugins "https://github.com/electron/website/tree/main/src/plugins/"
  click StylesCSS "https://github.com/electron/website/tree/main/src/css/"
  click StylesSCSS "https://github.com/electron/website/blob/main/src/theme/**/*.scss"
  click LocaleSrc "https://github.com/electron/website/tree/main/i18n/"
  click CrowdinCfg "https://github.com/electron/website/blob/main/crowdin.yml"
  click PrepI18n "https://github.com/electron/website/blob/main/scripts/prepare-i18n-content.ts"
  click Glossary "https://github.com/electron/website/blob/main/scripts/update-crowdin-glossary.ts"
  click L10nSrc "https://github.com/electron/website/blob/main/scripts/update-l10n-sources.ts"
  click Workflows "https://github.com/electron/website/tree/main/.github/workflows/"
  click Matchers "https://github.com/electron/website/tree/main/.github/problem-matchers/"

  classDef content fill:#D0E6FF,stroke:#0366d6
  classDef process fill:#DFFFD0,stroke:#28a745
  classDef build fill:#E8F0FF,stroke:#6f42c1
  classDef loc fill:#FFF0D0,stroke:#D66300
  classDef ci fill:#FFEFEF,stroke:#D73A49
  classDef external fill:#F5F5F5,stroke:#888888
  classDef deployment fill:#E8FFEE,stroke:#22863A
```
