# adechlien/leggiamo architecture

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

- Interactive diagram: https://gitdiagram.com/adechlien/leggiamo
- Repository: https://github.com/adechlien/leggiamo

## Overview

##### Main Components
- Frontend / Client Interface: Represented by the Astro pages in the src/pages directory. These pages include dynamic routing (e.g., [type]/[...slug].astro) for serving different types of content and a 404 page.
- Layouts and Components: The src/layouts and src/components folders contain reusable UI pieces (such as Header, Footer, About, etc.) that are composed to form each page.
- Content Management: The src/content directory holds the configuration (config.ts) and the markdown text files under texts/ that provide the actual blog content.
- Public Assets: The public directory contains static assets (including subdirectories like public/about) that are served as-is.
- Configuration & Build Files: Files like astro.config.mjs, tailwind.config.mjs, tsconfig.json, package.json, etc., indicate the tooling around Astro, Tailwind CSS, and TypeScript which orchestrate the build and development pipeline.

##### Relationships and Data Flow
- Page Composition: Each page under src/pages makes use of multiple components from src/components (e.g., Header, Footer, Categories, Quotes). Represent the Pages as a container that assembles these individual components.
- Asset Serving: The public directory is used for static files (images, extra HTML, perhaps about pages), which are directly referenced by the pages. Indicate a direct link from the Public Assets component to the overall site rendering.
- Styling and Build Process: Tools such as Tailwind (configured in tailwind.config.mjs) and TypeScript (configured via tsconfig.json) support the development process. Show these as supporting infrastructure that feed into the build process indicated by build configuration files (package.json scripts, Astro’s config, etc.).

##### Architectural Patterns & Design Principles
- Component-Based Architecture: Emphasize that the project uses a clear separation of UI components, which makes it modular and maintainable.
- Static Site Generation (SSG): Note that Astro is optimized for SSG, so the data flow is mostly during build time rather than on-the-fly server-side interactions.
- Separation of Content and Presentation: The markdown content is kept separate from presentation logic in the components and pages, enabling an easy content update mechanism independent of code changes.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Configuration & Build Tools
    subgraph "Configuration & Build Tools"
        AstroConfig["Astro Config (astro.config.mjs)"]:::config
        Tailwind["Tailwind Config (tailwind.config.mjs)"]:::config
        Tsconfig["TypeScript Config (tsconfig.json)"]:::config
        Package["Package File (package.json)"]:::config
    end

    %% Content Management
    subgraph "Content Management"
        Config["Config (config.ts)"]:::content
        Texts["Texts (Markdown Files)"]:::content
    end

    %% Layouts and Components
    subgraph "Layouts and Components"
        Layout["Layout (Layout.astro)"]:::layout
        %% UI Components
        Header["Header (Header.astro)"]:::components
        Footer["Footer (Footer.astro)"]:::components
        Categories["Categories (Categories.astro)"]:::components
        Quotes["Quotes (Quotes.astro)"]:::components
        FormattedDate["FormattedDate (FormattedDate.astro)"]:::components
        HeaderLink["HeaderLink (HeaderLink.astro)"]:::components
        Recent["Recent (Recent.astro)"]:::components
        About["About (About.astro)"]:::components
    end

    %% Frontend / Client Interface
    subgraph "Frontend / Client Interface"
        Pages["Pages (src/pages)"]:::pages
    end

    %% Public Assets
    subgraph "Public Assets"
        Public["Public Assets"]:::assets
        AboutAssets["About (public/about)"]:::assets
    end

    %% Relationships
    %% Build Config influences Pages
    AstroConfig -->|"builds"| Pages
    Tailwind -->|"styles"| Pages
    Tsconfig -->|"types"| Pages
    Package -->|"scripts"| Pages
    AstroConfig -->|"builds"| Layout

    %% Content feeds Pages
    Config -->|"injects_content"| Pages
    Texts -->|"injects_content"| Pages

    %% Layout & Components compose Pages
    Layout -->|"composes"| Pages
    Header -->|"composes"| Pages
    Footer -->|"composes"| Pages
    Categories -->|"composes"| Pages
    Quotes -->|"composes"| Pages
    FormattedDate -->|"composes"| Pages
    HeaderLink -->|"composes"| Pages
    Recent -->|"composes"| Pages
    About -->|"composes"| Pages

    %% Public Assets are served to Pages
    Public -->|"assets_for"| Pages
    AboutAssets -->|"contained_in"| Public

    %% Styles
    classDef pages fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef layout fill:#FFB6C1,stroke:#333,stroke-width:2px;
    classDef components fill:#87CEFA,stroke:#333,stroke-width:2px;
    classDef content fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef assets fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef config fill:#D3D3D3,stroke:#333,stroke-width:2px;

    %% Click Events
    click Pages "https://github.com/adechlien/leggiamo/tree/main/src/pages"
    click Layout "https://github.com/adechlien/leggiamo/blob/main/src/layouts/Layout.astro"
    click Header "https://github.com/adechlien/leggiamo/blob/main/src/components/Header.astro"
    click Footer "https://github.com/adechlien/leggiamo/blob/main/src/components/Footer.astro"
    click Categories "https://github.com/adechlien/leggiamo/blob/main/src/components/Categories.astro"
    click Quotes "https://github.com/adechlien/leggiamo/blob/main/src/components/Quotes.astro"
    click FormattedDate "https://github.com/adechlien/leggiamo/blob/main/src/components/FormattedDate.astro"
    click HeaderLink "https://github.com/adechlien/leggiamo/blob/main/src/components/HeaderLink.astro"
    click Recent "https://github.com/adechlien/leggiamo/blob/main/src/components/Recent.astro"
    click About "https://github.com/adechlien/leggiamo/blob/main/src/components/About.astro"
    click Config "https://github.com/adechlien/leggiamo/blob/main/src/content/config.ts"
    click Texts "https://github.com/adechlien/leggiamo/tree/main/src/content/texts/"
    click Public "https://github.com/adechlien/leggiamo/tree/main/public"
    click AboutAssets "https://github.com/adechlien/leggiamo/tree/main/public/about"
    click AstroConfig "https://github.com/adechlien/leggiamo/blob/main/astro.config.mjs"
    click Tailwind "https://github.com/adechlien/leggiamo/blob/main/tailwind.config.mjs"
    click Tsconfig "https://github.com/adechlien/leggiamo/blob/main/tsconfig.json"
    click Package "https://github.com/adechlien/leggiamo/blob/main/package.json"
```
