# rvmatos/page-template architecture

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

- Interactive diagram: https://gitdiagram.com/rvmatos/page-template
- Repository: https://github.com/rvmatos/page-template

## Overview

##### Project type and purpose
- This is a Jamstack-style, static site generator starter ("Astro Cactus") built with Astro.
- Purpose: opinionated blog/website template featuring markdown/MDX content collections, SEO, RSS, OG-image generation, dark/light theming, search, webmentions, and easy deploy.

##### File structure
- Top-level:
- Configs: astro.config.ts, tailwind.config.ts, netlify.toml, site.config.ts, content.config.ts
- Scripts & CI: package.json, .github/workflows/ci.yml, postbuild scripts
- Public assets: /public
- src:
- /pages – Astro page routes, including Markdown pages, OG-image endpoint (serverless)
- /layouts – page templates (Base, BlogPost)
- /components – UI pieces (Head, ThemeToggle, blog listings, webmentions widgets, search)
- /content – markdown/MDX posts & notes, driven by Astro Content Collections
- /plugins – custom remark plugins (admonitions, reading-time)
- /utils, /data, /styles – helper code, Tailwind CSS, global styles
- CI/CD:
- GitHub Actions for lint/test/build → outputs /dist → deployed (Netlify/Vercel)

##### README for additional insights
- Confirms features: static generation, RSS, sitemap, robots.txt, webmanifest, pagefind search, Satori OG images, webmention.io, Expressive Code syntax highlighting.
- Describes configuration (site.config.ts, astro.config.ts) and content workflow.

##### Detail & essential elements
- Don’t just show “frontend/backend”—break into: Content Collections, Astro Compiler, CSS pipeline, postbuild search, serverless functions, static CDN, third-party APIs.

## Diagram (Mermaid)

```mermaid
flowchart TB
  subgraph "Developer Environment"
    DevLocal["Local Code & Content"]:::dev
    DevLocal --> Git["Git Repository"]:::dev
  end

  subgraph "CI/CD Pipeline"
    CI["GitHub Actions"]:::ci
  end

  Git --> CI

  subgraph "Build Tools"
    subgraph "Configuration"
      ConfigAstro["Astro Config"]:::config
      ConfigTailwind["Tailwind CSS Config"]:::config
      SiteConfig["Site Config"]:::config
      ContentConfig["Content Collections Config"]:::config
    end
    subgraph "Content & Sources"
      ContentSrc["Markdown/MDX Content"]:::data
      Pages["Page Routes & Endpoints"]:::data
      Plugins["Remark Plugins"]:::proc
      BaseLayout["Base Layout"]:::data
      BlogLayout["BlogPost Layout"]:::data
      Components["UI Components"]:::data
      DataLayer["Data Layer Helpers"]:::data
      Utils["Utility Functions"]:::proc
      Styles["Global Styles & CSS"]:::data
    end
    CI --> Build["Astro Build & Tailwind"]:::build
    ConfigAstro --> Build
    ConfigTailwind --> Build
    SiteConfig --> Build
    ContentConfig --> Build
    ContentSrc --> Build
    Pages --> Build
    Plugins --> Build
    BaseLayout --> Build
    BlogLayout --> Build
    Components --> Build
    DataLayer --> Build
    Utils --> Build
    Styles --> Build
    Build --> Dist["/dist (Output Artifact)"]:::artifact
  end

  subgraph "Postbuild"
    Pagefind["Pagefind Search Index"]:::service
    Dist --> Pagefind
    Pagefind --> Dist
  end

  subgraph "Hosting & Runtime"
    CDN["CDN (Netlify/Vercel)"]:::hosting
    Dist --> CDN
    User["User Browser"]:::user
    CDN --> User
    Serverless["OG-image Endpoint"]:::compute
    User -->|"Request OG Image"| Serverless
    WebmentionAPI["webmention.io API"]:::external
    User -->|"Fetch Webmentions"| WebmentionAPI
    SearchUI["Search UI (Client)"]:::client
    User --> SearchUI
    SearchUI --> Pagefind
  end

  classDef dev fill:#E8F1FB,stroke:#3B8AC4,color:#03396C;
  classDef ci fill:#FFF3E0,stroke:#FB8C00,color:#E65100;
  classDef config fill:#EDE7F6,stroke:#5E35B1,color:#4A148C;
  classDef data fill:#E0F2F1,stroke:#00796B,color:#004D40;
  classDef proc fill:#F1F8E9,stroke:#689F38,color:#33691E;
  classDef build fill:#FFFDE7,stroke:#FBC02D,color:#F57F17;
  classDef artifact fill:#ECEFF1,stroke:#607D8B,color:#263238;
  classDef service fill:#E3F2FD,stroke:#42A5F5,color:#0D47A1;
  classDef hosting fill:#F3E5F5,stroke:#AB47BC,color:#4A148C;
  classDef compute fill:#FFE0B2,stroke:#FB8C00,color:#E65100;
  classDef external fill:#FFEBEE,stroke:#E53935,color:#B71C1C;
  classDef client fill:#FFF8E1,stroke:#FFB300,color:#FF6F00;
  classDef user fill:#E8EAF6,stroke:#3949AB,color:#1A237E;

  click CI "https://github.com/rvmatos/page-template/blob/main/.github/workflows/ci.yml"
  click ConfigAstro "https://github.com/rvmatos/page-template/blob/main/astro.config.ts"
  click ConfigTailwind "https://github.com/rvmatos/page-template/blob/main/tailwind.config.ts"
  click SiteConfig "https://github.com/rvmatos/page-template/blob/main/src/site.config.ts"
  click ContentConfig "https://github.com/rvmatos/page-template/blob/main/src/content.config.ts"
  click ContentSrc "https://github.com/rvmatos/page-template/tree/main/src/content"
  click Pages "https://github.com/rvmatos/page-template/tree/main/src/pages"
  click BaseLayout "https://github.com/rvmatos/page-template/blob/main/src/layouts/Base.astro"
  click BlogLayout "https://github.com/rvmatos/page-template/blob/main/src/layouts/BlogPost.astro"
  click Plugins "https://github.com/rvmatos/page-template/blob/main/src/plugins/remark-admonitions.ts"
  click Plugins "https://github.com/rvmatos/page-template/blob/main/src/plugins/remark-reading-time.ts"
  click DataLayer "https://github.com/rvmatos/page-template/blob/main/src/data/post.ts"
  click Utils "https://github.com/rvmatos/page-template/blob/main/src/utils/date.ts"
  click Utils "https://github.com/rvmatos/page-template/blob/main/src/utils/generateToc.ts"
  click Utils "https://github.com/rvmatos/page-template/blob/main/src/utils/webmentions.ts"
  click Styles "https://github.com/rvmatos/page-template/blob/main/src/styles/global.css"
  click Styles "https://github.com/rvmatos/page-template/blob/main/src/styles/blocks/search.css"
  click Serverless "https://github.com/rvmatos/page-template/tree/main/src/pages/og-image"
  click Pagefind "https://github.com/rvmatos/page-template/tree/main/postbuild scripts"
  click CDN "https://github.com/rvmatos/page-template/blob/main/netlify.toml"
```
