# mrmoneyinthebank/personal-website architecture

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

- Interactive diagram: https://gitdiagram.com/mrmoneyinthebank/personal-website
- Repository: https://github.com/mrmoneyinthebank/personal-website

## Overview

##### Main Components of the System
a. Astro Build Environment & Configuration:
- Components: astro.config.ts, tsconfig.json, package.json, tailwind.config.cjs, and other build-related files.
- Role: These files configure the build process, TypeScript settings, and styling (via Tailwind) for the site.
b. Content Management:
- Components: The src/content directory (with specific subdirectories for blog posts and other markdown content) and its configuration files.
- Interaction: Content (in markdown) flows into the layouts/pages during the build process.
c. Presentation Layer (Frontend):
- Components:
- Pages: Located in src/pages (e.g., index.astro, pages for posts, archives, tags, etc.).
- Layouts: Located in src/layouts (e.g., Main.astro, PostDetails.astro, AboutLayout.astro).
- Components: Reusable UI pieces found in src/components (e.g., Header, Footer, Breadcrumbs, ShareLinks, Tag, etc.).
- Role: These work together to form the visual structure of the website, rendering both static content and dynamically generated pages (like paginated posts or tag-based pages).
d. Assets & Static Files:
- Components:
- public directory: Contains globally accessible assets such as images, JavaScript (like toggle-theme.js), etc.
- Interaction: Assets are referenced by components and pages to style and enhance the website.
e. Utility/Helper Functions:
- Components: The src/utils folder, which provides functions for handling post filtering, slug generation, generating OG images, sorting posts, etc.
- Role: They abstract out common logic used by pages and components to dynamically generate parts of the website.
f. Docker & Deployment:
- Components: docker-compose.yml, Dockerfile (implicitly referenced via docker commands in README), and related configurations.
- Role: Provide containerization support to run this static site in a Docker environment, ensuring consistency across development and production.
g. Development & Quality Tools:
- Components: Files like .prettierrc, eslint.config.mjs, .npmrc, .gitignore, and others.
- Role: Ensure code quality, consistent formatting, and linting during development.

##### Relationships and Interactions
- The build configuration (Astro and TypeScript) takes inputs from the src content and pages, along with the configurations and utilities.
- The page layouts incorporate components (header, footer, navigation, etc.) and inject content from the markdown files (located in src/content).
- Utility functions (in src/utils) assist in processing data (e.g., sorting posts, generating slugs) that then feed into the pages or even OG image generation for social sharing.
- The public and assets directories provide resources that the rendered HTML (produced by Astro) references.
- Deployment scripts (like Docker-related files) sit at the root and indicate the process to containerize and run the static pages.

##### Architectural Patterns & Design Principles
- Modularity – each UI piece is encapsulated as a reusable component (Astro components and React components in TSX).
- Separation of Concerns – content (markdown), presentation (pages/layouts/components), and utilities (logic, data handling) are clearly separated in the file structure.
- Build Pipeline – the Astro build process turns these components and content into a static HTML site, which is then served.
- Containerization – Docker configurations indicate deployment flexibility via containerized environments.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build/Config Subgraph
    subgraph "Build/Config"
        Build1["astro.config.ts"]:::build
        Build2["tsconfig.json"]:::build
        Build3["package.json"]:::build
        Build4["tailwind.config.cjs"]:::build
    end

    %% Content Management Subgraph
    subgraph "Content Management"
        Content["src/content"]:::content
    end

    %% Presentation Layer Subgraph
    subgraph "Presentation Layer"
        subgraph "Pages"
            Pages["src/pages"]:::pages
        end
        subgraph "Layouts"
            Layouts["src/layouts"]:::pages
        end
        subgraph "Components"
            Components["src/components"]:::pages
        end
    end

    %% Assets & Static Files Subgraph
    subgraph "Assets & Static Files"
        Public["public"]:::assets
        AssetsSub["src/assets"]:::assets
    end

    %% Utility/Helper Functions Subgraph
    subgraph "Utility/Helper Functions"
        Utils["src/utils"]:::utils
    end

    %% Docker & Deployment Subgraph
    subgraph "Docker & Deployment"
        Docker["docker-compose.yml"]:::docker
    end

    %% Development & Quality Tools Subgraph
    subgraph "Development & Quality Tools"
        DevTools[".prettierrc/.eslintrc/.npmrc/.gitignore"]:::dev
    end

    %% Relationships / Data Flow
    Build1 -->|"configures"| Pages
    Content -->|"feeds"| Pages
    Content -->|"processed_by"| Utils
    Utils -->|"aids"| Components
    Public -->|"assets_used"| Pages
    AssetsSub -->|"assets_used"| Pages
    Layouts -->|"structures"| Pages
    DevTools -->|"supports"| Build1
    Build1 -->|"builds_for"| Docker

    %% Style Definitions
    classDef build fill:#f4cccc,stroke:#333,stroke-width:2px;
    classDef content fill:#d9ead3,stroke:#333,stroke-width:2px;
    classDef pages fill:#c9daf8,stroke:#333,stroke-width:2px;
    classDef assets fill:#fff2cc,stroke:#333,stroke-width:2px;
    classDef utils fill:#ead1dc,stroke:#333,stroke-width:2px;
    classDef docker fill:#d9d2e9,stroke:#333,stroke-width:2px;
    classDef dev fill:#f7f7a1,stroke:#333,stroke-width:2px;

    %% Click Events
    click Build1 "https://github.com/mrmoneyinthebank/personal-website/blob/main/astro.config.ts"
    click Build2 "https://github.com/mrmoneyinthebank/personal-website/blob/main/tsconfig.json"
    click Build3 "https://github.com/mrmoneyinthebank/personal-website/blob/main/package.json"
    click Build4 "https://github.com/mrmoneyinthebank/personal-website/blob/main/tailwind.config.cjs"
    click Content "https://github.com/mrmoneyinthebank/personal-website/tree/main/src/content"
    click Pages "https://github.com/mrmoneyinthebank/personal-website/tree/main/src/pages"
    click Layouts "https://github.com/mrmoneyinthebank/personal-website/tree/main/src/layouts"
    click Components "https://github.com/mrmoneyinthebank/personal-website/tree/main/src/components"
    click Public "https://github.com/mrmoneyinthebank/personal-website/tree/main/public"
    click AssetsSub "https://github.com/mrmoneyinthebank/personal-website/tree/main/src/assets"
    click Utils "https://github.com/mrmoneyinthebank/personal-website/tree/main/src/utils"
    click Docker "https://github.com/mrmoneyinthebank/personal-website/blob/main/docker-compose.yml"
    click DevTools "https://github.com/mrmoneyinthebank/personal-website/blob/main/.prettierrc"
```
