# zhiyiyo/groove architecture

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

- Interactive diagram: https://gitdiagram.com/zhiyiyo/groove
- Repository: https://github.com/zhiyiyo/groove

## Overview

Groove is a cross-platform PyQt5 music player. Its user-facing flow centers on browsing or searching music, selecting tracks, and playing them; the README also documents playlists, metadata editing, and music-video playback and downloads. The graph includes those product branches and the central library, persistence, and shared application services. Some relationships come only from the README or SOURCE INDEX; unverified runtime links are dashed rather than presented as inspected calls.

Main entry points: [`app/View/main_window/main_window.py`](https://github.com/zhiyiyo/groove/blob/master/app/View/main_window/main_window.py) (Main window), [`app/View/search_result_interface/search_result_interface.py`](https://github.com/zhiyiyo/groove/blob/master/app/View/search_result_interface/search_result_interface.py) (Search results), [`app/Groove.py`](https://github.com/zhiyiyo/groove/blob/master/app/Groove.py) (Application entry), [`app/common/database/controller/song_info_controller.py`](https://github.com/zhiyiyo/groove/blob/master/app/common/database/controller/song_info_controller.py) (Library controllers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Music interfaces"]
  node_entry["Application entry<br/>[Groove.py]"]
  node_window["Main window<br/>[main_window.py]"]
  node_search["Search results"]
  node_more_search["Expanded results"]
  node_now_playing["Playing view"]
  node_playlist_ui["Playlist views"]
  node_settings_ui["Settings view"]
end

subgraph group_media["Playback and discovery"]
  node_media_player["Media player<br/>[media_player.py]"]
  node_media_playlist["Playback queue<br/>[media_playlist.py]"]
  node_crawler["Online music search"]
  node_video["Music video<br/>[video_interface.py]"]
  node_download_mv["Video downloads"]
end

subgraph group_library["Library and persistence"]
  node_library_api["Local music library<br/>[library.py]"]
  node_file_watcher["Folder watcher"]
  node_metadata["Metadata editing"]
  node_db_controllers["Library controllers"]
  node_db_services["Persistence services"]
  node_db_store[("Music database<br/>[dao_base.py]")]
  node_song_metadata["Song metadata reader"]
end

subgraph group_core["Shared application services"]
  node_signals["Signal bus<br/>[signal_bus.py]"]
  node_config[("App configuration<br/>[config.py]")]
  node_hotkeys["Global hotkeys<br/>[hotkey_manager.py]"]
  node_dpi["Display scaling<br/>[dpi_manager.py]"]
  node_style["Theme styling<br/>[style_sheet.py]"]
  node_resources["Shared resources<br/>[resource.py]"]
end

node_user(("Listener"))

node_user -.->|"starts app"| node_entry
node_entry -->|"opens window"| node_window
node_user -.->|"searches music"| node_search
node_search -->|"queries online"| node_crawler
node_search -->|"requests more"| node_more_search
node_more_search -->|"displays results"| node_search
node_window -->|"uses library"| node_library_api
node_window -->|"connects signals"| node_signals
node_window -->|"loads settings"| node_config
node_window -->|"loads resources"| node_resources
node_user -.->|"plays music"| node_media_player
node_media_player -.->|"uses queue"| node_media_playlist
node_user -.->|"manages playlists"| node_playlist_ui
node_user -.->|"edits metadata"| node_metadata
node_user -.->|"watches video"| node_video
node_video -.->|"downloads video"| node_download_mv
node_library_api -.->|"monitors folders"| node_file_watcher
node_db_controllers -->|"uses services"| node_db_services
node_db_services -->|"uses DAO"| node_db_store
node_db_controllers -->|"reads metadata"| node_song_metadata
node_window -->|"uses hotkeys"| node_hotkeys
node_entry -->|"sets scaling"| node_dpi
node_window -->|"applies styles"| node_style
node_settings_ui -.->|"configures app"| node_config

click node_entry "https://github.com/zhiyiyo/groove/blob/master/app/Groove.py"
click node_window "https://github.com/zhiyiyo/groove/blob/master/app/View/main_window/main_window.py"
click node_search "https://github.com/zhiyiyo/groove/blob/master/app/View/search_result_interface/search_result_interface.py"
click node_more_search "https://github.com/zhiyiyo/groove/blob/master/app/View/more_search_result_interface/more_search_result_interface.py"
click node_now_playing "https://github.com/zhiyiyo/groove/blob/master/app/View/playing_interface/playing_interface.py"
click node_playlist_ui "https://github.com/zhiyiyo/groove/blob/master/app/View/playlist_interface/playlist_interface.py"
click node_settings_ui "https://github.com/zhiyiyo/groove/blob/master/app/View/setting_interface/setting_interface.py"
click node_media_player "https://github.com/zhiyiyo/groove/blob/master/app/components/media_player/media_player.py"
click node_media_playlist "https://github.com/zhiyiyo/groove/blob/master/app/components/media_player/media_playlist.py"
click node_crawler "https://github.com/zhiyiyo/groove/blob/master/app/common/crawler/kuwo_music_crawler.py"
click node_video "https://github.com/zhiyiyo/groove/blob/master/app/View/video_interface/video_interface.py"
click node_download_mv "https://github.com/zhiyiyo/groove/blob/master/app/common/thread/download_mv_thread.py"
click node_library_api "https://github.com/zhiyiyo/groove/blob/master/app/common/library/library.py"
click node_file_watcher "https://github.com/zhiyiyo/groove/blob/master/app/common/library/file_system_watcher.py"
click node_metadata "https://github.com/zhiyiyo/groove/blob/master/app/components/dialog_box/album_info_edit_dialog.py"
click node_db_controllers "https://github.com/zhiyiyo/groove/blob/master/app/common/database/controller/song_info_controller.py"
click node_db_services "https://github.com/zhiyiyo/groove/blob/master/app/common/database/service/playlist_service.py"
click node_db_store "https://github.com/zhiyiyo/groove/blob/master/app/common/database/dao/dao_base.py"
click node_signals "https://github.com/zhiyiyo/groove/blob/master/app/common/signal_bus.py"
click node_config "https://github.com/zhiyiyo/groove/blob/master/app/common/config.py"
click node_hotkeys "https://github.com/zhiyiyo/groove/blob/master/app/common/hotkey_manager.py"
click node_dpi "https://github.com/zhiyiyo/groove/blob/master/app/common/dpi_manager.py"
click node_style "https://github.com/zhiyiyo/groove/blob/master/app/common/style_sheet.py"
click node_resources "https://github.com/zhiyiyo/groove/blob/master/app/common/resource.py"
click node_song_metadata "https://github.com/zhiyiyo/groove/blob/master/app/common/meta_data/reader/song_info_reader.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_entry,node_window,node_search,node_more_search,node_now_playing,node_playlist_ui,node_settings_ui toneBlue
class node_media_player,node_media_playlist,node_crawler,node_video,node_download_mv toneAmber
class node_library_api,node_file_watcher,node_metadata,node_db_controllers,node_db_services,node_db_store,node_song_metadata toneMint
class node_signals,node_config,node_hotkeys,node_dpi,node_style,node_resources toneRose
class node_user toneIndigo
```

## Components

### Music interfaces

- [Application entry](https://github.com/zhiyiyo/groove/blob/master/app/Groove.py): `app/Groove.py`
- [Main window](https://github.com/zhiyiyo/groove/blob/master/app/View/main_window/main_window.py): `app/View/main_window/main_window.py`
- [Search results](https://github.com/zhiyiyo/groove/blob/master/app/View/search_result_interface/search_result_interface.py): `app/View/search_result_interface/search_result_interface.py`
- [Expanded results](https://github.com/zhiyiyo/groove/blob/master/app/View/more_search_result_interface/more_search_result_interface.py): `app/View/more_search_result_interface/more_search_result_interface.py`
- [Playing view](https://github.com/zhiyiyo/groove/blob/master/app/View/playing_interface/playing_interface.py): `app/View/playing_interface/playing_interface.py`
- [Playlist views](https://github.com/zhiyiyo/groove/blob/master/app/View/playlist_interface/playlist_interface.py): `app/View/playlist_interface/playlist_interface.py`
- [Settings view](https://github.com/zhiyiyo/groove/blob/master/app/View/setting_interface/setting_interface.py): `app/View/setting_interface/setting_interface.py`

### Playback and discovery

- [Media player](https://github.com/zhiyiyo/groove/blob/master/app/components/media_player/media_player.py): `app/components/media_player/media_player.py`
- [Playback queue](https://github.com/zhiyiyo/groove/blob/master/app/components/media_player/media_playlist.py): `app/components/media_player/media_playlist.py`
- [Online music search](https://github.com/zhiyiyo/groove/blob/master/app/common/crawler/kuwo_music_crawler.py): `app/common/crawler/kuwo_music_crawler.py`
- [Music video](https://github.com/zhiyiyo/groove/blob/master/app/View/video_interface/video_interface.py): `app/View/video_interface/video_interface.py`
- [Video downloads](https://github.com/zhiyiyo/groove/blob/master/app/common/thread/download_mv_thread.py): `app/common/thread/download_mv_thread.py`

### Library and persistence

- [Local music library](https://github.com/zhiyiyo/groove/blob/master/app/common/library/library.py): `app/common/library/library.py`
- [Folder watcher](https://github.com/zhiyiyo/groove/blob/master/app/common/library/file_system_watcher.py): `app/common/library/file_system_watcher.py`
- [Metadata editing](https://github.com/zhiyiyo/groove/blob/master/app/components/dialog_box/album_info_edit_dialog.py): `app/components/dialog_box/album_info_edit_dialog.py`
- [Library controllers](https://github.com/zhiyiyo/groove/blob/master/app/common/database/controller/song_info_controller.py): `app/common/database/controller/song_info_controller.py`
- [Persistence services](https://github.com/zhiyiyo/groove/blob/master/app/common/database/service/playlist_service.py): `app/common/database/service/playlist_service.py`
- [Music database](https://github.com/zhiyiyo/groove/blob/master/app/common/database/dao/dao_base.py): `app/common/database/dao/dao_base.py`
- [Song metadata reader](https://github.com/zhiyiyo/groove/blob/master/app/common/meta_data/reader/song_info_reader.py): `app/common/meta_data/reader/song_info_reader.py`

### Shared application services

- [Signal bus](https://github.com/zhiyiyo/groove/blob/master/app/common/signal_bus.py): `app/common/signal_bus.py`
- [App configuration](https://github.com/zhiyiyo/groove/blob/master/app/common/config.py): `app/common/config.py`
- [Global hotkeys](https://github.com/zhiyiyo/groove/blob/master/app/common/hotkey_manager.py): `app/common/hotkey_manager.py`
- [Display scaling](https://github.com/zhiyiyo/groove/blob/master/app/common/dpi_manager.py): `app/common/dpi_manager.py`
- [Theme styling](https://github.com/zhiyiyo/groove/blob/master/app/common/style_sheet.py): `app/common/style_sheet.py`
- [Shared resources](https://github.com/zhiyiyo/groove/blob/master/app/common/resource.py): `app/common/resource.py`

### Other components

- **Listener**

## Connections

- Listener → Application entry: starts app
- Application entry → Main window: opens window (evidence: `app/Groove.py`)
- Listener → Search results: searches music
- Search results → Online music search: queries online (evidence: `app/View/search_result_interface/search_result_interface.py`)
- Search results → Expanded results: requests more (evidence: `app/View/search_result_interface/search_result_interface.py`)
- Expanded results → Search results: displays results (evidence: `app/View/more_search_result_interface/more_search_result_interface.py`)
- Main window → Local music library: uses library (evidence: `app/View/main_window/main_window.py`)
- Main window → Signal bus: connects signals (evidence: `app/View/main_window/main_window.py`)
- Main window → App configuration: loads settings (evidence: `app/View/main_window/main_window.py`)
- Main window → Shared resources: loads resources (evidence: `app/View/main_window/main_window.py`)
- Listener → Media player: plays music
- Media player → Playback queue: uses queue
- Listener → Playlist views: manages playlists
- Listener → Metadata editing: edits metadata
- Listener → Music video: watches video
- Music video → Video downloads: downloads video
- Local music library → Folder watcher: monitors folders
- Library controllers → Persistence services: uses services (evidence: `app/common/database/controller/song_info_controller.py`)
- Persistence services → Music database: uses DAO (evidence: `app/common/database/service/playlist_service.py`)
- Library controllers → Song metadata reader: reads metadata (evidence: `app/common/database/controller/song_info_controller.py`)
- Main window → Global hotkeys: uses hotkeys (evidence: `app/View/main_window/main_window.py`)
- Application entry → Display scaling: sets scaling (evidence: `app/Groove.py`)
- Main window → Theme styling: applies styles (evidence: `app/View/main_window/main_window.py`)
- Settings view → App configuration: configures app
