# aaronmclayton/11ty-starter-kit architecture

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

- Interactive diagram: https://gitdiagram.com/aaronmclayton/11ty-starter-kit
- Repository: https://github.com/aaronmclayton/11ty-starter-kit

## Overview

This project is a starter kit for 11ty (Eleventy), a static site generator, that leverages Nunjucks as its templating engine and TailwindCSS for styling. The main goal of the project is to provide developers with a pre-configured, minimal starting point for building fast, static websites with a modern CSS framework and templating support.

##### Main Components
- 11ty Engine: Representing the static site generation process, which reads configuration from .eleventy.js.
- Template Engine (Nunjucks): Indicated by the directory src/_includes and layouts (e.g., base.html) where all the templating logic resides.
- CSS Processing (TailwindCSS): With configuration via tailwind.config.js and styles in src/css/main.css.
- Static Assets: The src folder (e.g., src/index.html) which houses the static HTML files that are pre-processed by 11ty.
- Build & Development Tools: Node.js environment with dependency definitions (package.json and package-lock.json) that coordinate the build, watch, and serve commands.

##### File Structure for Additional Details
- Top-level files like .eleventy.js and tailwind.config.js point to configuration and build-time processing logic.
- The inclusion of LICENSE, README.md, and package JSON files indicate standard project documentation and dependency management.
- The src directory is logically partitioned into segments for layouts (src/_includes/layouts) and styling (src/css), signaling a separation of concerns between content/templates and design.

##### Relationships and Interactions
- 11ty reads the content and templates from the src folder (including layouts in src/_includes) and processes them according to instructions set in .eleventy.js to generate static HTML files.
- TailwindCSS is integrated into the build pipeline; changes in src/css/main.css trigger a recompilation through Tailwind (as per tailwind.config.js) which in turn auto-refreshes the content served.
- The NPM scripts (npm run start) orchestrate the development flow, ensuring that 11ty and Tailwind play together to watch file changes and update the build accordingly.

##### Architectural Patterns & Technologies
- The project follows a static site architecture with clear separation of content (HTML and templates), presentation (CSS/Tailwind), and build configuration.
- It utilizes convention-over-configuration where file naming and directory layout drive the static site generation process.
- There’s an emphasis on automation and watch-based reloading during development, as described in the README.

- "User Content" (src directory) into logical subgroups: Templates, Layouts, and CSS.
- Role of configuration files (e.g., .eleventy.js for 11ty and tailwind.config.js for Tailwind) that customize the build process.
- Element is clearly labeled and interactions are unambiguous, facilitating a quick understanding of how the starter kit functions as a whole.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Source Files"
        sourceContent["Source Content (HTML & Assets)"]:::source
        nunjucksTemplates["Nunjucks Templates (src/_includes)"]:::template
        baseLayout["Base Layout (src/_includes/layouts/base.html)"]:::template
        cssSource["CSS File (src/css/main.css)"]:::css
    end

    subgraph "Configuration Files"
        eleventyConfig["11ty Config (.eleventy.js)"]:::config
        tailwindConfig["Tailwind Config (tailwind.config.js)"]:::config
        buildConfig["Build Config (package.json)"]:::config
        lockConfig["Lock File (package-lock.json)"]:::config
    end

    subgraph "Build Process"
        staticSiteGen["Static Site Generator (11ty)"]:::build
        cssProcessor["CSS Preprocessor (TailwindCSS)"]:::build
    end

    subgraph "Output"
        finalOutput["Static Output (HTML & CSS)"]:::output
    end

    subgraph "Development Environment"
        devEnv["NPM Scripts & Auto-Refresh"]:::dev
    end

    %% Connections from Source Files to Build Process
    sourceContent -->|"providesContent"| staticSiteGen
    nunjucksTemplates -->|"providesTemplates"| staticSiteGen
    baseLayout -->|"definesLayout"| staticSiteGen
    eleventyConfig -->|"configures"| staticSiteGen

    cssSource -->|"sourceCSS"| cssProcessor
    tailwindConfig -->|"configures"| cssProcessor

    %% Build Process produces output
    staticSiteGen -->|"generatesHTML"| finalOutput
    cssProcessor -->|"processesCSS"| finalOutput

    %% Development Environment triggers build
    buildConfig -->|"dependencyMgmt"| devEnv
    lockConfig -->|"locksVersions"| devEnv
    devEnv -->|"triggersBuild"| staticSiteGen
    devEnv -->|"triggersBuild"| cssProcessor

    %% Class Definitions for Colors
    classDef source fill:#f4e1d2,stroke:#cc5500,stroke-width:2px;
    classDef template fill:#e1d2f4,stroke:#a020f0,stroke-width:2px;
    classDef css fill:#d2e1f4,stroke:#0066ff,stroke-width:2px;
    classDef config fill:#e1f4d2,stroke:#228B22,stroke-width:2px;
    classDef build fill:#f4d2e1,stroke:#ff1493,stroke-width:2px;
    classDef output fill:#d2f4e1,stroke:#32cd32,stroke-width:2px;
    classDef dev fill:#f4efd2,stroke:#ffa500,stroke-width:2px;

    %% Click Events
    click eleventyConfig "https://github.com/aaronmclayton/11ty-starter-kit/blob/main/.eleventy.js"
    click nunjucksTemplates "https://github.com/aaronmclayton/11ty-starter-kit/tree/main/src/_includes"
    click baseLayout "https://github.com/aaronmclayton/11ty-starter-kit/blob/main/src/_includes/layouts/base.html"
    click tailwindConfig "https://github.com/aaronmclayton/11ty-starter-kit/blob/main/tailwind.config.js"
    click cssSource "https://github.com/aaronmclayton/11ty-starter-kit/blob/main/src/css/main.css"
    click sourceContent "https://github.com/aaronmclayton/11ty-starter-kit/tree/main/src"
    click buildConfig "https://github.com/aaronmclayton/11ty-starter-kit/blob/main/package.json"
    click lockConfig "https://github.com/aaronmclayton/11ty-starter-kit/blob/main/package-lock.json"
```
