# nirmal-mekala/siteify architecture

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

- Interactive diagram: https://gitdiagram.com/nirmal-mekala/siteify
- Repository: https://github.com/nirmal-mekala/siteify

## Overview

Siteify turns an existing HTML page into a themed microsite by inserting a Preact header above its main content. The header provides a configurable link and dark-mode and optional alternate-theme toggles; changes update document classes and persist selections. CSS supplies the base themes, while a documented inline bootstrap initializes theme classes before the app loads. The runtime entry and component calls are shown in source; CSS internals and the inline bootstrap are documented but not present as repository source files in the excerpts.

Main entry points: [`src/components/header/index.tsx`](https://github.com/nirmal-mekala/siteify/blob/main/src/components/header/index.tsx) (Header), [`src/main.tsx`](https://github.com/nirmal-mekala/siteify/blob/main/src/main.tsx) (Runtime Entry), [`src/app.tsx`](https://github.com/nirmal-mekala/siteify/blob/main/src/app.tsx) (App), [`src/components/headerLink/index.tsx`](https://github.com/nirmal-mekala/siteify/blob/main/src/components/headerLink/index.tsx) (Header Link)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Page Runtime"]
  node_entry["Runtime Entry<br/>[main.tsx]"]
  node_app["App<br/>[app.tsx]"]
  node_preferences[("Theme Preferences")]
  node_bootstrap["Theme Bootstrap"]
end

subgraph group_header["Header Controls"]
  node_header["Header<br/>[index.tsx]"]
  node_headerlink["Header Link<br/>[index.tsx]"]
  node_linktext["Link Text<br/>[index.tsx]"]
  node_toggle["Toggle Control<br/>[index.tsx]"]
  node_headerutils["Theme Helpers<br/>[utils.ts]"]
end

subgraph group_styling["Themes and Styles"]
  node_basecss["Base Styles<br/>[index.css]"]
  node_themes["Theme Styles"]
end

node_site(("Microsite Page"))
node_browser["Browser Document"]
node_config["Site Configuration"]

node_site -->|"loads bundle"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"renders"| node_header
node_entry -->|"inserts header"| node_browser
node_entry -->|"imports styles"| node_basecss
node_header -->|"renders"| node_headerlink
node_headerlink -->|"renders"| node_linktext
node_header -->|"renders"| node_toggle
node_header -->|"calls helpers"| node_headerutils
node_header -->|"reads configuration"| node_bootstrap
node_header -->|"persists selections"| node_preferences
node_bootstrap -->|"reads selections"| node_preferences
node_bootstrap -->|"sets theme classes"| node_browser
node_headerutils -->|"updates classes"| node_browser
node_header -->|"unhides page"| node_browser
node_config -->|"configures controls"| node_header
node_themes -->|"styles theme classes"| node_browser

click node_entry "https://github.com/nirmal-mekala/siteify/blob/main/src/main.tsx"
click node_app "https://github.com/nirmal-mekala/siteify/blob/main/src/app.tsx"
click node_header "https://github.com/nirmal-mekala/siteify/blob/main/src/components/header/index.tsx"
click node_headerlink "https://github.com/nirmal-mekala/siteify/blob/main/src/components/headerLink/index.tsx"
click node_linktext "https://github.com/nirmal-mekala/siteify/blob/main/src/components/headerLinkText/index.tsx"
click node_toggle "https://github.com/nirmal-mekala/siteify/blob/main/src/components/toggle/index.tsx"
click node_headerutils "https://github.com/nirmal-mekala/siteify/blob/main/src/components/header/utils.ts"
click node_basecss "https://github.com/nirmal-mekala/siteify/blob/main/src/index.css"
click node_themes "https://github.com/nirmal-mekala/siteify/tree/main/src/styles"

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_entry,node_app,node_preferences,node_bootstrap,node_browser toneBlue
class node_header,node_headerlink,node_linktext,node_toggle,node_headerutils toneAmber
class node_basecss,node_themes toneMint
class node_site,node_config toneIndigo
```

## Components

### Page Runtime

- [Runtime Entry](https://github.com/nirmal-mekala/siteify/blob/main/src/main.tsx): `src/main.tsx`
- [App](https://github.com/nirmal-mekala/siteify/blob/main/src/app.tsx): `src/app.tsx`
- **Theme Preferences**
- **Theme Bootstrap**

### Header Controls

- [Header](https://github.com/nirmal-mekala/siteify/blob/main/src/components/header/index.tsx): `src/components/header/index.tsx`
- [Header Link](https://github.com/nirmal-mekala/siteify/blob/main/src/components/headerLink/index.tsx): `src/components/headerLink/index.tsx`
- [Link Text](https://github.com/nirmal-mekala/siteify/blob/main/src/components/headerLinkText/index.tsx): `src/components/headerLinkText/index.tsx`
- [Toggle Control](https://github.com/nirmal-mekala/siteify/blob/main/src/components/toggle/index.tsx): `src/components/toggle/index.tsx`
- [Theme Helpers](https://github.com/nirmal-mekala/siteify/blob/main/src/components/header/utils.ts): `src/components/header/utils.ts`

### Themes and Styles

- [Base Styles](https://github.com/nirmal-mekala/siteify/blob/main/src/index.css): `src/index.css`
- [Theme Styles](https://github.com/nirmal-mekala/siteify/tree/main/src/styles): `src/styles`

### Other components

- **Microsite Page**
- **Browser Document**
- **Site Configuration**

## Connections

- Microsite Page → Runtime Entry: loads bundle (evidence: `README.md`)
- Runtime Entry → App: renders (evidence: `src/main.tsx`)
- App → Header: renders (evidence: `src/app.tsx`)
- Runtime Entry → Browser Document: inserts header (evidence: `src/main.tsx`)
- Runtime Entry → Base Styles: imports styles (evidence: `src/main.tsx`)
- Header → Header Link: renders (evidence: `src/components/header/index.tsx`)
- Header Link → Link Text: renders (evidence: `src/components/headerLink/index.tsx`)
- Header → Toggle Control: renders (evidence: `src/components/header/index.tsx`)
- Header → Theme Helpers: calls helpers (evidence: `src/components/header/index.tsx`)
- Header → Theme Bootstrap: reads configuration (evidence: `src/components/header/index.tsx`)
- Header → Theme Preferences: persists selections
- Theme Bootstrap → Theme Preferences: reads selections (evidence: `README.md`)
- Theme Bootstrap → Browser Document: sets theme classes (evidence: `README.md`)
- Theme Helpers → Browser Document: updates classes (evidence: `src/components/header/utils.ts`)
- Header → Browser Document: unhides page (evidence: `src/components/header/index.tsx`)
- Site Configuration → Header: configures controls (evidence: `README.md`)
- Theme Styles → Browser Document: styles theme classes (evidence: `README.md`)
