# jsnmrs/jasonmorris architecture

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

- Interactive diagram: https://gitdiagram.com/jsnmrs/jasonmorris
- Repository: https://github.com/jsnmrs/jasonmorris

## Overview

##### Main Components
- Static Site Generator (Eleventy): At the center of the architecture, responsible for templating, layouts (found in _includes and pages), and content generation.
- Content/Pages: Represented by the “posts” and “pages” directories that hold the blog posts and pages (both Markdown and HTML) along with templated layouts. Mark the blog and page components distinctly.
- Assets and Media: Notice the “css”, “js”, “img”, and “fonts” directories. These represent the presentation layer and media resources. Also note Eleventy’s image optimization (using eleventy-img) and pre-processed CSS using PostCSS and related tools.
- Data Layer: The “_data” directory holds configuration data and site metadata, thus providing a centralized place for content configuration.
- Layout and Template Includes: The “_includes” directory contains reusable templates (layouts for posts, pages, home, etc.) and embedded scripts/styles.
- Build/CI Pipeline: GitHub workflows under “.github/workflows” show that the project has automated workflows such as build, test, deploy, and resume PDF generation. Also include config files such as package.json, eslint.config.js, PostCSS configuration, etc.

##### Relationships and Interactions
- The Eleventy engine (the core) pulls templates from _includes, page contents from “pages” and “posts”, and data from “_data” to generate the final static site.
- CSS and JavaScript files are built and compiled during development and production processes. They interact with HTML generated by Eleventy.
- Media files (images, videos, audio) reside in “img” (and also referenced in _includes and CSS) and are optimized and included via Eleventy shortcodes.
- The CI/CD pipeline (GitHub Actions) orchestrates linting, testing (HTML, CSS, JS, and accessibility tests), and deployment (and PDF resume generation) after the build process is complete.

##### Architectural Patterns and Design Principles
- Static Site Generation: Employs a build-time rendering pattern with separate source content and assets.
- Separation of Concerns: The clear division between content (posts/pages), templates (layouts in _includes), assets (css, js, img), and configuration/data (_data) exemplifies modular design.
- CI/CD and Automation: Use of GitHub Actions for continuous integration, testing, and deployment encapsulates modern DevOps practices.
- Accessibility and Performance Optimization: Dedicated linting/test configurations and optimization steps (e.g., Lighthouse scores, image optimizations) are key quality attributes.

##### Relevant Technologies, Frameworks, and Tools
- Eleventy (11ty) for static site generation.
- PostCSS (with Autoprefixer, CSSnano) for CSS processing.
- ESLint and Terser for JavaScript linting and minification.
- Eleventy-img for image optimization.
- GitHub Actions for automated CI/CD processes.
- Testing tools like HTML-validate, Pa11y, and stylelint for quality assurance.
- DocRaptor for generating tagged PDFs of the resume.

##### Elements
- Use clearly labeled components such as “Content (Pages & Posts)”, “Templates/Layouts”, “Static Assets (CSS, JS, Img)”, “Data Configuration”, “Build Engine (Eleventy)”, and “CI/CD Pipeline”.
- If space permits, include annotations about key technologies (PostCSS, ESLint, Eleventy-img, etc.) that handle specific parts of the system.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Source Content"
        pages["Pages (HTML & Markdown)"]:::content
        posts["Blog Posts (Markdown)"]:::content
    end

    subgraph "Templates & Data"
        layouts["Layout & Templates"]:::templates
        data["Data Configuration"]:::data
    end

    subgraph "Static Assets"
        css["CSS Assets"]:::assets
        js["JS Assets"]:::assets
        images["Image Assets"]:::assets
        fonts["Font Assets"]:::assets
    end

    eleventy["Static Site Generator (Eleventy)"]:::eleventy

    subgraph "CI/CD Pipeline"
        ci["Build & Test (GitHub Actions)"]:::ci
        deploy["Deployment Process"]:::deploy
    end

    %% Data Flow
    pages -->|"feeds into"| eleventy
    posts -->|"feeds into"| eleventy
    layouts -->|"provides layouts to"| eleventy
    data -->|"supplies data to"| eleventy

    %% Asset integration after build
    eleventy -->|"generates"| css
    eleventy -->|"generates"| js
    eleventy -->|"integrates"| images
    eleventy -->|"integrates"| fonts

    %% CI/CD Process
    eleventy -->|"triggers"| ci
    ci -->|"deploys to"| deploy

    %% Click Events
    click eleventy "https://github.com/jsnmrs/jasonmorris/blob/main/.eleventy.js"
    click pages "https://github.com/jsnmrs/jasonmorris/tree/main/pages/"
    click posts "https://github.com/jsnmrs/jasonmorris/tree/main/posts/"
    click css "https://github.com/jsnmrs/jasonmorris/tree/main/css/"
    click js "https://github.com/jsnmrs/jasonmorris/tree/main/js/"
    click images "https://github.com/jsnmrs/jasonmorris/tree/main/img/"
    click fonts "https://github.com/jsnmrs/jasonmorris/tree/main/fonts/"
    click data "https://github.com/jsnmrs/jasonmorris/tree/main/_data/"
    click layouts "https://github.com/jsnmrs/jasonmorris/tree/main/_includes/"
    click ci "https://github.com/jsnmrs/jasonmorris/tree/main/.github/workflows/"

    %% Styles
    classDef content fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef templates fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef data fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef assets fill:#FFFF99,stroke:#000,stroke-width:2px;
    classDef eleventy fill:#FFB6C1,stroke:#000,stroke-width:2px;
    classDef ci fill:#D3D3D3,stroke:#000,stroke-width:2px;
    classDef deploy fill:#20B2AA,stroke:#000,stroke-width:2px;
```
