# yin-hongwei/wangyiyun architecture

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

- Interactive diagram: https://gitdiagram.com/yin-hongwei/wangyiyun
- Repository: https://github.com/yin-hongwei/wangyiyun

## Overview

1. **Repository type and boundary**
   - This is a **Vue 2 single-page application** that implements a NetEase Cloud Music–style web client.
   - The repo is primarily the **frontend**. It does not contain the music backend; instead it consumes the external **NeteaseCloudMusicApi** service described in the README.

2. **High-level runtime**
   - The app boots from `src/main.js`, mounts the root `App.vue`, and then hands off navigation to `vue-router`.
   - At runtime, the browser hosts the entire UI; there is no server-side rendering or separate backend in this repo.

3. **Routing and page-level structure**
   - `src/router/index.js` defines the app’s page boundaries.
   - The main routed views live under `src/views`, including:
     - `IndexPage.vue` for the home/landing experience
     - `SongList.vue` for playlist/detail pages
     - `Search.vue` for music search
     - `Player.vue` for playback
     - `TheVideo.vue`, `Friends.vue`, `User.vue`, `TheSetting.vue`
   - This gives the app a **page-oriented architecture**, with each view composing shared components and shared state.

4. **Shared UI components**
   - Reusable UI is concentrated in `src/components`.
   - Notable shared pieces include:
     - `TheHeader.vue` and `TheFooter.vue` for global chrome
     - `TheSwiper.vue` for carousel/banner behavior
     - `SongListCard.vue` for playlist/song list presentation
     - `SongAudio.vue` for audio playback control/integration
     - `PlayIcon.vue` and `TheIcon.vue` for icon-driven UI
   - `src/components/songType/` contains song-category subcomponents such as `NewSong.vue` and `RecommendSong.vue`, which suggests the home page is split into recommendation-oriented content sections.

5. **State management and cross-page data flow**
   - `src/store/index.js` provides the shared application state via **Vuex**.
   - This is the main boundary for data that must survive route changes, especially playback-related state, current track selection, and likely search/home data.
   - The architecture is typical of a music player SPA: **views fetch or request data, store centralizes state, and components render from store-driven props/computed values**.

6. **Backend/API integration**
   - The README states that the frontend calls the **NeteaseCloudMusicApi** backend.
   - The technology stack includes **axios**, so network access is likely handled through HTTP requests from views, store actions, or shared mixins.
   - From an architecture standpoint, the external API is the main data source for songs, playlists, search results, and lyrics.

7. **Playback subsystem**
   - The most important functional subsystem is music playback.
   - `Player.vue` is the dedicated playback page, while `SongAudio.vue` is the component most likely responsible for binding the HTML audio element and syncing playback state.
   - Lyrics display is called out in the README, so playback is not just audio control; it also includes **track metadata and lyric synchronization** as part of the player experience.

8. **Home/content presentation**
   - `IndexPage.vue` and the `songType` components indicate a content-discovery flow focused on featured/recommended music.
   - `TheSwiper.vue` and `SongListCard.vue` support the presentation layer for banners and playlists.
   - This area is likely driven by API responses rendered into cards and carousel sections rather than by local static content.

9. **Search and discovery**
   - `Search.vue` is a separate discovery surface for querying music.
   - In the architecture diagram, this should be shown as another consumer of the same remote music API and shared store, rather than as an isolated feature.

10. **Styling and static assets**
   - Global styles are in `src/assets/css/static.css`.
   - Icon assets are handled through `src/assets/js/icon.js` and the `iconfont*.js` files, which implies icon font-based rendering is part of the UI system.
   - Images and other static media live under `src/assets/img` and `static/img`.

11. **Application scaffolding and build pipeline**
   - The repo uses a classic Vue CLI/Webpack setup:
     - `build/` contains webpack build scripts and helpers
     - `config/` contains environment-specific config files for dev/prod/test
     - `index.html` is the SPA host page
   - This matters architecturally because the app is built as a bundled frontend, with separate development and production configurations.

12. **Testing and quality gates**
   - The repo includes both:
     - **Unit tests** under `test/unit` using Jest
     - **End-to-end tests** under `test/e2e` using Nightwatch
   - These test layers sit around the UI and route flows rather than around server logic, which matches the client-only architecture.

13. **Architecture summary for a diagram**
   - The clean diagram for this repo is:
     - **Browser SPA shell** → `main.js` → `App.vue`
     - **Router** → page views in `src/views`
     - **Shared store** → Vuex state in `src/store`
     - **Reusable UI components** → `src/components`
     - **External NetEase Cloud Music API backend** → data source via HTTP/axios
   - The key interaction to emphasize is that **route-driven views consume shared Vuex state and remote API data, while audio playback spans both the player view and reusable audio component**.

Main entry points: [`src/router/index.js`](https://github.com/yin-hongwei/wangyiyun/blob/master/src/router/index.js) (Router), [`src/main.js`](https://github.com/yin-hongwei/wangyiyun/blob/master/src/main.js) (main.js), [`src/views/IndexPage.vue`](https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/IndexPage.vue) (Home), [`src/views/Player.vue`](https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/Player.vue) (Player)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime UI"]
  node_index_html["index.html<br/>spa host<br/>[index.html]"]
end

subgraph group_app["App Code"]
  node_main_js["main.js<br/>bootstrap<br/>[main.js]"]
  node_app_vue["App<br/>root component<br/>[App.vue]"]
  node_router["Router<br/>navigation<br/>[index.js]"]
  node_store[("Store<br/>vuex state<br/>[index.js]")]
  node_mixins["Mixins<br/>shared logic<br/>[index.js]"]
  node_index_page["Home<br/>view<br/>[IndexPage.vue]"]
  node_song_list["Song List<br/>view<br/>[SongList.vue]"]
  node_search_view["Search<br/>view<br/>[Search.vue]"]
  node_player_view["Player<br/>view<br/>[Player.vue]"]
  node_video_view["Video<br/>view<br/>[TheVideo.vue]"]
  node_friends_view["Friends<br/>view<br/>[Friends.vue]"]
  node_user_view["User<br/>view<br/>[User.vue]"]
  node_settings_view["Settings<br/>view<br/>[TheSetting.vue]"]
  node_header["Header<br/>chrome<br/>[TheHeader.vue]"]
  node_footer["Footer<br/>chrome<br/>[TheFooter.vue]"]
  node_swiper["Swiper<br/>carousel<br/>[TheSwiper.vue]"]
  node_song_card["Song Card<br/>card ui<br/>[SongListCard.vue]"]
  node_audio["Audio<br/>playback<br/>[SongAudio.vue]"]
  node_song_types["Song Sections<br/>content modules<br/>[NewSong.vue]"]
  node_icons["Icons<br/>asset ui<br/>[icon.js]"]
  node_styles["Global Styles<br/>stylesheet<br/>[static.css]"]
end

subgraph group_tooling["Build Tooling"]
  node_build["Build<br/>webpack"]
  node_config["Config<br/>[index.js]"]
end

subgraph group_tests["Tests"]
  node_unit_tests["Unit Tests<br/>jest<br/>[jest.conf.js]"]
  node_e2e_tests["E2E Tests<br/>nightwatch<br/>[nightwatch.conf.js]"]
end

node_api[("Netease API<br/>external backend")]

node_index_html -->|"loads"| node_main_js
node_main_js -->|"mounts"| node_app_vue
node_main_js -->|"installs"| node_router
node_main_js -->|"installs"| node_store
node_main_js -->|"includes"| node_styles
node_router -->|"routes"| node_index_page
node_router -->|"routes"| node_song_list
node_router -->|"routes"| node_search_view
node_router -->|"routes"| node_player_view
node_router -->|"routes"| node_video_view
node_router -->|"routes"| node_friends_view
node_router -->|"routes"| node_user_view
node_router -->|"routes"| node_settings_view
node_app_vue -->|"composes"| node_header
node_app_vue -->|"composes"| node_footer
node_index_page -->|"uses"| node_swiper
node_index_page -->|"uses"| node_song_types
node_index_page -->|"renders"| node_song_card
node_song_list -->|"renders"| node_song_card
node_player_view -->|"uses"| node_audio
node_player_view -->|"syncs"| node_store
node_audio -->|"syncs"| node_store
node_search_view -->|"reads"| node_store
node_song_types -->|"fetches"| node_api
node_search_view -->|"queries"| node_api
node_song_list -->|"fetches"| node_api
node_player_view -->|"fetches"| node_api
node_audio -->|"fetches"| node_api
node_header -->|"uses"| node_icons
node_footer -->|"uses"| node_icons
node_build -->|"reads"| node_config
node_unit_tests -->|"tests"| node_app_vue
node_e2e_tests -->|"tests"| node_router

click node_index_html "https://github.com/yin-hongwei/wangyiyun/blob/master/index.html"
click node_main_js "https://github.com/yin-hongwei/wangyiyun/blob/master/src/main.js"
click node_app_vue "https://github.com/yin-hongwei/wangyiyun/blob/master/src/App.vue"
click node_router "https://github.com/yin-hongwei/wangyiyun/blob/master/src/router/index.js"
click node_store "https://github.com/yin-hongwei/wangyiyun/blob/master/src/store/index.js"
click node_mixins "https://github.com/yin-hongwei/wangyiyun/blob/master/src/mixins/index.js"
click node_index_page "https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/IndexPage.vue"
click node_song_list "https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/SongList.vue"
click node_search_view "https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/Search.vue"
click node_player_view "https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/Player.vue"
click node_video_view "https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/TheVideo.vue"
click node_friends_view "https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/Friends.vue"
click node_user_view "https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/User.vue"
click node_settings_view "https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/TheSetting.vue"
click node_header "https://github.com/yin-hongwei/wangyiyun/blob/master/src/components/TheHeader.vue"
click node_footer "https://github.com/yin-hongwei/wangyiyun/blob/master/src/components/TheFooter.vue"
click node_swiper "https://github.com/yin-hongwei/wangyiyun/blob/master/src/components/TheSwiper.vue"
click node_song_card "https://github.com/yin-hongwei/wangyiyun/blob/master/src/components/SongListCard.vue"
click node_audio "https://github.com/yin-hongwei/wangyiyun/blob/master/src/components/SongAudio.vue"
click node_song_types "https://github.com/yin-hongwei/wangyiyun/blob/master/src/components/songType/NewSong.vue"
click node_icons "https://github.com/yin-hongwei/wangyiyun/blob/master/src/assets/js/icon.js"
click node_styles "https://github.com/yin-hongwei/wangyiyun/blob/master/src/assets/css/static.css"
click node_build "https://github.com/yin-hongwei/wangyiyun/blob/master/build/webpack.base.conf.js"
click node_config "https://github.com/yin-hongwei/wangyiyun/blob/master/config/index.js"
click node_unit_tests "https://github.com/yin-hongwei/wangyiyun/blob/master/test/unit/jest.conf.js"
click node_e2e_tests "https://github.com/yin-hongwei/wangyiyun/blob/master/test/e2e/nightwatch.conf.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_index_html toneBlue
class node_main_js,node_app_vue,node_router,node_store,node_mixins,node_index_page,node_song_list,node_search_view,node_player_view,node_video_view,node_friends_view,node_user_view,node_settings_view,node_header,node_footer,node_swiper,node_song_card,node_audio,node_song_types,node_icons,node_styles toneAmber
class node_build,node_config toneMint
class node_unit_tests,node_e2e_tests toneRose
class node_api toneNeutral
```

## Components

### Runtime UI

Browser-hosted Vue single-page application

- [index.html](https://github.com/yin-hongwei/wangyiyun/blob/master/index.html): spa host · Entry HTML shell for the bundled client · `index.html`

### App Code

Source modules for routing, state, views, and shared UI

- [main.js](https://github.com/yin-hongwei/wangyiyun/blob/master/src/main.js): bootstrap · Vue app bootstrap and mount point · `src/main.js`
- [App](https://github.com/yin-hongwei/wangyiyun/blob/master/src/App.vue): root component · Root application shell and layout container · `src/App.vue`
- [Router](https://github.com/yin-hongwei/wangyiyun/blob/master/src/router/index.js): navigation · Route definitions and page boundaries · `src/router/index.js`
- [Store](https://github.com/yin-hongwei/wangyiyun/blob/master/src/store/index.js): vuex state · Shared application state across views · `src/store/index.js`
- [Mixins](https://github.com/yin-hongwei/wangyiyun/blob/master/src/mixins/index.js): shared logic · Reusable behavior shared across components and views · `src/mixins/index.js`
- [Home](https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/IndexPage.vue): view · Landing and recommendation experience · `src/views/IndexPage.vue`
- [Song List](https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/SongList.vue): view · Playlist and song-list detail page · `src/views/SongList.vue`
- [Search](https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/Search.vue): view · Music search and discovery surface · `src/views/Search.vue`
- [Player](https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/Player.vue): view · Playback page with track and lyric experience · `src/views/Player.vue`
- [Video](https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/TheVideo.vue): view · Video browsing/playback page · `src/views/TheVideo.vue`
- [Friends](https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/Friends.vue): view · Social or friend activity page · `src/views/Friends.vue`
- [User](https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/User.vue): view · User profile and account page · `src/views/User.vue`
- [Settings](https://github.com/yin-hongwei/wangyiyun/blob/master/src/views/TheSetting.vue): view · Application settings page · `src/views/TheSetting.vue`
- [Header](https://github.com/yin-hongwei/wangyiyun/blob/master/src/components/TheHeader.vue): chrome · Global top navigation and branding · `src/components/TheHeader.vue`
- [Footer](https://github.com/yin-hongwei/wangyiyun/blob/master/src/components/TheFooter.vue): chrome · Global bottom footer area · `src/components/TheFooter.vue`
- [Swiper](https://github.com/yin-hongwei/wangyiyun/blob/master/src/components/TheSwiper.vue): carousel · Banner and featured-content carousel · `src/components/TheSwiper.vue`
- [Song Card](https://github.com/yin-hongwei/wangyiyun/blob/master/src/components/SongListCard.vue): card ui · Playlist and song list presentation · `src/components/SongListCard.vue`
- [Audio](https://github.com/yin-hongwei/wangyiyun/blob/master/src/components/SongAudio.vue): playback · Audio element integration and playback control · `src/components/SongAudio.vue`
- [Song Sections](https://github.com/yin-hongwei/wangyiyun/blob/master/src/components/songType/NewSong.vue): content modules · Home page recommendation sections · `src/components/songType/NewSong.vue`
- [Icons](https://github.com/yin-hongwei/wangyiyun/blob/master/src/assets/js/icon.js): asset ui · Icon font and icon helper layer · `src/assets/js/icon.js`
- [Global Styles](https://github.com/yin-hongwei/wangyiyun/blob/master/src/assets/css/static.css): stylesheet · Shared application CSS · `src/assets/css/static.css`

### Build Tooling

Webpack/Vue CLI build and environment configuration

- [Build](https://github.com/yin-hongwei/wangyiyun/blob/master/build/webpack.base.conf.js): webpack · Bundled frontend build scripts · `build/webpack.base.conf.js`
- [Config](https://github.com/yin-hongwei/wangyiyun/blob/master/config/index.js): env config · Development, production, and test environment settings · `config/index.js`

### Tests

Unit and end-to-end test layers

- [Unit Tests](https://github.com/yin-hongwei/wangyiyun/blob/master/test/unit/jest.conf.js): jest · Component and logic unit test layer · `test/unit/jest.conf.js`
- [E2E Tests](https://github.com/yin-hongwei/wangyiyun/blob/master/test/e2e/nightwatch.conf.js): nightwatch · Browser-level route and UI flow tests · `test/e2e/nightwatch.conf.js`

### Other components

- **Netease API**: external backend · Remote music data service consumed over HTTP

## Connections

- index.html → main.js: loads · SPA host page bootstraps the Vue app
- main.js → App: mounts · Application entry mounts the root component
- main.js → Router: installs · Bootstrap wires in client-side navigation
- main.js → Store: installs · Bootstrap attaches shared Vuex state
- main.js → Global Styles: includes · Global styles are loaded into the app
- Router → Home: routes · Home route resolves to the landing view
- Router → Song List: routes · Playlist/detail routes resolve here
- Router → Search: routes · Search route resolves to discovery UI
- Router → Player: routes · Playback route resolves to the player view
- Router → Video: routes · Video route resolves to the video page
- Router → Friends: routes · Social route resolves to friend activity
- Router → User: routes · User route resolves to profile UI
- Router → Settings: routes · Settings route resolves to preferences UI
- App → Header: composes · Root shell includes global header
- App → Footer: composes · Root shell includes global footer
- Home → Swiper: uses · Home view renders featured banner carousel
- Home → Song Sections: uses · Home view is split into recommendation sections
- Home → Song Card: renders · Home recommendations are shown as cards
- Song List → Song Card: renders · Playlist pages use shared list/card presentation
- Player → Audio: uses · Player page drives audio playback component
- Player → Store: syncs · Playback state is coordinated through shared store
- Audio → Store: syncs · Audio control updates shared playback state
- Search → Store: reads · Search results and state are shared through Vuex
- Song Sections → Netease API: fetches · Recommendation sections load remote music data
- Search → Netease API: queries · Search requests go to the remote music API
- Song List → Netease API: fetches · Playlist and detail data are loaded remotely
- Player → Netease API: fetches · Track metadata and lyrics come from the API
- Audio → Netease API: fetches · Playback metadata and audio source depend on API data
- Header → Icons: uses · Global chrome uses shared icon rendering
- Footer → Icons: uses · Footer uses shared icon assets
- Build → Config: reads · Build scripts consume environment settings
- Unit Tests → App: tests · Unit tests exercise components and app logic
- E2E Tests → Router: tests · End-to-end tests validate routed UI flows
