# deadvey/htdocs architecture

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

- Interactive diagram: https://gitdiagram.com/deadvey/htdocs
- Repository: https://github.com/deadvey/htdocs

## Overview

##### Main Components

a. Frontend Layer:
- Static HTML Pages (organized by sections)
- Client-side JavaScript
- CSS Styling
- Media Assets (images, videos, sounds)

b. Backend Layer (Note: Referenced in README as separate NodeJS repository)
- NodeJS Server
- Content Management System
- File Serving System

##### Component Organization

**[Client Browser]**
- ↕
**[Frontend Static Content]**
- Blog Section
- Posts
- Comments System
- Comics Section
- Experiments
- Wraithfate Game
- Bell Bollard
- Projects Section
- The Underland Wiki
- Search System
- ↕
**[Backend Server (NodeJS)]**

##### Important Details to Highlight

- The separation between static and dynamic content
- The comment system architecture
- Search functionality implementation
- Template system usage across different sections
- RSS feeds (indicated by feed.xml files)
- The relationship with the external NodeJS repository

##### Future State Elements

A section showing planned improvements:
- Client-side JS elimination (as per TODO)
- Full NodeJS preloading
- Gitlab mirroring infrastructure

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Client
        Browser[Client Browser]
    end

    subgraph Frontend
        StaticContent[Static Content]
        
        subgraph ContentSections
            Blog["Blog Section"]:::section
            Comics["Comics Section"]:::section
            Experiments["Experiments Section"]:::section
            Projects["Projects Section"]:::section
            Wiki["The Underland Wiki"]:::section
            Search["Search System"]:::section
        end

        subgraph BlogComponents
            BlogPosts["Blog Posts"]:::content
            BlogComments["Comments System"]:::interactive
            BlogRSS["RSS Feed"]:::content
            BlogTemplate["Blog Template"]:::template
        end

        subgraph ComicsComponents
            ComicPages["Comic Pages"]:::content
            ComicsRSS["Comics RSS Feed"]:::content
            ComicsTemplate["Comics Template"]:::template
        end

        subgraph ExperimentsComponents
            Wraithfate["Wraithfate Game"]:::interactive
            BellBollard["Bell Bollard"]:::interactive
        end

        subgraph WikiComponents
            WikiPages["Wiki Pages"]:::content
            WikiSearch["Wiki Search"]:::interactive
            WikiData["Wiki Data"]:::data
        end

        subgraph Templates
            RootTemplate["Root Template"]:::template
            VideoTemplate["Video Template"]:::template
        end

        subgraph Media
            Images["Images"]:::media
            Video["Video Section"]:::media
        end

        subgraph SearchSystem
            SearchApp["Search Application"]:::interactive
            SearchData["Search Data"]:::data
        end
    end

    subgraph Backend
        NodeJS["NodeJS Server"]:::backend
        CMS["Content Management System"]:::backend
        FileServer["File Serving System"]:::backend
    end

    %% Relationships
    Browser --> StaticContent
    StaticContent --> ContentSections
    Blog --> BlogComponents
    Comics --> ComicsComponents
    Experiments --> ExperimentsComponents
    Wiki --> WikiComponents
    Search --> SearchSystem
    ContentSections --> NodeJS
    NodeJS --> CMS
    NodeJS --> FileServer

    %% Click Events
    click Blog "https://github.com/DeaDvey/htdocs/tree/main/blog"
    click BlogPosts "https://github.com/DeaDvey/htdocs/tree/main/blog/blogs"
    click BlogComments "https://github.com/DeaDvey/htdocs/tree/main/blog/comments"
    click BlogRSS "https://github.com/DeaDvey/htdocs/blob/main/blog/feed.xml"
    click BlogTemplate "https://github.com/DeaDvey/htdocs/blob/main/blog/template.js"
    click Comics "https://github.com/DeaDvey/htdocs/tree/main/comics"
    click ComicPages "https://github.com/DeaDvey/htdocs/tree/main/comics/comic"
    click ComicsRSS "https://github.com/DeaDvey/htdocs/blob/main/comics/feed.xml"
    click ComicsTemplate "https://github.com/DeaDvey/htdocs/blob/main/comics/template.js"
    click Experiments "https://github.com/DeaDvey/htdocs/tree/main/experiments"
    click Wraithfate "https://github.com/DeaDvey/htdocs/tree/main/experiments/wraithfate_v2"
    click BellBollard "https://github.com/DeaDvey/htdocs/tree/main/experiments/bellbollard"
    click Projects "https://github.com/DeaDvey/htdocs/tree/main/project"
    click Wiki "https://github.com/DeaDvey/htdocs/tree/main/theunderland"
    click WikiPages "https://github.com/DeaDvey/htdocs/tree/main/theunderland/wiki/pages"
    click WikiSearch "https://github.com/DeaDvey/htdocs/blob/main/theunderland/wiki/app.js"
    click WikiData "https://github.com/DeaDvey/htdocs/blob/main/theunderland/wiki/list.json"
    click Search "https://github.com/DeaDvey/htdocs/tree/main/search"
    click SearchApp "https://github.com/DeaDvey/htdocs/blob/main/search/app.js"
    click SearchData "https://github.com/DeaDvey/htdocs/blob/main/search/list.json"
    click RootTemplate "https://github.com/DeaDvey/htdocs/blob/main/template.js"
    click VideoTemplate "https://github.com/DeaDvey/htdocs/blob/main/video/template.js"
    click Images "https://github.com/DeaDvey/htdocs/tree/main/images"
    click Video "https://github.com/DeaDvey/htdocs/tree/main/video"

    %% Styles
    classDef section fill:#a8dadc
    classDef content fill:#457b9d
    classDef interactive fill:#2a9d8f
    classDef template fill:#e9c46a
    classDef data fill:#f4a261
    classDef media fill:#e76f51
    classDef backend fill:#264653
```
