# eliasjohnson/eliasjohnson-com architecture

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

- Interactive diagram: https://gitdiagram.com/eliasjohnson/eliasjohnson-com
- Repository: https://github.com/eliasjohnson/eliasjohnson-com

## Overview

##### Project Type and Purpose
- This is a personal website built with SvelteKit (a Svelte-based full-stack framework) and Vite as the build tool.
- It appears to be primarily a front-end application (static/SRD/SSR pages) with no separate database or backend service.
- The README describes local development (`pnpm run dev`), production build (`pnpm run build`), and deployment via adapters and tunnel tools (e.g., ngrok).

##### File Structure
- Top level contains:
- .github/workflows/deploy.yml → Continuous Deployment pipeline configuration
- src/ → source code
– src/routes → page components (file-based routing)
– src/lib → shared modules, helper functions
– src/app.html, src/app.d.ts → app shell and TypeScript declarations
- static/ → public assets (images, favicon, etc.)
- svelte.config.js, vite.config.ts, tsconfig.json → framework and build configuration
- package.json, pnpm-lock.yaml → dependencies and package manager

##### README for Additional Insights
- No backend services or databases are mentioned.
- Deployment requires a SvelteKit adapter (e.g., Node, static) to target a hosting environment.

##### Main Components to Model
a. Developer Environment
- Local file system with source code, installed dependencies
- Vite development server (hot-module reloading)
b. Version Control & CI/CD
- GitHub repository triggers .github/workflows/deploy.yml
- CI job: install dependencies → run build → run tests (if any) → deploy
c. Build System
- Vite + SvelteKit adapter transform TS/​Svelte → optimized JS & static assets
d. Hosting Environment
- Static host or Node server (based on chosen adapter)
- CDN or edge network serving built assets
e. End User
- Browser requests HTML/CSS/JS assets
- SvelteKit either serves pre-rendered pages or handles SSR on demand

##### Relationships and Data Flows
- Developer → (code push) → GitHub repo
- GitHub Actions → build pipeline → deploy to hosting
- Hosting/CDN → serves files → Browser
- Browser → HTTP requests → Hosting (static file or SSR endpoint)
- Browser ↔ (WebSocket/HMR) ↔ Vite dev server in development

##### Architectural Patterns and Design Principles
- File-based routing in SvelteKit (routes directory maps to URL paths)
- Separation of concerns:
- Static assets (static/)
- UI components and logic (src/lib, src/routes)
- Build configuration and environment (config files)
- CI/CD pipeline for automated testing/build/deploy

##### Relevant Technologies
- SvelteKit (framework for SSR, SSG, SPA)
- Vite (bundler and dev server)
- TypeScript (typed JS)
- pnpm (package manager)
- GitHub Actions (CI/CD)
- Adapter (e.g., Vercel, Netlify, Node) for production hosting

## Diagram (Mermaid)

```mermaid
graph TD
    %% Development Tier
    subgraph "Development Tier"
        direction TB
        SRC["Source Code"]:::dev
        APP_HTML["App Shell (src/app.html)"]:::dev
        APP_DTS["Type Declarations (src/app.d.ts)"]:::dev
        LIB["Shared Modules (src/lib/index.ts)"]:::dev
        subgraph "Routes Directory"
            direction TB
            PAGE_SVELTE["+page.svelte"]:::dev
            PAGE_TS["+page.ts"]:::dev
        end
        STATIC["Static Assets (static/)"]:::dev
        CONFIG_SVELTE["SvelteKit Config (svelte.config.js)"]:::dev
        CONFIG_VITE["Vite Config (vite.config.ts)"]:::dev
        TS_CONFIG["TypeScript Config (tsconfig.json)"]:::dev
        PKG["Package Mgmt (package.json, pnpm-lock.yaml)"]:::dev
        NPMRC["Framework Declarations (.npmrc)"]:::dev
        GITIGNORE["Ignored Files (.gitignore)"]:::dev
        CNAME["Custom Domain (CNAME)"]:::dev
        DEV_SERVER["Vite Dev Server"]:::dev
    end

    %% CI/CD Tier
    subgraph "CI/CD Tier"
        direction TB
        GITHUB["GitHub Repo"]:::ci
        ACTIONS["GitHub Actions (deploy.yml)"]:::ci
    end

    %% Production Tier
    subgraph "Production Tier"
        direction TB
        BUILD["SvelteKit Build"]:::prod
        HOST["Hosting Platform (Adapter)"]:::prod
        CDN["CDN / Edge Network"]:::prod
        BROWSER["Browser (End User)"]:::external
    end

    %% Data Flows
    SRC -->|push code| GITHUB
    GITHUB -->|triggers| ACTIONS
    ACTIONS -->|build & deploy| BUILD
    BUILD -->|deploy| HOST
    HOST -->|serve assets| CDN
    CDN -->|deliver assets| BROWSER
    BROWSER -->|HTTP requests| HOST
    DEV_SERVER -->|HMR/WebSocket| BROWSER
    BROWSER -->|dev requests| DEV_SERVER
    SRC -->|served files| DEV_SERVER
    CONFIG_VITE --> DEV_SERVER
    CONFIG_SVELTE --> DEV_SERVER
    TS_CONFIG --> DEV_SERVER
    PKG --> DEV_SERVER
    LIB --> DEV_SERVER
    ROUTES --> DEV_SERVER
    STATIC --> DEV_SERVER

    %% Click Events
    click SRC "https://github.com/eliasjohnson/eliasjohnson-com/tree/main/src/"
    click APP_HTML "https://github.com/eliasjohnson/eliasjohnson-com/blob/main/src/app.html"
    click APP_DTS "https://github.com/eliasjohnson/eliasjohnson-com/blob/main/src/app.d.ts"
    click LIB "https://github.com/eliasjohnson/eliasjohnson-com/blob/main/src/lib/index.ts"
    click PAGE_SVELTE "https://github.com/eliasjohnson/eliasjohnson-com/blob/main/src/routes/+page.svelte"
    click PAGE_TS "https://github.com/eliasjohnson/eliasjohnson-com/blob/main/src/routes/+page.ts"
    click STATIC "https://github.com/eliasjohnson/eliasjohnson-com/tree/main/static/"
    click CONFIG_SVELTE "https://github.com/eliasjohnson/eliasjohnson-com/blob/main/svelte.config.js"
    click CONFIG_VITE "https://github.com/eliasjohnson/eliasjohnson-com/blob/main/vite.config.ts"
    click TS_CONFIG "https://github.com/eliasjohnson/eliasjohnson-com/blob/main/tsconfig.json"
    click PKG "https://github.com/eliasjohnson/eliasjohnson-com/blob/main/package.json"
    click PKG "https://github.com/eliasjohnson/eliasjohnson-com/blob/main/pnpm-lock.yaml"
    click NPMRC "https://github.com/eliasjohnson/eliasjohnson-com/blob/main/.npmrc"
    click GITIGNORE "https://github.com/eliasjohnson/eliasjohnson-com/blob/main/.gitignore"
    click CNAME "https://github.com/eliasjohnson/eliasjohnson-com/tree/main/CNAME"
    click ACTIONS "https://github.com/eliasjohnson/eliasjohnson-com/blob/main/.github/workflows/deploy.yml"

    %% Styles
    classDef dev fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef ci fill:#90EE90,stroke:#000,stroke-width:1px
    classDef prod fill:#FFA07A,stroke:#000,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:1px
```
