# tractorjuice/onlinewardleymaps architecture

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

- Interactive diagram: https://gitdiagram.com/tractorjuice/onlinewardleymaps
- Repository: https://github.com/tractorjuice/onlinewardleymaps

## Overview

##### Project type and purpose
- This is primarily a client-side, React-based single-page application (SPA) called OnlineWardleyMaps. It parses and renders Wardley Maps in the browser, and is also packaged as a VSCode extension. In addition, it includes a Jekyll-generated documentation site under `docs/`.
- The README confirms that this is the source for www.OnlineWardleyMaps.com, supports local development (`yarn start`), production builds (`yarn build`), Storybook demos, tests, and packaging for VSCode (`yarn package`).

##### File structure
Top-level partitions:
- Config & tooling
– `.github/workflows/main.yml`: CI/CD pipeline
– `babel.config.js`, `config-overrides.js`, `jest.config.js`: compilation and test setup
– `.prettierrc.json`, `.eslintrc.json`: linting & formatting
- Documentation site (`docs/`)
– Jekyll layout, pages, posts, assets → statically hosted via GitHub Pages or CDN
- Public assets (`public/`)
– `index.html`, `manifest.json`, `robots.txt` → entry point for the React SPA
– `mode-owm.js`: optional OpenWeatherMap integration
- React application (`src/`)
– UI components under `src/components/` (editor, map, symbols, actions, contexts)
– Conversion engine under `src/conversion/` (extraction strategies, `Converter.js`, migrations)
– Linking strategies under `src/linkStrategies/`
– Core renderers under `src/MapElements.js`, `src/MetaPositioner.js`
– Constants (`src/constants/`), styles (`src/styles.scss`), entry point (`src/index.js`)
– Tests under `src/__tests__/` and component snapshots
- VSCode extension package (`wmlandscape/`)
– Rollup config (`wmlandscape/rollup.config.js`)
– Its own `package.json`, Babel config, and `src/index.js` for extension entry

##### README for additional insights
- Confirms tech stack: Node.js + Yarn, React, Storybook for component demos, Jest for tests.
- No backend server – purely front-end & static hosting.
- CI/CD is likely via GitHub Actions, deploying both the SPA and Jekyll docs.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Development & CI/CD
    subgraph "Development & CI/CD"
        Dev["Developer"]:::dev
        CICD["CI/CD Pipeline"]:::ci
    end
    click CICD "https://github.com/tractorjuice/onlinewardleymaps/blob/master/.github/workflows/main.yml"
    Dev --> CICD

    %% Build & Packaging
    subgraph "Build & Packaging"
        ReactBuild["React SPA Build"]:::build
        Storybook["Storybook"]:::build
        RollupExt["VSCode Extension Build"]:::build
    end
    CICD --> ReactBuild
    CICD --> Storybook
    CICD --> RollupExt

    %% Extension Package Config
    subgraph "Extension Package"
        WSRollup["rollup.config.js"]:::build
        WSPkg["package.json"]:::build
        WSBabel["babel.config.js"]:::build
        ExtEntry["Extension Entry Point"]:::ext
    end
    click WSRollup "https://github.com/tractorjuice/onlinewardleymaps/blob/master/wmlandscape/rollup.config.js"
    click WSPkg "https://github.com/tractorjuice/onlinewardleymaps/blob/master/wmlandscape/package.json"
    click WSBabel "https://github.com/tractorjuice/onlinewardleymaps/blob/master/wmlandscape/babel.config.js"
    click ExtEntry "https://github.com/tractorjuice/onlinewardleymaps/blob/master/wmlandscape/src/index.js"
    RollupExt --> WSRollup
    RollupExt --> WSPkg
    RollupExt --> WSBabel
    RollupExt --> ExtEntry

    %% Deployment Targets
    subgraph "Deployment Targets"
        SPAHost["Static Host/CDN (SPA)"]:::deploy
        DocsHost["Jekyll Docs Host"]:::deploy
        VSMarket["VSCode Marketplace"]:::deploy
    end
    ReactBuild --> SPAHost
    Storybook --> SPAHost
    CICD --> DocsHost
    RollupExt --> VSMarket

    %% Runtime - SPA
    subgraph "SPA Runtime (Browser)"
        UIComp["UI Components"]:::runtime
        ConvEng["Conversion Engine"]:::runtime
        ExtractStr["Extraction Strategies"]:::runtime
        LinkEng["Linking Engine"]:::runtime
        LinkStr["Link Strategy Modules"]:::runtime
        Layout["Layout & Positioning"]:::runtime
        Render["Rendering Layer"]:::runtime
        ExtAPI["OpenWeatherMap API"]:::external
        subgraph "Supporting Modules"
            PosUpdaters["Position Updaters"]:::runtime
            Constants["Constants"]:::runtime
            Styles["Styles"]:::runtime
            Tests["Tests"]:::runtime
        end
    end
    click UIComp "https://github.com/tractorjuice/onlinewardleymaps/tree/master/src/components/"
    click ConvEng "https://github.com/tractorjuice/onlinewardleymaps/blob/master/src/conversion/Converter.js"
    click ExtractStr "https://github.com/tractorjuice/onlinewardleymaps/tree/master/src/conversion/"
    click LinkEng "https://github.com/tractorjuice/onlinewardleymaps/blob/master/src/linkStrategies/LinksBuilder.js"
    click LinkStr "https://github.com/tractorjuice/onlinewardleymaps/tree/master/src/linkStrategies/"
    click Layout "https://github.com/tractorjuice/onlinewardleymaps/blob/master/src/MapElements.js"
    click Layout "https://github.com/tractorjuice/onlinewardleymaps/blob/master/src/MetaPositioner.js"
    click PosUpdaters "https://github.com/tractorjuice/onlinewardleymaps/tree/master/src/components/map/positionUpdaters/"
    click Constants "https://github.com/tractorjuice/onlinewardleymaps/tree/master/src/constants/"
    click Styles "https://github.com/tractorjuice/onlinewardleymaps/blob/master/src/styles.scss"
    click Tests "https://github.com/tractorjuice/onlinewardleymaps/tree/master/src/__tests__/"

    SPAHost -->|"Loads"| UIComp
    UIComp -->|"User Input"| ConvEng
    ConvEng -->|"uses"| ExtractStr
    ExtractStr --> ConvEng
    ConvEng -->|"model"| LinkEng
    LinkEng -->|"uses"| LinkStr
    LinkEng -->|"graph"| Layout
    Layout -->|"positions"| PosUpdaters
    Layout --> Render
    Render -->|"draw"| UIComp
    UIComp -->|"optional call"| ExtAPI
    UIComp --> UIComp

    %% VSCode Extension Runtime
    ExtEntry --> ConvEng
    ExtEntry --> UIComp

    %% Styles
    classDef dev fill:#D6EAF8,stroke:#1F618D
    classDef ci fill:#D2B4DE,stroke:#6C3483
    classDef build fill:#EBDEF0,stroke:#7D3C98
    classDef deploy fill:#FDEDEC,stroke:#C0392B
    classDef runtime fill:#D5F5E3,stroke:#27AE60
    classDef external fill:#FCF3CF,stroke:#B7950B
    classDef ext fill:#FADBD8,stroke:#922B21
```
