# orhandogankaplan/night-constellation architecture

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

- Interactive diagram: https://gitdiagram.com/orhandogankaplan/night-constellation
- Repository: https://github.com/orhandogankaplan/night-constellation

## Overview

Night Constellation is a Windows live-wallpaper, desktop music-skin, and screensaver application. Its main workflow reads Windows media-session state and loopback audio, exposes application services through a pywebview JavaScript bridge, and presents a real-time night-sky interface. The README also describes visual effects, lyrics, weather, telemetry, listening history, themes, tray controls, and wallpaper integration. Some frontend and backend relationships are only documented or indexed, so the graph avoids inferring unshown calls between those components.

Main entry points: [`main.py`](https://github.com/orhandogankaplan/night-constellation/blob/main/main.py) (Application Bridge), [`frontend/constellation.js`](https://github.com/orhandogankaplan/night-constellation/blob/main/frontend/constellation.js) (Constellation Scene), [`frontend/app.js`](https://github.com/orhandogankaplan/night-constellation/blob/main/frontend/app.js) (Web Interface), [`backend/lyrics_client.py`](https://github.com/orhandogankaplan/night-constellation/blob/main/backend/lyrics_client.py) (Synced Lyrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and UI"]
  node_main["Application Bridge<br/>[main.py]"]
  node_webview["PyWebView Window<br/>[main.py]"]
  node_interface["Web Interface<br/>[app.js]"]
end

subgraph group_media["Media Experience"]
  node_media_state["Media Session<br/>[media_smtc.py]"]
  node_audio["Audio Analysis<br/>[audio_reactive.py]"]
  node_lyrics["Synced Lyrics<br/>[lyrics_client.py]"]
  node_history[("Listening History<br/>[history_log.py]")]
end

subgraph group_visuals["Visual Scene"]
  node_scene["Constellation Scene<br/>[constellation.js]"]
  node_sky_effects["Sky Effects<br/>[sky.js]"]
  node_fluid_effects["Fluid Effects<br/>[fluid.js]"]
  node_gl_background["3D Background<br/>[gl_background.js]"]
  node_weather_fx["Weather Effects<br/>[weather_fx.js]"]
  node_themes["Themes<br/>[themes.py]"]
end

subgraph group_desktop["Desktop Services"]
  node_weather["Weather Service<br/>[weather.py]"]
  node_telemetry["HUD Telemetry<br/>[telemetry.py]"]
  node_eco["Auto-Eco Monitor<br/>[eco_monitor.py]"]
  node_tray["System Tray<br/>[tray_manager.py]"]
  node_wallpaper["Wallpaper Controls<br/>[win_wallpaper.py]"]
  node_localization["Tray Localization<br/>[i18n.py]"]
  node_updater["Update Checker<br/>[updater.py]"]
end

subgraph group_integrations["External Integrations"]
  node_smtc["Windows SMTC"]
  node_wasapi["WASAPI Loopback"]
  node_lrclib["LRCLIB"]
  node_translate_api["Google Translate"]
  node_open_meteo["Open-Meteo"]
  node_ipapi["IP Geolocation"]
  node_github["GitHub Releases"]
end

node_user(("Desktop User"))

node_user -->|"launches"| node_main
node_main -->|"creates"| node_media_state
node_main -->|"creates"| node_audio
node_main -->|"creates"| node_lyrics
node_main -->|"creates"| node_telemetry
node_main -->|"creates"| node_history
node_main -->|"creates"| node_weather
node_main -->|"serves"| node_interface
node_main -->|"creates"| node_webview
node_webview -->|"loads"| node_interface
node_main -->|"records tracks"| node_history
node_main -->|"configures"| node_tray
node_main -->|"uses"| node_wallpaper
node_main -->|"uses"| node_eco
node_tray -->|"translates labels"| node_localization
node_tray -->|"reads update info"| node_updater
node_audio -->|"captures audio"| node_wasapi
node_media_state -->|"polls sessions"| node_smtc
node_lyrics -->|"fetches lyrics"| node_lrclib
node_lyrics -->|"translates lyrics"| node_translate_api
node_weather -->|"detects location"| node_ipapi
node_weather -->|"fetches forecast"| node_open_meteo
node_updater -->|"checks releases"| node_github
node_interface -.->|"renders scene"| node_scene
node_scene -.->|"uses effects"| node_sky_effects
node_scene -.->|"uses effects"| node_fluid_effects
node_scene -.->|"uses background"| node_gl_background
node_scene -.->|"uses weather FX"| node_weather_fx
node_interface -.->|"supports themes"| node_themes

click node_main "https://github.com/orhandogankaplan/night-constellation/blob/main/main.py"
click node_webview "https://github.com/orhandogankaplan/night-constellation/blob/main/main.py"
click node_interface "https://github.com/orhandogankaplan/night-constellation/blob/main/frontend/app.js"
click node_media_state "https://github.com/orhandogankaplan/night-constellation/blob/main/backend/media_smtc.py"
click node_audio "https://github.com/orhandogankaplan/night-constellation/blob/main/backend/audio_reactive.py"
click node_lyrics "https://github.com/orhandogankaplan/night-constellation/blob/main/backend/lyrics_client.py"
click node_history "https://github.com/orhandogankaplan/night-constellation/blob/main/backend/history_log.py"
click node_scene "https://github.com/orhandogankaplan/night-constellation/blob/main/frontend/constellation.js"
click node_sky_effects "https://github.com/orhandogankaplan/night-constellation/blob/main/frontend/sky.js"
click node_fluid_effects "https://github.com/orhandogankaplan/night-constellation/blob/main/frontend/fluid.js"
click node_gl_background "https://github.com/orhandogankaplan/night-constellation/blob/main/frontend/gl_background.js"
click node_weather_fx "https://github.com/orhandogankaplan/night-constellation/blob/main/frontend/weather_fx.js"
click node_themes "https://github.com/orhandogankaplan/night-constellation/blob/main/backend/themes.py"
click node_weather "https://github.com/orhandogankaplan/night-constellation/blob/main/backend/weather.py"
click node_telemetry "https://github.com/orhandogankaplan/night-constellation/blob/main/backend/telemetry.py"
click node_eco "https://github.com/orhandogankaplan/night-constellation/blob/main/backend/eco_monitor.py"
click node_tray "https://github.com/orhandogankaplan/night-constellation/blob/main/backend/tray_manager.py"
click node_wallpaper "https://github.com/orhandogankaplan/night-constellation/blob/main/backend/win_wallpaper.py"
click node_localization "https://github.com/orhandogankaplan/night-constellation/blob/main/backend/i18n.py"
click node_updater "https://github.com/orhandogankaplan/night-constellation/blob/main/backend/updater.py"

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_main,node_webview,node_interface,node_user toneBlue
class node_media_state,node_audio,node_lyrics,node_history toneAmber
class node_scene,node_sky_effects,node_fluid_effects,node_gl_background,node_weather_fx,node_themes toneMint
class node_weather,node_telemetry,node_eco,node_tray,node_wallpaper,node_localization,node_updater toneRose
class node_smtc,node_wasapi,node_lrclib,node_translate_api,node_open_meteo,node_ipapi,node_github toneIndigo
```

## Components

### Runtime and UI

- [Application Bridge](https://github.com/orhandogankaplan/night-constellation/blob/main/main.py): `main.py`
- [PyWebView Window](https://github.com/orhandogankaplan/night-constellation/blob/main/main.py): `main.py`
- [Web Interface](https://github.com/orhandogankaplan/night-constellation/blob/main/frontend/app.js): `frontend/app.js`

### Media Experience

- [Media Session](https://github.com/orhandogankaplan/night-constellation/blob/main/backend/media_smtc.py): `backend/media_smtc.py`
- [Audio Analysis](https://github.com/orhandogankaplan/night-constellation/blob/main/backend/audio_reactive.py): `backend/audio_reactive.py`
- [Synced Lyrics](https://github.com/orhandogankaplan/night-constellation/blob/main/backend/lyrics_client.py): `backend/lyrics_client.py`
- [Listening History](https://github.com/orhandogankaplan/night-constellation/blob/main/backend/history_log.py): `backend/history_log.py`

### Visual Scene

- [Constellation Scene](https://github.com/orhandogankaplan/night-constellation/blob/main/frontend/constellation.js): `frontend/constellation.js`
- [Sky Effects](https://github.com/orhandogankaplan/night-constellation/blob/main/frontend/sky.js): `frontend/sky.js`
- [Fluid Effects](https://github.com/orhandogankaplan/night-constellation/blob/main/frontend/fluid.js): `frontend/fluid.js`
- [3D Background](https://github.com/orhandogankaplan/night-constellation/blob/main/frontend/gl_background.js): `frontend/gl_background.js`
- [Weather Effects](https://github.com/orhandogankaplan/night-constellation/blob/main/frontend/weather_fx.js): `frontend/weather_fx.js`
- [Themes](https://github.com/orhandogankaplan/night-constellation/blob/main/backend/themes.py): `backend/themes.py`

### Desktop Services

- [Weather Service](https://github.com/orhandogankaplan/night-constellation/blob/main/backend/weather.py): `backend/weather.py`
- [HUD Telemetry](https://github.com/orhandogankaplan/night-constellation/blob/main/backend/telemetry.py): `backend/telemetry.py`
- [Auto-Eco Monitor](https://github.com/orhandogankaplan/night-constellation/blob/main/backend/eco_monitor.py): `backend/eco_monitor.py`
- [System Tray](https://github.com/orhandogankaplan/night-constellation/blob/main/backend/tray_manager.py): `backend/tray_manager.py`
- [Wallpaper Controls](https://github.com/orhandogankaplan/night-constellation/blob/main/backend/win_wallpaper.py): `backend/win_wallpaper.py`
- [Tray Localization](https://github.com/orhandogankaplan/night-constellation/blob/main/backend/i18n.py): `backend/i18n.py`
- [Update Checker](https://github.com/orhandogankaplan/night-constellation/blob/main/backend/updater.py): `backend/updater.py`

### External Integrations

- **Windows SMTC**
- **WASAPI Loopback**
- **LRCLIB**
- **Google Translate**
- **Open-Meteo**
- **IP Geolocation**
- **GitHub Releases**

### Other components

- **Desktop User**

## Connections

- Desktop User → Application Bridge: launches (evidence: `README.md`)
- Application Bridge → Media Session: creates (evidence: `main.py`)
- Application Bridge → Audio Analysis: creates (evidence: `main.py`)
- Application Bridge → Synced Lyrics: creates (evidence: `main.py`)
- Application Bridge → HUD Telemetry: creates (evidence: `main.py`)
- Application Bridge → Listening History: creates (evidence: `main.py`)
- Application Bridge → Weather Service: creates (evidence: `main.py`)
- Application Bridge → Web Interface: serves (evidence: `main.py`)
- Application Bridge → PyWebView Window: creates (evidence: `main.py`)
- PyWebView Window → Web Interface: loads (evidence: `main.py`)
- Application Bridge → Listening History: records tracks (evidence: `main.py`)
- Application Bridge → System Tray: configures (evidence: `main.py`)
- Application Bridge → Wallpaper Controls: uses (evidence: `main.py`)
- Application Bridge → Auto-Eco Monitor: uses (evidence: `main.py`)
- System Tray → Tray Localization: translates labels (evidence: `backend/tray_manager.py`)
- System Tray → Update Checker: reads update info (evidence: `backend/tray_manager.py`)
- Audio Analysis → WASAPI Loopback: captures audio (evidence: `backend/audio_reactive.py`)
- Media Session → Windows SMTC: polls sessions (evidence: `backend/media_smtc.py`)
- Synced Lyrics → LRCLIB: fetches lyrics (evidence: `backend/lyrics_client.py`)
- Synced Lyrics → Google Translate: translates lyrics (evidence: `backend/lyrics_client.py`)
- Weather Service → IP Geolocation: detects location (evidence: `backend/weather.py`)
- Weather Service → Open-Meteo: fetches forecast (evidence: `backend/weather.py`)
- Update Checker → GitHub Releases: checks releases (evidence: `backend/updater.py`)
- Web Interface → Constellation Scene: renders scene
- Constellation Scene → Sky Effects: uses effects
- Constellation Scene → Fluid Effects: uses effects
- Constellation Scene → 3D Background: uses background
- Constellation Scene → Weather Effects: uses weather FX
- Web Interface → Themes: supports themes
