# pepodev/digital-garden architecture

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

- Interactive diagram: https://gitdiagram.com/pepodev/digital-garden
- Repository: https://github.com/pepodev/digital-garden

## Overview

##### Main Components

a. Client-Side Components:
- Static Site Generator (11ty/Eleventy)
- Frontend UI Components (located in src/site/_includes/components)
- Search Functionality
- Graph Visualization
- Theme System

b. Content Management:
- Obsidian Notes Repository (src/site/notes)
- File Tree System
- Asset Management (images, attachments)

c. Build & Deployment:
- Vercel/Netlify Integration
- Build Pipeline

**┌─────────────────────────────────────────────┐**
- Presentation                 │
- (Components, Layouts, Styles, User Interface)│
- ┤
- Content Processing             │
- (11ty, Templates, Markdown Rendering)    │
- ┤
- Data Management               │
- (Notes, Files, Assets, Search Index)    │
- ┘

##### Key Relationships to Highlight

a. Static Site Generation Flow:
- How Eleventy processes Markdown files
- Demonstrate template rendering pipeline
- How components are assembled

b. Data Flow:
- Content → Template processing → HTML output
- Search indexing process
- Graph visualization data generation

##### Detailed Component Breakdown

**┌─ Frontend Components ─────┐**
- Navigation             │
- Search                 │
- Graph Visualization    │
- File Tree             │
- Note Display          │
- ┘

**┌─ Templates & Layouts ────┐**
- Base Layout           │
- Note Layout           │
- Component Templates   │
- ┘

**┌─ Data & Content ─────────┐**
- Markdown Files        │
- Media Assets         │
- Search Index         │
- Metadata             │
- ┘

##### Additional Elements

- User interaction flows
- Content update mechanisms
- Cache and performance optimizations
- Security considerations
- Integration points with Obsidian

Remember to emphasize the static nature of the final output while showing how dynamic features (search, graph) are implemented client-side. This is crucial for understanding the architecture's constraints and benefits.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Presentation
        UI[Frontend UI Components]
        Search[Search Components]
        Graph[Graph Visualization]
        FileTree[File Tree Interface]
        Theme[Theme System]
        Styles[Styling Components]
    end

    subgraph "Content Processing"
        SSG[Static Site Generator]
        Templates[Templates & Layouts]
        MD[Markdown Processing]
    end

    subgraph "Data Management"
        Notes[Obsidian Notes]
        Assets[Asset Management]
        SearchIndex[Search Index]
    end

    subgraph "Build & Deploy"
        Vercel[Vercel]
        Netlify[Netlify]
    end

    %% Relationships
    Notes --> MD
    MD --> SSG
    SSG --> Templates
    Templates --> UI
    Assets --> SSG
    SearchIndex --> Search
    Notes --> Graph
    Notes --> FileTree
    Theme --> UI
    SSG --> Vercel
    SSG --> Netlify

    %% Click Events
    click UI "https://github.com/PePoDev/digital-garden/tree/main/src/site/_includes/components/"
    click Search "https://github.com/PePoDev/digital-garden/blob/main/src/site/_includes/components/searchContainer.njk"
    click Graph "https://github.com/PePoDev/digital-garden/blob/main/src/site/_includes/components/graphScript.njk"
    click FileTree "https://github.com/PePoDev/digital-garden/blob/main/src/site/_includes/components/filetree.njk"
    click Theme "https://github.com/PePoDev/digital-garden/blob/main/src/site/get-theme.js"
    click SSG "https://github.com/PePoDev/digital-garden/blob/main/.eleventy.js"
    click Notes "https://github.com/PePoDev/digital-garden/tree/main/src/site/notes/"
    click Assets "https://github.com/PePoDev/digital-garden/tree/main/src/site/img/"
    click Templates "https://github.com/PePoDev/digital-garden/blob/main/src/site/_includes/layouts/note.njk"
    click Styles "https://github.com/PePoDev/digital-garden/blob/main/src/site/styles/digital-garden-base.scss"
    click Vercel "https://github.com/PePoDev/digital-garden/blob/main/vercel.json"
    click Netlify "https://github.com/PePoDev/digital-garden/blob/main/netlify.toml"

    %% Styling
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef processing fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:black
    classDef deployment fill:#9b59b6,stroke:#8e44ad,color:white

    class UI,Search,Graph,FileTree,Theme,Styles frontend
    class SSG,Templates,MD processing
    class Notes,Assets,SearchIndex data
    class Vercel,Netlify deployment
```
