# zxcvbnmzsedr/alist-course-plugin architecture

> Architecture diagram of the GitHub repository zxcvbnmzsedr/alist-course-plugin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zxcvbnmzsedr/alist-course-plugin
- Repository: https://github.com/zxcvbnmzsedr/alist-course-plugin

## Overview

##### Project Type and Purpose
- The project is a front-end plugin for online course video playback that integrates with an external Alist server for file storage/authentication.
- Its main features are tree-style course directory display, online video playback using artplayer, progress tracking/resume playback, and flexible configuration (course root, server address, access token).

##### File Structure
- The top-level files and folders (like README.md, package.json, index.html) indicate that this is a web application built with Vue 3 and TypeScript.
- The src folder is organized in common sections:
- “api”: Contains files (e.g., alist.ts) used to interact with the external Alist API.
- “router”: Contains routing logic for navigating between views (config view, course list, single course view).
- “stores”: Implements state management (e.g., progress tracking, alist-specific state) that likely uses Vue’s composition and/or Pinia.
- “views”: Contains high-level pages where different UI components are composed.
- “utils” and “types”: Utility functions and type definitions to ensure robust coding practices.
- Configuration files (e.g., vite.config.ts, uno.config.ts) highlight that the project is built with modern tooling and has clear separation of code modules.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend UI Layer
    subgraph "Frontend UI Layer"
        UI1["CourseDirectory Component"]:::ui
        UI2["VideoPlayer Component"]:::ui
        UI3["TextEditor Component"]:::ui
        UI4["Icons"]:::ui
        V1["Config View"]:::ui
        V2["Course List View"]:::ui
        V3["Course View"]:::ui
        R["Routing Module"]:::ui
    end

    %% Business Logic & State Management
    subgraph "Business Logic & State Management"
        S1["Alist Store"]:::bus
        S2["Progress Store"]:::bus
        U1["File Type Utilities"]:::bus
        U2["Progress Management Utilities"]:::bus
    end

    %% API Integration Layer
    subgraph "API Integration Layer"
        A1["Alist API Module"]:::api
    end

    %% External Services
    subgraph "External Services"
        E1["External Alist Service"]:::external
    end

    %% Connections between layers
    UI1 -->|"triggersNavigation"| R
    R -->|"loads"| V2
    R -->|"loads"| V3
    R -->|"configures"| V1

    UI1 -->|"updatesStore"| S1
    UI2 -->|"tracksProgress"| S2
    UI3 -->|"editsContent"| S2

    V1 -->|"sendsConfig"| A1

    S1 -->|"callsAPI"| A1
    S2 -->|"callsAPI"| A1

    A1 -->|"communicates"| E1

    S1 -->|"processFileType"| U1
    S2 -->|"manageProgress"| U2

    %% Click Events
    click UI1 "https://github.com/zxcvbnmzsedr/alist-course-plugin/blob/main/src/components/CourseDirectory.vue"
    click UI2 "https://github.com/zxcvbnmzsedr/alist-course-plugin/blob/main/src/components/VideoPlayer.vue"
    click UI3 "https://github.com/zxcvbnmzsedr/alist-course-plugin/blob/main/src/components/TextEditor.vue"
    click UI4 "https://github.com/zxcvbnmzsedr/alist-course-plugin/tree/main/src/components/icons"
    click V1 "https://github.com/zxcvbnmzsedr/alist-course-plugin/blob/main/src/views/ConfigView.vue"
    click V2 "https://github.com/zxcvbnmzsedr/alist-course-plugin/blob/main/src/views/CourseListView.vue"
    click V3 "https://github.com/zxcvbnmzsedr/alist-course-plugin/blob/main/src/views/CourseView.vue"
    click R "https://github.com/zxcvbnmzsedr/alist-course-plugin/blob/main/src/router/index.ts"
    click A1 "https://github.com/zxcvbnmzsedr/alist-course-plugin/blob/main/src/api/alist.ts"
    click S1 "https://github.com/zxcvbnmzsedr/alist-course-plugin/blob/main/src/stores/alist.ts"
    click S2 "https://github.com/zxcvbnmzsedr/alist-course-plugin/blob/main/src/stores/progressStore.ts"
    click U1 "https://github.com/zxcvbnmzsedr/alist-course-plugin/blob/main/src/utils/filetype.ts"
    click U2 "https://github.com/zxcvbnmzsedr/alist-course-plugin/blob/main/src/utils/progressManager.ts"

    %% Styles
    classDef ui fill:#AEDFF7,stroke:#1E81B0,stroke-width:2px;
    classDef bus fill:#B2F2BB,stroke:#40C057,stroke-width:2px;
    classDef api fill:#FFD3B6,stroke:#FF8C42,stroke-width:2px;
    classDef external fill:#FFABAB,stroke:#FF5252,stroke-width:2px;
```
