# programmerkr/buildmymd architecture

> Architecture diagram of the GitHub repository programmerkr/buildmymd, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/programmerkr/buildmymd
- Repository: https://github.com/programmerkr/buildmymd

## Overview

#### Purpose and Runtime
BuildMyMD is a client-side Markdown/README authoring application. It provides templates, section/tool insertion, badge generation, live rendered preview, and local persistence. The runtime is React 18 + TypeScript, built and served through Vite; styling is custom CSS. There is no backend, cloud sync, or authentication implementation visible in this repository.

Entry flow: `index.html` loads `index.tsx`, which mounts the React application rooted at `App.tsx`.

#### Application Shell and Workspace Layout
`App.tsx` composes the primary authoring workspace: navigation/sidebar controls, editor, preview, toolbar actions, settings, and tool surfaces. Layout-specific UI is divided across:
- `App.tsx`
- `components/SidebarLeft.tsx`
- `components/Toolbar.tsx`
- `components/ToolPanel.tsx`

These components are the control boundary between user actions and centralized document state.

#### Central Editor State
The Zustand store is the authoritative client-side state layer for Markdown content and editor-related UI/document actions:
- `store/useEditorStore.ts`
- `types.ts`

Editor, templates, tools, and settings should update document state through this store rather than directly coordinating with the preview. Persistent-state behavior described by the README is expected to be implemented at this boundary, likely via browser-local storage rather than an external service.

#### Authoring and Template Insertion
The editing surface owns direct Markdown input and selection-aware changes:
- `components/Editor.tsx`
- `lib/templates.ts`
- `components/SettingsPanel.tsx`

`lib/templates.ts` supplies predefined README structures. Template selection and section/tool output flow into the editor/store as Markdown text, making Markdown the shared interchange format between all generation features and rendering.

#### Tooling and Badge Generation
The tool panel contains authoring accelerators such as text transforms, snippets, tables, and badge workflows:
- `components/ToolPanel.tsx`
- `lib/badgeUtils.ts`
- `components/PreviewToolbar.tsx`

Badge utilities generate Shields.io-compatible badge Markdown/URLs. Shields.io is an external content service consumed through generated image links; it is not a repository-hosted API integration.

#### Rendering and Preview Boundary
Markdown is transformed into preview-ready HTML or React-renderable output by:
- `lib/markdownRenderer.ts`
- `components/Preview.tsx`
- `components/PreviewToolbar.tsx`

The preview consumes the same Markdown state produced by the editor and tools. This creates a one-way display pipeline: user/template/tool action → store Markdown → renderer → preview. Preview toolbar actions are the natural boundary for display controls and export-oriented behavior.

#### Presentation and Deployment
Visual design is primarily centralized in:
- `index.css`
- `components/Preview.tsx`
- `components/Editor.tsx`

Vite configuration and npm dependencies define local build/dev execution:
- `vite.config.ts`
- `package.json`

The README identifies Netlify as the hosted deployment target, but no deployment configuration or server-side infrastructure appears in the file tree.

Main entry points: [`App.tsx`](https://github.com/programmerkr/buildmymd/blob/main/App.tsx) (Application shell), [`store/useEditorStore.ts`](https://github.com/programmerkr/buildmymd/blob/main/store/useEditorStore.ts) (Editor store), [`vite.config.ts`](https://github.com/programmerkr/buildmymd/blob/main/vite.config.ts) (Vite build and dev), [`components/ToolPanel.tsx`](https://github.com/programmerkr/buildmymd/blob/main/components/ToolPanel.tsx) (Tool panel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Client Runtime"]
  node_package["npm dependencies<br/>package manifest<br/>[package.json]"]
  node_vite{{"Vite build and dev<br/>build runtime<br/>[vite.config.ts]"}}
  node_html["HTML entry<br/>browser entry<br/>[index.html]"]
  node_bootstrap["React bootstrap<br/>React entry<br/>[index.tsx]"]
  node_styles["Global styling<br/>CSS presentation<br/>[index.css]"]
end

subgraph group_workspace["Authoring Workspace"]
  node_app["Application shell<br/>React composition<br/>[App.tsx]"]
  node_sidebar["Navigation sidebar<br/>workspace controls<br/>[SidebarLeft.tsx]"]
  node_toolbar["Authoring toolbar<br/>workspace controls<br/>[Toolbar.tsx]"]
  node_editor["Markdown editor<br/>editing surface<br/>[Editor.tsx]"]
  node_settings["Settings panel<br/>document controls<br/>[SettingsPanel.tsx]"]
  node_tools["Tool panel<br/>authoring tools<br/>[ToolPanel.tsx]"]
end

subgraph group_state["Document State"]
  node_store[("Editor store<br/>Zustand state<br/>[useEditorStore.ts]")]
  node_types["Editor types<br/>TypeScript contracts<br/>[types.ts]"]
  node_templates["README templates<br/>Markdown templates<br/>[templates.ts]"]
  node_badges["Badge generator<br/>Markdown generator<br/>[badgeUtils.ts]"]
end

subgraph group_preview["Preview Pipeline"]
  node_renderer["Markdown renderer<br/>render transform"]
  node_preview["Live preview<br/>rendered display<br/>[Preview.tsx]"]
  node_preview_toolbar["Preview toolbar<br/>display and export controls<br/>[PreviewToolbar.tsx]"]
end

node_shields{{"Shields.io<br/>external badge service"}}
node_netlify{{"Netlify hosting<br/>deployment target"}}

node_package -->|"provides tooling"| node_vite
node_vite -->|"serves"| node_html
node_html -->|"loads"| node_bootstrap
node_bootstrap -->|"mounts"| node_app
node_app -->|"composes"| node_sidebar
node_app -->|"composes"| node_toolbar
node_app -->|"composes"| node_editor
node_app -->|"composes"| node_tools
node_app -->|"composes"| node_settings
node_app -->|"composes"| node_preview
node_app -->|"composes"| node_preview_toolbar
node_editor -->|"reads and writes Markdown"| node_store
node_sidebar -->|"dispatches document actions"| node_store
node_toolbar -->|"dispatches document actions"| node_store
node_settings -->|"updates settings"| node_store
node_templates -->|"inserts Markdown"| node_store
node_tools -->|"inserts generated Markdown"| node_store
node_badges -->|"supplies badge output"| node_tools
node_badges -.->|"generates links for"| node_shields
node_types -->|"defines state contracts"| node_store
node_store -->|"supplies Markdown"| node_renderer
node_renderer -->|"renders output"| node_preview
node_preview_toolbar -->|"controls display and export"| node_preview
node_styles -->|"styles workspace"| node_app
node_netlify -.->|"hosts built client"| node_vite

click node_package "https://github.com/programmerkr/buildmymd/blob/main/package.json"
click node_vite "https://github.com/programmerkr/buildmymd/blob/main/vite.config.ts"
click node_html "https://github.com/programmerkr/buildmymd/blob/main/index.html"
click node_bootstrap "https://github.com/programmerkr/buildmymd/blob/main/index.tsx"
click node_app "https://github.com/programmerkr/buildmymd/blob/main/App.tsx"
click node_sidebar "https://github.com/programmerkr/buildmymd/blob/main/components/SidebarLeft.tsx"
click node_toolbar "https://github.com/programmerkr/buildmymd/blob/main/components/Toolbar.tsx"
click node_editor "https://github.com/programmerkr/buildmymd/blob/main/components/Editor.tsx"
click node_settings "https://github.com/programmerkr/buildmymd/blob/main/components/SettingsPanel.tsx"
click node_tools "https://github.com/programmerkr/buildmymd/blob/main/components/ToolPanel.tsx"
click node_store "https://github.com/programmerkr/buildmymd/blob/main/store/useEditorStore.ts"
click node_types "https://github.com/programmerkr/buildmymd/blob/main/types.ts"
click node_templates "https://github.com/programmerkr/buildmymd/blob/main/lib/templates.ts"
click node_badges "https://github.com/programmerkr/buildmymd/blob/main/lib/badgeUtils.ts"
click node_renderer "https://github.com/programmerkr/buildmymd/blob/main/lib/markdownRenderer.ts"
click node_preview "https://github.com/programmerkr/buildmymd/blob/main/components/Preview.tsx"
click node_preview_toolbar "https://github.com/programmerkr/buildmymd/blob/main/components/PreviewToolbar.tsx"
click node_styles "https://github.com/programmerkr/buildmymd/blob/main/index.css"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_package,node_vite,node_html,node_bootstrap,node_styles toneBlue
class node_app,node_sidebar,node_toolbar,node_editor,node_settings,node_tools toneAmber
class node_store,node_types,node_templates,node_badges toneMint
class node_renderer,node_preview,node_preview_toolbar toneRose
class node_shields,node_netlify toneNeutral
```

## Components

### Client Runtime

- [npm dependencies](https://github.com/programmerkr/buildmymd/blob/main/package.json): package manifest · `package.json`
- [Vite build and dev](https://github.com/programmerkr/buildmymd/blob/main/vite.config.ts): build runtime · `vite.config.ts`
- [HTML entry](https://github.com/programmerkr/buildmymd/blob/main/index.html): browser entry · `index.html`
- [React bootstrap](https://github.com/programmerkr/buildmymd/blob/main/index.tsx): React entry · `index.tsx`
- [Global styling](https://github.com/programmerkr/buildmymd/blob/main/index.css): CSS presentation · `index.css`

### Authoring Workspace

- [Application shell](https://github.com/programmerkr/buildmymd/blob/main/App.tsx): React composition · `App.tsx`
- [Navigation sidebar](https://github.com/programmerkr/buildmymd/blob/main/components/SidebarLeft.tsx): workspace controls · `components/SidebarLeft.tsx`
- [Authoring toolbar](https://github.com/programmerkr/buildmymd/blob/main/components/Toolbar.tsx): workspace controls · `components/Toolbar.tsx`
- [Markdown editor](https://github.com/programmerkr/buildmymd/blob/main/components/Editor.tsx): editing surface · Owns direct input and selection-aware edits. · `components/Editor.tsx`
- [Settings panel](https://github.com/programmerkr/buildmymd/blob/main/components/SettingsPanel.tsx): document controls · `components/SettingsPanel.tsx`
- [Tool panel](https://github.com/programmerkr/buildmymd/blob/main/components/ToolPanel.tsx): authoring tools · Provides transforms, snippets, tables, and badge workflows. · `components/ToolPanel.tsx`

### Document State

- [Editor store](https://github.com/programmerkr/buildmymd/blob/main/store/useEditorStore.ts): Zustand state · Authoritative Markdown and editor UI state, including local persistence. · `store/useEditorStore.ts`
- [Editor types](https://github.com/programmerkr/buildmymd/blob/main/types.ts): TypeScript contracts · `types.ts`
- [README templates](https://github.com/programmerkr/buildmymd/blob/main/lib/templates.ts): Markdown templates · `lib/templates.ts`
- [Badge generator](https://github.com/programmerkr/buildmymd/blob/main/lib/badgeUtils.ts): Markdown generator · Builds Shields.io-compatible badge Markdown and URLs. · `lib/badgeUtils.ts`

### Preview Pipeline

- [Markdown renderer](https://github.com/programmerkr/buildmymd/blob/main/lib/markdownRenderer.ts): render transform · Converts shared Markdown state into preview-ready output. · `lib/markdownRenderer.ts`
- [Live preview](https://github.com/programmerkr/buildmymd/blob/main/components/Preview.tsx): rendered display · `components/Preview.tsx`
- [Preview toolbar](https://github.com/programmerkr/buildmymd/blob/main/components/PreviewToolbar.tsx): display and export controls · `components/PreviewToolbar.tsx`

### Other components

- **Shields.io**: external badge service · Generated image links resolve through this external service.
- **Netlify hosting**: deployment target · Identified as the hosting target; no deployment configuration is present.

## Connections

- npm dependencies → Vite build and dev: provides tooling
- Vite build and dev → HTML entry: serves
- HTML entry → React bootstrap: loads
- React bootstrap → Application shell: mounts
- Application shell → Navigation sidebar: composes
- Application shell → Authoring toolbar: composes
- Application shell → Markdown editor: composes
- Application shell → Tool panel: composes
- Application shell → Settings panel: composes
- Application shell → Live preview: composes
- Application shell → Preview toolbar: composes
- Markdown editor → Editor store: reads and writes Markdown
- Navigation sidebar → Editor store: dispatches document actions
- Authoring toolbar → Editor store: dispatches document actions
- Settings panel → Editor store: updates settings
- README templates → Editor store: inserts Markdown
- Tool panel → Editor store: inserts generated Markdown
- Badge generator → Tool panel: supplies badge output
- Badge generator → Shields.io: generates links for
- Editor types → Editor store: defines state contracts
- Editor store → Markdown renderer: supplies Markdown
- Markdown renderer → Live preview: renders output
- Preview toolbar → Live preview: controls display and export
- Global styling → Application shell: styles workspace
- Netlify hosting → Vite build and dev: hosts built client
