# kevanmacgee/project-notes architecture

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

- Interactive diagram: https://gitdiagram.com/kevanmacgee/project-notes
- Repository: https://github.com/kevanmacgee/project-notes

## Overview

##### Project type and purpose
- This is a single-page, static web application (an “inline HTML/CSS/JS” tool) designed to run locally in the user’s browser.
- Its sole purpose is to provide a lightweight, per-project KanBan board + link organizer, with data persistence via browser localStorage and import/export via JSON files.

##### File structure
- Top-level files:
- index.html – contains all HTML markup, CSS (Bootswatch theme), and JavaScript logic in one file.
- README.md – describes usage, features, and intended local-only operation.
- No backend, no build scripts, no external services beyond a CSS theme CDN.

##### Key insights from README
- Data is stored in browser localStorage, keyed by the filename.
- Users can export/import the entire state as a JSON file.
- Uses Bootswatch for light/dark themes.
- Drag & drop features for both KanBan cards and links.
- Spellcheck handled by the browser.

##### Main components
a. Browser (runtime environment)
b. index.html application, logically split into:
- UI Layer
- KanBan Board (4 columns, draggable cards)
- Link Collection Panel (list of URLs, drag-reorder)
- Theme Toggle (Light/Dark via Bootswatch)
- Application Logic
- Drag & drop handlers
- Data model in JS
- Import/Export routines (JSON ↔ file system)
- Persistence Layer
- browser.localStorage API
c. External resources
- Bootswatch CSS CDN (theme styles)
- Browser Spellcheck subsystem
d. File system
- JSON file export/import

##### Relationships and interactions
- On page load: index.html → Browser parses HTML/CSS/JS → UI renders.
- User actions (e.g., drag card, add link) → JS logic updates in-memory data model → JS writes to localStorage.
- Export action → JS reads from localStorage → prompts user to download JSON file.
- Import action → user selects JSON file → JS parses it → overwrites in-memory model + localStorage → UI re-renders.
- Theme toggle → loads CSS from Bootswatch CDN → updates UI styles.
- Spellcheck → provided automatically by browser on text inputs.

##### Architectural patterns / design principles
- Single-page application (SPA) pattern without server side.
- Separation of concerns (logically) into UI, logic, persistence—even though in one file.
- Progressive enhancement: relies solely on browser APIs (no server).
- Data stored locally; each HTML file instance is its own isolated “project.”

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Browser Runtime
    Browser["Browser (runtime)"]:::external

    %% SPA Application Container
    subgraph "SPA Application (index.html)"
        direction TB
        SPA["index.html"]:::external

        subgraph "UI Layer"
            direction TB
            KanBan["KanBan Board"]:::UI
            Links["Link Collection Panel"]:::UI
            Theme["Theme Toggle"]:::UI
        end

        subgraph "Application Logic"
            direction TB
            Drag["Drag & Drop Handlers"]:::logic
            Model["Data Model (JS)"]:::logic
            IOR["Import/Export Routines"]:::logic
        end

        subgraph "Persistence Layer"
            direction TB
            Storage["localStorage (Browser)"]:::storage
        end
    end

    %% External Resources
    CDN["Bootswatch CSS CDN"]:::external
    Spell["Browser Spellcheck"]:::external
    FS["File System (JSON)"]:::external
    Doc["Project Documentation & Usage (README.md)"]:::external

    %% Relationships
    Browser -->|"loads & parses"| SPA
    KanBan -->|"user events"| Drag
    Links -->|"user events"| Drag
    Theme -->|"user events"| IOR
    Drag -->|"updateState()"| Model
    Model -->|"saveState()"| Storage
    Storage -->|"loadState()"| Model
    IOR -->|"read/write JSON"| FS
    IOR -->|"sync with"| Storage
    Theme -->|"fetch CSS"| CDN
    Spell -->|"spellcheck"| KanBan
    Spell -->|"spellcheck"| Links
    SPA -->|"documentation"| Doc

    %% Click Events
    click SPA "https://github.com/kevanmacgee/project-notes/blob/main/index.html"
    click Doc "https://github.com/kevanmacgee/project-notes/blob/main/README.md"

    %% Styles
    classDef UI fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef logic fill:#FFA500,stroke:#000,stroke-width:1px
    classDef storage fill:#90EE90,stroke:#000,stroke-width:1px
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:1px
```
