# markongithub/astro_tutorial architecture

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

- Interactive diagram: https://gitdiagram.com/markongithub/astro_tutorial
- Repository: https://github.com/markongithub/astro_tutorial

## Overview

##### Project type and purpose
- This is a static-site project built with Astro (a modern static-site generator).
- Purpose: author content in Markdown and Astro components, compile to a fast, deployable HTML/CSS/JS site.

##### File structure
- Top-level files
- package.json / package-lock.json / tsconfig.json → Node.js + TypeScript config
- astro.config.mjs → Astro build configuration
- .gitignore / .vscode → project housekeeping
- public/ → static assets (images, fonts, favicon, etc.), copied as-is into the final build
- src/
- pages/ → file-based routing: .astro + .md files map to site routes
– index.astro, about.astro, blog.astro
– posts/*.md → individual blog posts
– tags/[tag].astro → dynamic tag pages
– rss.xml.js → RSS generation script
- components/ → reusable UI pieces (Header, Footer, Navigation, etc.), some written in .astro, one in React (Greeting.jsx)
- layouts/ → master layouts (BaseLayout, MarkdownPostLayout) that wrap pages
- scripts/ → plain JS helper (menu toggle)
- styles/ → global.css

##### README for additional insights
- Describes Astro conventions (src/pages routing, src/components location, public/ for static assets)
- Mentions CLI commands for dev, build, preview

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer and Dev Server
    Dev["Developer Workstation\n(VS Code, CLI)"]:::dev
    DevServer["Astro Dev Server\n(npm run dev)"]:::process

    Dev -->|"edits source files"| DevServer
    DevServer -->|"hot-reloads"| Browser

    %% Source Files Subgraphs
    subgraph "Configuration" 
        cfg1["astro.config.mjs"]:::config
        cfg2["package.json"]:::config
        cfg3["tsconfig.json"]:::config
    end

    subgraph "Pages & Posts"
        idx["index.astro"]:::source
        about["about.astro"]:::source
        blog["blog.astro"]:::source
        tagsIdx["tags/index.astro"]:::source
        tagsTag["tags/[tag].astro"]:::source
        rss["rss.xml.js"]:::process
        post1["post-1.md"]:::source
        post2["post-2.md"]:::source
        post3["post-3.md"]:::source
        post4["post-4.md"]:::source
    end

    subgraph "Components"
        hdr["Header.astro"]:::source
        ftr["Footer.astro"]:::source
        nav["Navigation.astro"]:::source
        ham["Hamburger.astro"]:::source
        soc["Social.astro"]:::source
        them["ThemeIcon.astro"]:::source
        bp["BlogPost.astro"]:::source
        greet["Greeting.jsx"]:::source
    end

    subgraph "Layouts"
        base["BaseLayout.astro"]:::source
        mdpost["MarkdownPostLayout.astro"]:::source
    end

    subgraph "Scripts & Styles"
        menu["menu.js"]:::source
        gs["global.css"]:::source
    end

    public["public/"]:::source

    %% Build Pipeline and Output
    Build["Astro Compiler & Build Pipeline"]:::process
    Dist["dist/ (HTML, CSS, JS, RSS)"]:::target
    Hosting["Hosting Platform\n(Netlify/Vercel)"]:::target
    Browser["End User Browser"]:::target

    %% Flows
    cfg1 --> Build
    cfg2 --> Build
    cfg3 --> Build
    idx --> Build
    about --> Build
    blog --> Build
    tagsIdx --> Build
    tagsTag --> Build
    post1 --> Build
    post2 --> Build
    post3 --> Build
    post4 --> Build
    hrss["rss.xml.js"]-.->Build
    hdr --> Build
    ftr --> Build
    nav --> Build
    ham --> Build
    soc --> Build
    them --> Build
    bp --> Build
    greet --> Build
    base --> Build
    mdpost --> Build
    menu --> Build
    gs --> Build
    public --> Build

    Build -->|"emit static files"| Dist
    Dist --> Hosting
    Hosting --> Browser

    %% Click Events
    click cfg1 "https://github.com/markongithub/astro_tutorial/blob/main/astro.config.mjs"
    click cfg2 "https://github.com/markongithub/astro_tutorial/blob/main/package.json"
    click cfg3 "https://github.com/markongithub/astro_tutorial/blob/main/tsconfig.json"
    click public "https://github.com/markongithub/astro_tutorial/tree/main/public/"
    click idx "https://github.com/markongithub/astro_tutorial/blob/main/src/pages/index.astro"
    click about "https://github.com/markongithub/astro_tutorial/blob/main/src/pages/about.astro"
    click blog "https://github.com/markongithub/astro_tutorial/blob/main/src/pages/blog.astro"
    click tagsIdx "https://github.com/markongithub/astro_tutorial/blob/main/src/pages/tags/index.astro"
    click tagsTag "https://github.com/markongithub/astro_tutorial/blob/main/src/pages/tags/[tag].astro"
    click post1 "https://github.com/markongithub/astro_tutorial/blob/main/src/pages/posts/post-1.md"
    click post2 "https://github.com/markongithub/astro_tutorial/blob/main/src/pages/posts/post-2.md"
    click post3 "https://github.com/markongithub/astro_tutorial/blob/main/src/pages/posts/post-3.md"
    click post4 "https://github.com/markongithub/astro_tutorial/blob/main/src/pages/posts/post-4.md"
    click rss "https://github.com/markongithub/astro_tutorial/blob/main/src/pages/rss.xml.js"
    click hdr "https://github.com/markongithub/astro_tutorial/blob/main/src/components/Header.astro"
    click ftr "https://github.com/markongithub/astro_tutorial/blob/main/src/components/Footer.astro"
    click nav "https://github.com/markongithub/astro_tutorial/blob/main/src/components/Navigation.astro"
    click ham "https://github.com/markongithub/astro_tutorial/blob/main/src/components/Hamburger.astro"
    click soc "https://github.com/markongithub/astro_tutorial/blob/main/src/components/Social.astro"
    click them "https://github.com/markongithub/astro_tutorial/blob/main/src/components/ThemeIcon.astro"
    click bp "https://github.com/markongithub/astro_tutorial/blob/main/src/components/BlogPost.astro"
    click greet "https://github.com/markongithub/astro_tutorial/blob/main/src/components/Greeting.jsx"
    click base "https://github.com/markongithub/astro_tutorial/blob/main/src/layouts/BaseLayout.astro"
    click mdpost "https://github.com/markongithub/astro_tutorial/blob/main/src/layouts/MarkdownPostLayout.astro"
    click menu "https://github.com/markongithub/astro_tutorial/blob/main/src/scripts/menu.js"
    click gs "https://github.com/markongithub/astro_tutorial/blob/main/src/styles/global.css"

    %% Styles
    classDef dev fill:#F5B7B1,stroke:#333,stroke-width:1px
    classDef config fill:#D6EAF8,stroke:#333,stroke-width:1px
    classDef source fill:#AED6F1,stroke:#333,stroke-width:1px
    classDef process fill:#A9DFBF,stroke:#333,stroke-width:1px
    classDef target fill:#F9E79F,stroke:#333,stroke-width:1px
```
