# epoupon/lms architecture

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

- Interactive diagram: https://gitdiagram.com/epoupon/lms
- Repository: https://github.com/epoupon/lms

## Overview

##### Main Components

A. Frontend Layer:
- Web Interface (Wt-based UI components in src/lms/ui/)
- Media Player Component
- Explore/Browse Interface
- Admin Interface
- Authentication UI

B. Backend Services Layer:
- Authentication Service (src/libs/services/auth/)
- Artwork Service (src/libs/services/artwork/)
- Scanner Service (src/libs/services/scanner/)
- Recommendation Service (src/libs/services/recommendation/)
- Scrobbling Service (src/libs/services/scrobbling/)
- Feedback Service (src/libs/services/feedback/)

C. Core Components:
- Database Layer (src/libs/database/)
- Metadata Processing (src/libs/metadata/)
- Audio Processing (src/libs/av/)
- Image Processing (src/libs/image/)
- Core Utilities (src/libs/core/)

D. External Integrations:
- ListenBrainz Integration
- Subsonic/OpenSubsonic API
- Authentication Backends (PAM, Internal)

##### Relationships

- User requests flow from Frontend → Backend Services
- Service dependencies between components
- Data flow between services and core components
- External service integration points

##### Design Elements

**[Frontend Layer]**
- ↑↓
**[API Layer (Subsonic/REST)]**
- ↑↓
**[Service Layer]**
- ↑↓
**[Core Components]**
- ↑↓
**[Storage Layer]**

##### Important Details

A. Data Flow:
- Music file processing pipeline
- Authentication flow
- Recommendation engine process
- Scrobbling/feedback synchronization

B. Storage:
- Music file storage
- Database storage
- Cache storage (artwork, transcoding)

C. Security Boundaries:
- Authentication checkpoints
- User permission boundaries
- API security layers

##### Specific Implementation Notes

- Wt framework integration
- Modular service architecture
- Multiple authentication backend options
- Media processing pipeline
- Recommendation engine components

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef service fill:#2ecc71,stroke:#27ae60,color:white
    classDef core fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef auth fill:#e74c3c,stroke:#c0392b,color:white
    classDef resource fill:#9b59b6,stroke:#8e44ad,color:white

    %% Frontend Layer
    subgraph Frontend
        WebUI["Web Interface"]:::frontend
        MediaPlayer["Media Player"]:::frontend
        ExploreUI["Explore Interface"]:::frontend
        AdminUI["Admin Interface"]:::frontend
        AuthUI["Authentication UI"]:::frontend
    end

    %% Resource Layer
    subgraph Resources
        AudioRes["Audio Resources"]:::resource
        ArtworkRes["Artwork Resources"]:::resource
        DownloadRes["Download Resources"]:::resource
    end

    %% Application Core
    AppCore["Main Application"]:::core
    AppManager["Application Manager"]:::core

    %% Backend Services
    subgraph Services
        AuthService["Authentication Service"]:::auth
        ArtworkService["Artwork Service"]:::service
        ScannerService["Scanner Service"]:::service
        RecommendService["Recommendation Service"]:::service
        ScrobbleService["Scrobbling Service"]:::service
        FeedbackService["Feedback Service"]:::service
    end

    %% Core Components
    subgraph Core
        Database["Database Layer"]:::core
        Metadata["Metadata Processing"]:::core
        AudioProc["Audio Processing"]:::core
        ImageProc["Image Processing"]:::core
        CoreUtils["Core Utilities"]:::core
    end

    %% External Integrations
    subgraph External
        ListenBrainz["ListenBrainz"]:::external
        SubsonicAPI["Subsonic API"]:::external
    end

    %% Relationships
    WebUI --> AppCore
    MediaPlayer --> AppCore
    ExploreUI --> AppCore
    AdminUI --> AppCore
    AuthUI --> AppCore

    AppCore --> AppManager
    AppManager --> Services

    Resources --> AppCore

    Services --> Core
    Services --> External

    %% Click Events
    click WebUI "https://github.com/epoupon/lms/tree/master/src/lms/ui/"
    click MediaPlayer "https://github.com/epoupon/lms/blob/master/src/lms/ui/MediaPlayer.hpp"
    click ExploreUI "https://github.com/epoupon/lms/tree/master/src/lms/ui/explore/"
    click AdminUI "https://github.com/epoupon/lms/tree/master/src/lms/ui/admin/"
    click AuthUI "https://github.com/epoupon/lms/blob/master/src/lms/ui/Auth.hpp"
    click AuthService "https://github.com/epoupon/lms/tree/master/src/libs/services/auth/"
    click ArtworkService "https://github.com/epoupon/lms/tree/master/src/libs/services/artwork/"
    click ScannerService "https://github.com/epoupon/lms/tree/master/src/libs/services/scanner/"
    click RecommendService "https://github.com/epoupon/lms/tree/master/src/libs/services/recommendation/"
    click ScrobbleService "https://github.com/epoupon/lms/tree/master/src/libs/services/scrobbling/"
    click FeedbackService "https://github.com/epoupon/lms/tree/master/src/libs/services/feedback/"
    click Database "https://github.com/epoupon/lms/tree/master/src/libs/database/"
    click Metadata "https://github.com/epoupon/lms/tree/master/src/libs/metadata/"
    click AudioProc "https://github.com/epoupon/lms/tree/master/src/libs/av/"
    click ImageProc "https://github.com/epoupon/lms/tree/master/src/libs/image/"
    click CoreUtils "https://github.com/epoupon/lms/tree/master/src/libs/core/"
    click ListenBrainz "https://github.com/epoupon/lms/tree/master/src/libs/services/scrobbling/impl/listenbrainz/"
    click SubsonicAPI "https://github.com/epoupon/lms/tree/master/src/libs/subsonic/"
    click AudioRes "https://github.com/epoupon/lms/blob/master/src/lms/ui/resource/AudioFileResource.hpp"
    click ArtworkRes "https://github.com/epoupon/lms/blob/master/src/lms/ui/resource/ArtworkResource.hpp"
    click DownloadRes "https://github.com/epoupon/lms/blob/master/src/lms/ui/resource/DownloadResource.hpp"
    click AppCore "https://github.com/epoupon/lms/blob/master/src/lms/ui/LmsApplication.hpp"
    click AppManager "https://github.com/epoupon/lms/blob/master/src/lms/ui/LmsApplicationManager.hpp"

    %% Legend
    subgraph Legend
        Frontend_L["Frontend"]:::frontend
        Service_L["Service"]:::service
        Core_L["Core"]:::core
        External_L["External"]:::external
        Auth_L["Auth"]:::auth
        Resource_L["Resource"]:::resource
    end
```
