# glanceapp/glance architecture

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

- Interactive diagram: https://gitdiagram.com/glanceapp/glance
- Repository: https://github.com/glanceapp/glance

## Overview

Glance is a configurable web dashboard: a user opens pages defined in YAML, the server builds a page from configured widgets and theme settings, and browser-side JavaScript renders and enhances the dashboard. Widget families cover feeds, community and video content, weather and markets, and infrastructure; some widgets retrieve data from external services. The graph preserves those documented capabilities, but most backend routing and widget-dispatch connections cannot be verified from the excerpts, so those links are marked unverified. The sampled server-stats implementation does show its local sysinfo dependency.

Main entry points: [`internal/glance/glance.go`](https://github.com/glanceapp/glance/blob/main/internal/glance/glance.go) (HTTP application), [`internal/glance/widget.go`](https://github.com/glanceapp/glance/blob/main/internal/glance/widget.go) (Widget runtime), [`internal/glance/static/js/page.js`](https://github.com/glanceapp/glance/blob/main/internal/glance/static/js/page.js) (Page interactions), [`internal/glance/static/js/calendar.js`](https://github.com/glanceapp/glance/blob/main/internal/glance/static/js/calendar.js) (Calendar UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Server runtime"]
  node_entry["Program entry<br/>[main.go]"]
  node_server["HTTP application<br/>[glance.go]"]
  node_configuration["YAML configuration<br/>[config.go]"]
  node_authentication["Authentication<br/>[auth.go]"]
end

subgraph group_presentation["Dashboard presentation"]
  node_page_templates["Page templates<br/>[templates.go]"]
  node_themes["Themes<br/>[theme.go]"]
  node_widget_runtime["Widget runtime<br/>[widget.go]"]
end

subgraph group_content["Content widgets"]
  node_feed_widgets["Feeds and communities<br/>[widget-rss.go]"]
  node_video_widgets["Video and streaming<br/>[widget-videos.go]"]
  node_search_widgets["Search and links<br/>[widget-search.go]"]
end

subgraph group_services["Data widgets"]
  node_weather_widgets["Weather and calendar<br/>[widget-weather.go]"]
  node_market_widgets["Markets and releases<br/>[widget-markets.go]"]
  node_infra_widgets["Infrastructure status"]
  node_sysinfo["System information<br/>[sysinfo.go]"]
end

subgraph group_browser["Browser interaction"]
  node_browser_page["Page interactions<br/>[page.js]"]
  node_browser_calendar["Calendar UI<br/>[calendar.js]"]
  node_browser_todo["Todo UI<br/>[todo.js]"]
  node_browser_popover["Popover UI<br/>[popover.js]"]
  node_browser_masonry["Masonry layout<br/>[masonry.js]"]
  node_browser_templates["DOM helpers<br/>[templating.js]"]
  node_browser_animations["Animations<br/>[animations.js]"]
end

node_visitor(("Dashboard user"))
node_external_sources(("External data sources"))

node_visitor -.->|"opens dashboard"| node_server
node_entry -->|"starts"| node_server
node_server -.->|"loads settings"| node_configuration
node_server -.->|"handles sign-in"| node_authentication
node_server -.->|"serves pages"| node_page_templates
node_server -.->|"applies themes"| node_themes
node_server -.->|"renders widgets"| node_widget_runtime
node_widget_runtime -.->|"dispatches"| node_feed_widgets
node_widget_runtime -.->|"dispatches"| node_video_widgets
node_widget_runtime -.->|"dispatches"| node_search_widgets
node_widget_runtime -.->|"dispatches"| node_weather_widgets
node_widget_runtime -.->|"dispatches"| node_market_widgets
node_widget_runtime -.->|"dispatches"| node_infra_widgets
node_external_sources -.->|"provides feed data"| node_feed_widgets
node_external_sources -.->|"provides content"| node_video_widgets
node_external_sources -.->|"provides forecasts"| node_weather_widgets
node_external_sources -.->|"provides prices"| node_market_widgets
node_infra_widgets -->|"collects local stats"| node_sysinfo
node_server -.->|"serves dashboard"| node_browser_page
node_browser_page -->|"sets up"| node_browser_popover
node_browser_page -.->|"sets up"| node_browser_masonry
node_browser_page -->|"sets up"| node_browser_calendar
node_browser_page -->|"sets up"| node_browser_todo
node_browser_calendar -->|"builds DOM with"| node_browser_templates
node_browser_calendar -->|"uses"| node_browser_animations
node_browser_todo -->|"builds DOM with"| node_browser_templates
node_browser_todo -->|"uses"| node_browser_animations
node_browser_masonry -.->|"reflows dashboard"| node_browser_page

click node_entry "https://github.com/glanceapp/glance/blob/main/main.go"
click node_server "https://github.com/glanceapp/glance/blob/main/internal/glance/glance.go"
click node_configuration "https://github.com/glanceapp/glance/blob/main/internal/glance/config.go"
click node_authentication "https://github.com/glanceapp/glance/blob/main/internal/glance/auth.go"
click node_page_templates "https://github.com/glanceapp/glance/blob/main/internal/glance/templates.go"
click node_themes "https://github.com/glanceapp/glance/blob/main/internal/glance/theme.go"
click node_widget_runtime "https://github.com/glanceapp/glance/blob/main/internal/glance/widget.go"
click node_feed_widgets "https://github.com/glanceapp/glance/blob/main/internal/glance/widget-rss.go"
click node_video_widgets "https://github.com/glanceapp/glance/blob/main/internal/glance/widget-videos.go"
click node_search_widgets "https://github.com/glanceapp/glance/blob/main/internal/glance/widget-search.go"
click node_weather_widgets "https://github.com/glanceapp/glance/blob/main/internal/glance/widget-weather.go"
click node_market_widgets "https://github.com/glanceapp/glance/blob/main/internal/glance/widget-markets.go"
click node_infra_widgets "https://github.com/glanceapp/glance/blob/main/internal/glance/widget-server-stats.go"
click node_sysinfo "https://github.com/glanceapp/glance/blob/main/pkg/sysinfo/sysinfo.go"
click node_browser_page "https://github.com/glanceapp/glance/blob/main/internal/glance/static/js/page.js"
click node_browser_calendar "https://github.com/glanceapp/glance/blob/main/internal/glance/static/js/calendar.js"
click node_browser_todo "https://github.com/glanceapp/glance/blob/main/internal/glance/static/js/todo.js"
click node_browser_popover "https://github.com/glanceapp/glance/blob/main/internal/glance/static/js/popover.js"
click node_browser_masonry "https://github.com/glanceapp/glance/blob/main/internal/glance/static/js/masonry.js"
click node_browser_templates "https://github.com/glanceapp/glance/blob/main/internal/glance/static/js/templating.js"
click node_browser_animations "https://github.com/glanceapp/glance/blob/main/internal/glance/static/js/animations.js"

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_server,node_configuration,node_authentication,node_visitor toneBlue
class node_page_templates,node_themes,node_widget_runtime toneAmber
class node_feed_widgets,node_video_widgets,node_search_widgets toneMint
class node_weather_widgets,node_market_widgets,node_infra_widgets,node_sysinfo toneRose
class node_browser_page,node_browser_calendar,node_browser_todo,node_browser_popover,node_browser_masonry,node_browser_templates,node_browser_animations,node_external_sources toneIndigo
```

## Components

### Server runtime

- [Program entry](https://github.com/glanceapp/glance/blob/main/main.go): `main.go`
- [HTTP application](https://github.com/glanceapp/glance/blob/main/internal/glance/glance.go): `internal/glance/glance.go`
- [YAML configuration](https://github.com/glanceapp/glance/blob/main/internal/glance/config.go): `internal/glance/config.go`
- [Authentication](https://github.com/glanceapp/glance/blob/main/internal/glance/auth.go): `internal/glance/auth.go`

### Dashboard presentation

- [Page templates](https://github.com/glanceapp/glance/blob/main/internal/glance/templates.go): `internal/glance/templates.go`
- [Themes](https://github.com/glanceapp/glance/blob/main/internal/glance/theme.go): `internal/glance/theme.go`
- [Widget runtime](https://github.com/glanceapp/glance/blob/main/internal/glance/widget.go): `internal/glance/widget.go`

### Content widgets

- [Feeds and communities](https://github.com/glanceapp/glance/blob/main/internal/glance/widget-rss.go): `internal/glance/widget-rss.go`
- [Video and streaming](https://github.com/glanceapp/glance/blob/main/internal/glance/widget-videos.go): `internal/glance/widget-videos.go`
- [Search and links](https://github.com/glanceapp/glance/blob/main/internal/glance/widget-search.go): `internal/glance/widget-search.go`

### Data widgets

- [Weather and calendar](https://github.com/glanceapp/glance/blob/main/internal/glance/widget-weather.go): `internal/glance/widget-weather.go`
- [Markets and releases](https://github.com/glanceapp/glance/blob/main/internal/glance/widget-markets.go): `internal/glance/widget-markets.go`
- [Infrastructure status](https://github.com/glanceapp/glance/blob/main/internal/glance/widget-server-stats.go): `internal/glance/widget-server-stats.go`
- [System information](https://github.com/glanceapp/glance/blob/main/pkg/sysinfo/sysinfo.go): `pkg/sysinfo/sysinfo.go`

### Browser interaction

- [Page interactions](https://github.com/glanceapp/glance/blob/main/internal/glance/static/js/page.js): `internal/glance/static/js/page.js`
- [Calendar UI](https://github.com/glanceapp/glance/blob/main/internal/glance/static/js/calendar.js): `internal/glance/static/js/calendar.js`
- [Todo UI](https://github.com/glanceapp/glance/blob/main/internal/glance/static/js/todo.js): `internal/glance/static/js/todo.js`
- [Popover UI](https://github.com/glanceapp/glance/blob/main/internal/glance/static/js/popover.js): `internal/glance/static/js/popover.js`
- [Masonry layout](https://github.com/glanceapp/glance/blob/main/internal/glance/static/js/masonry.js): `internal/glance/static/js/masonry.js`
- [DOM helpers](https://github.com/glanceapp/glance/blob/main/internal/glance/static/js/templating.js): `internal/glance/static/js/templating.js`
- [Animations](https://github.com/glanceapp/glance/blob/main/internal/glance/static/js/animations.js): `internal/glance/static/js/animations.js`

### Other components

- **Dashboard user**
- **External data sources**

## Connections

- Dashboard user → HTTP application: opens dashboard
- Program entry → HTTP application: starts (evidence: `main.go`)
- HTTP application → YAML configuration: loads settings
- HTTP application → Authentication: handles sign-in
- HTTP application → Page templates: serves pages
- HTTP application → Themes: applies themes
- HTTP application → Widget runtime: renders widgets
- Widget runtime → Feeds and communities: dispatches
- Widget runtime → Video and streaming: dispatches
- Widget runtime → Search and links: dispatches
- Widget runtime → Weather and calendar: dispatches
- Widget runtime → Markets and releases: dispatches
- Widget runtime → Infrastructure status: dispatches
- External data sources → Feeds and communities: provides feed data
- External data sources → Video and streaming: provides content
- External data sources → Weather and calendar: provides forecasts
- External data sources → Markets and releases: provides prices
- Infrastructure status → System information: collects local stats (evidence: `internal/glance/widget-server-stats.go`)
- HTTP application → Page interactions: serves dashboard
- Page interactions → Popover UI: sets up (evidence: `internal/glance/static/js/page.js`)
- Page interactions → Masonry layout: sets up (evidence: `internal/glance/static/js/page.js`)
- Page interactions → Calendar UI: sets up (evidence: `internal/glance/static/js/page.js`)
- Page interactions → Todo UI: sets up (evidence: `internal/glance/static/js/page.js`)
- Calendar UI → DOM helpers: builds DOM with (evidence: `internal/glance/static/js/calendar.js`)
- Calendar UI → Animations: uses (evidence: `internal/glance/static/js/calendar.js`)
- Todo UI → DOM helpers: builds DOM with (evidence: `internal/glance/static/js/todo.js`)
- Todo UI → Animations: uses (evidence: `internal/glance/static/js/todo.js`)
- Masonry layout → Page interactions: reflows dashboard (evidence: `internal/glance/static/js/page.js`)
