# xunhaii/webstartpage architecture

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

- Interactive diagram: https://gitdiagram.com/xunhaii/webstartpage
- Repository: https://github.com/xunhaii/webstartpage

## Overview

Xunhaii is a dependency-free static browser start page. Its main workflow is configuring search engines or shortcuts, then using them to search or open sites; preferences and recent searches persist locally. The README also documents themes, custom backgrounds, configuration transfer, and a matching 404 page. The main script is only partially excerpted, so feature-level relationships rely on README statements; internal call paths not shown are omitted.

Main entry points: [`index.html`](https://github.com/xunhaii/webstartpage/blob/master/index.html) (Start page), [`js/main.js`](https://github.com/xunhaii/webstartpage/blob/master/js/main.js) (Browser storage), [`404.html`](https://github.com/xunhaii/webstartpage/blob/master/404.html) (404 page), [`js/404.js`](https://github.com/xunhaii/webstartpage/blob/master/js/404.js) (404 behavior)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_start["Start page"]
  node_home["Start page<br/>[index.html]"]
  node_search["Search engines<br/>[main.js]"]
  node_shortcuts["Site shortcuts<br/>[main.js]"]
  node_history["Search history<br/>[main.js]"]
  node_mainstyle["Main styling<br/>[main.css]"]
end

subgraph group_preferences["Appearance and settings"]
  node_theme["Theme settings<br/>[main.js]"]
  node_background["Background settings<br/>[main.js]"]
  node_blur["Blur toggle<br/>[main.js]"]
  node_transfer["Config transfer<br/>[main.js]"]
end

subgraph group_persistence["Local persistence"]
  node_local[("Browser storage<br/>[main.js]")]
  node_indexed[("IndexedDB images<br/>[main.js]")]
end

subgraph group_error["404 experience"]
  node_notfound["404 page<br/>[404.html]"]
  node_notfoundjs["404 behavior<br/>[404.js]"]
  node_errorstyle["404 styling<br/>[404.css]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_home
node_home -->|"offers"| node_search
node_home -->|"offers"| node_shortcuts
node_home -->|"records searches"| node_history
node_search -->|"stores settings"| node_local
node_shortcuts -->|"stores list"| node_local
node_history -->|"stores records"| node_local
node_home -->|"offers"| node_theme
node_home -->|"offers"| node_background
node_home -->|"offers"| node_blur
node_home -->|"offers"| node_transfer
node_theme -->|"saves preference"| node_local
node_blur -->|"saves state"| node_local
node_background -->|"stores uploads"| node_indexed
node_transfer -->|"exports and imports"| node_local
node_transfer -->|"transfers images"| node_indexed
node_visitor -->|"lands on"| node_notfound
node_notfound -->|"runs"| node_notfoundjs
node_notfoundjs -->|"reads preferences"| node_local
node_notfoundjs -->|"reads background"| node_indexed
node_home -.->|"uses styles"| node_mainstyle
node_notfound -.->|"uses styles"| node_errorstyle

click node_home "https://github.com/xunhaii/webstartpage/blob/master/index.html"
click node_search "https://github.com/xunhaii/webstartpage/blob/master/js/main.js"
click node_shortcuts "https://github.com/xunhaii/webstartpage/blob/master/js/main.js"
click node_history "https://github.com/xunhaii/webstartpage/blob/master/js/main.js"
click node_theme "https://github.com/xunhaii/webstartpage/blob/master/js/main.js"
click node_background "https://github.com/xunhaii/webstartpage/blob/master/js/main.js"
click node_blur "https://github.com/xunhaii/webstartpage/blob/master/js/main.js"
click node_transfer "https://github.com/xunhaii/webstartpage/blob/master/js/main.js"
click node_local "https://github.com/xunhaii/webstartpage/blob/master/js/main.js"
click node_indexed "https://github.com/xunhaii/webstartpage/blob/master/js/main.js"
click node_notfound "https://github.com/xunhaii/webstartpage/blob/master/404.html"
click node_notfoundjs "https://github.com/xunhaii/webstartpage/blob/master/js/404.js"
click node_mainstyle "https://github.com/xunhaii/webstartpage/blob/master/css/main.css"
click node_errorstyle "https://github.com/xunhaii/webstartpage/blob/master/css/404.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_home,node_search,node_shortcuts,node_history,node_mainstyle toneBlue
class node_theme,node_background,node_blur,node_transfer toneAmber
class node_local,node_indexed toneMint
class node_notfound,node_notfoundjs,node_errorstyle toneRose
class node_visitor toneIndigo
```

## Components

### Start page

- [Start page](https://github.com/xunhaii/webstartpage/blob/master/index.html): `index.html`
- [Search engines](https://github.com/xunhaii/webstartpage/blob/master/js/main.js): `js/main.js`
- [Site shortcuts](https://github.com/xunhaii/webstartpage/blob/master/js/main.js): `js/main.js`
- [Search history](https://github.com/xunhaii/webstartpage/blob/master/js/main.js): `js/main.js`
- [Main styling](https://github.com/xunhaii/webstartpage/blob/master/css/main.css): `css/main.css`

### Appearance and settings

- [Theme settings](https://github.com/xunhaii/webstartpage/blob/master/js/main.js): `js/main.js`
- [Background settings](https://github.com/xunhaii/webstartpage/blob/master/js/main.js): `js/main.js`
- [Blur toggle](https://github.com/xunhaii/webstartpage/blob/master/js/main.js): `js/main.js`
- [Config transfer](https://github.com/xunhaii/webstartpage/blob/master/js/main.js): `js/main.js`

### Local persistence

- [Browser storage](https://github.com/xunhaii/webstartpage/blob/master/js/main.js): `js/main.js`
- [IndexedDB images](https://github.com/xunhaii/webstartpage/blob/master/js/main.js): `js/main.js`

### 404 experience

- [404 page](https://github.com/xunhaii/webstartpage/blob/master/404.html): `404.html`
- [404 behavior](https://github.com/xunhaii/webstartpage/blob/master/js/404.js): `js/404.js`
- [404 styling](https://github.com/xunhaii/webstartpage/blob/master/css/404.css): `css/404.css`

### Other components

- **Visitor**

## Connections

- Visitor → Start page: opens (evidence: `README.md`)
- Start page → Search engines: offers (evidence: `README.md`)
- Start page → Site shortcuts: offers (evidence: `README.md`)
- Start page → Search history: records searches (evidence: `README.md`)
- Search engines → Browser storage: stores settings (evidence: `README.md`)
- Site shortcuts → Browser storage: stores list (evidence: `README.md`)
- Search history → Browser storage: stores records (evidence: `README.md`)
- Start page → Theme settings: offers (evidence: `README.md`)
- Start page → Background settings: offers (evidence: `README.md`)
- Start page → Blur toggle: offers (evidence: `README.md`)
- Start page → Config transfer: offers (evidence: `README.md`)
- Theme settings → Browser storage: saves preference (evidence: `README.md`)
- Blur toggle → Browser storage: saves state (evidence: `README.md`)
- Background settings → IndexedDB images: stores uploads (evidence: `README.md`)
- Config transfer → Browser storage: exports and imports (evidence: `README.md`)
- Config transfer → IndexedDB images: transfers images (evidence: `README.md`)
- Visitor → 404 page: lands on (evidence: `README.md`)
- 404 page → 404 behavior: runs (evidence: `README.md`)
- 404 behavior → Browser storage: reads preferences (evidence: `js/404.js`)
- 404 behavior → IndexedDB images: reads background (evidence: `js/404.js`)
- Start page → Main styling: uses styles
- 404 page → 404 styling: uses styles
