# arthelokyo/astrowind architecture

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

- Interactive diagram: https://gitdiagram.com/arthelokyo/astrowind
- Repository: https://github.com/arthelokyo/astrowind

## Overview

##### Project type and purpose
- AstroWind is a static-first, component-based website template built with Astro 5.0 and Tailwind CSS.
- Its primary purpose is to generate a high-performance, SEO-friendly site (including a blog) at build time, with optional hybrid/SSR support.

##### File structure
- Top-level configuration: `astro.config.ts`, `tailwind.config.js`, `netlify.toml`, `docker-compose.yml`, `Dockerfile`, GitHub Actions workflows, and Vercel/Netlify deploy files—indicating CI/CD and containerization support.
- Public assets (`public/`): static files (robots.txt, headers, Decap CMS assets).
- Source code (`src/`):
- `assets/` (styles, images, favicons)
- `components/` (Astro components organized by feature: blog, common, ui, widgets)
- `layouts/` (page templates)
- `pages/` (file-based routing for pages and dynamic blog routes)
- `content/` and `data/` (Markdown/MDX posts, frontmatter configuration)
- `utils/` and `navigation.ts` (helper functions for routing, permalinks, image optimization)
- `config.yaml` (site metadata, blog settings, analytics config)
- No traditional backend or database: blog content is sourced from Markdown/MDX files.

##### README for additional insights
- Core stack: Astro + Tailwind CSS + MDX + built-in image optimization (Astro Assets and Unpic).
- Features: SSG/hybrid output, blog engine (categories, tags, RSS), SEO (Open Graph, sitemap), analytics integrations (Google Analytics, Splitbee).
- Deployment: static export (`dist/`) to any host, plus first-class support for Netlify and Vercel.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer & Version Control
    Developer["Developer (IDE & Local Dev Server)"]:::runtime
    GitHubRepo["GitHub Repository"]:::runtime

    Developer -->|"push code"| GitHubRepo

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        CI["GitHub Actions"]:::build
        NetlifyCI["Netlify Config"]:::build
        VercelCI["Vercel Config"]:::build
        DockerCI["Docker Setup"]:::build
    end

    GitHubRepo -->|"trigger build"| CI
    CI -->|"uses netlify.toml"| NetlifyCI
    CI -->|"uses vercel.json"| VercelCI
    CI -->|"build in container"| DockerCI

    %% Source Modules
    subgraph "Source Modules"
        direction TB
        Config["Site Configuration (src/config.yaml)"]:::config
        subgraph "Content Source"
            direction TB
            MDXFiles["Markdown/MDX Files"]:::build
            DataPosts["Data Posts (src/data/post/)"]:::build
        end
        subgraph "Component Library"
            direction TB
            Components["Components (src/components/)"]:::build
            BlogComp["Blog Components"]:::build
            CommonComp["Common Components"]:::build
            UIComp["UI Primitives"]:::build
            WidgetsComp["Widgets"]:::build
        end
        Layouts["Layouts (src/layouts/)"]:::build
        Pages["Pages & Routing (src/pages/)"]:::build
        Utils["Utility Functions (src/utils/)"]:::build
        Navigation["Navigation Helpers (src/navigation.ts)"]:::build
    end

    %% Build Pipeline
    subgraph "Build Pipeline"
        direction TB
        AstroBuild["Astro Build Service"]:::build
        Tailwind["Tailwind Compiler"]:::build
        MDXParser["MDX Parser"]:::build
        ImageOpt["Image Optimizer"]:::build
    end

    %% Build Flow
    Config --> AstroBuild
    MDXFiles --> MDXParser
    DataPosts --> MDXParser
    Components --> AstroBuild
    Layouts --> AstroBuild
    Pages --> AstroBuild
    Utils --> AstroBuild
    Navigation --> AstroBuild
    AstroBuild --> Tailwind
    AstroBuild --> MDXParser
    AstroBuild --> ImageOpt
    Tailwind -->|"generate CSS"| AstroBuild
    MDXParser -->|"transform posts"| AstroBuild
    ImageOpt -->|"process images"| AstroBuild
    AstroBuild -->|"output dist/"| Dist

    %% Output & Deploy
    Dist["dist/ (Static Artifacts)"]:::runtime
    CI -->|"deploy dist/"| Hosting

    %% Hosting & Runtime
    subgraph "Hosting & CDN"
        direction TB
        Hosting["Static Host / CDN"]:::runtime
        Container["Docker + Nginx"]:::runtime
        PublicAssets["Public Assets (public/)"]:::runtime
        NginxConf["Nginx Config"]:::runtime
    end

    Dist --> Hosting
    Dist --> Container
    Container --> NginxConf
    PublicAssets --> Hosting

    %% Client & External Services
    Client["Client Browser"]:::runtime
    AnalyticsGA["Google Analytics"]:::external
    AnalyticsSB["Splitbee Analytics"]:::external
    ImageCDN["Unpic Image CDN"]:::external

    Hosting -->|"HTTP GET"| Client
    Client -->|"analytics script"| AnalyticsGA
    Client -->|"analytics script"| AnalyticsSB
    Client -->|"fetch optimized images"| ImageCDN

    %% Click Events
    click AstroBuild "https://github.com/arthelokyo/astrowind/blob/main/astro.config.ts"
    click Tailwind "https://github.com/arthelokyo/astrowind/blob/main/tailwind.config.js"
    click Tailwind "https://github.com/arthelokyo/astrowind/blob/main/src/assets/styles/tailwind.css"
    click MDXFiles "https://github.com/arthelokyo/astrowind/tree/main/src/content/"
    click DataPosts "https://github.com/arthelokyo/astrowind/tree/main/src/data/post/"
    click ImageOpt "https://github.com/arthelokyo/astrowind/blob/main/src/utils/images-optimization.ts"
    click ImageOpt "https://github.com/arthelokyo/astrowind/blob/main/src/utils/images.ts"
    click Components "https://github.com/arthelokyo/astrowind/tree/main/src/components/"
    click BlogComp "https://github.com/arthelokyo/astrowind/tree/main/src/components/blog/"
    click CommonComp "https://github.com/arthelokyo/astrowind/tree/main/src/components/common/"
    click UIComp "https://github.com/arthelokyo/astrowind/tree/main/src/components/ui/"
    click WidgetsComp "https://github.com/arthelokyo/astrowind/tree/main/src/components/widgets/"
    click Layouts "https://github.com/arthelokyo/astrowind/tree/main/src/layouts/"
    click Pages "https://github.com/arthelokyo/astrowind/tree/main/src/pages/"
    click Utils "https://github.com/arthelokyo/astrowind/tree/main/src/utils/"
    click Navigation "https://github.com/arthelokyo/astrowind/blob/main/src/navigation.ts"
    click Config "https://github.com/arthelokyo/astrowind/blob/main/src/config.yaml"
    click CI "https://github.com/arthelokyo/astrowind/blob/main/.github/workflows/actions.yaml"
    click NetlifyCI "https://github.com/arthelokyo/astrowind/blob/main/netlify.toml"
    click VercelCI "https://github.com/arthelokyo/astrowind/blob/main/vercel.json"
    click DockerCI "https://github.com/arthelokyo/astrowind/tree/main/Dockerfile"
    click DockerCI "https://github.com/arthelokyo/astrowind/blob/main/docker-compose.yml"
    click NginxConf "https://github.com/arthelokyo/astrowind/blob/main/nginx/nginx.conf"
    click PublicAssets "https://github.com/arthelokyo/astrowind/tree/main/public/"
    click AnalyticsGA "https://github.com/arthelokyo/astrowind/blob/main/src/components/common/Analytics.astro"
    click AnalyticsSB "https://github.com/arthelokyo/astrowind/blob/main/src/components/common/SplitbeeAnalytics.astro"

    %% Styles
    classDef build fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef runtime fill:#d4edda,stroke:#333,stroke-width:1px
    classDef external fill:#ffe5cc,stroke:#333,stroke-width:1px
    classDef config fill:#fdfd96,stroke:#333,stroke-width:1px
```
