# truemyst/beatprints architecture

> Architecture diagram of the GitHub repository truemyst/beatprints, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/truemyst/beatprints
- Repository: https://github.com/truemyst/beatprints

## Overview

##### Main Components

a. Core Components:
- Spotify Integration Module
- Lyrics Processing Module
- Poster Generation Module
- Image Processing Module
- CLI Interface

b. External Services:
- Spotify Web API
- LRClib API
- File System (for assets and output)

**┌─ User Interface Layer ─────────────────────┐**
- CLI Interface                              │
- (cli/*.py)                                │
- Application Layer ──────────────────────┐ │
- ┌─ Core Services ─────────────────────┐  │ │
- Poster Generator                  │  │ │
- Lyrics Processor                  │  │ │
- Image Processor                   │  │ │
- Spotify Client                    │  │ │
- ┘  │ │
- ┌─ Asset Management ───────────────────┐  │ │
- Fonts                             │  │ │
- Templates                         │  │ │
- ┘  │ │
- ┘

##### Component Relationships

- User → CLI → Spotify Client → Spotify Web API
- CLI → Lyrics Processor → LRClib API
- Poster Generator ← Image Processor
- Asset Management → Poster Generator

##### Specific Implementation Details

- The modular structure reflected in the BeatPrints/ directory
- Configuration management (environment variables)
- Multi-language support system
- Theme customization capability
- Error handling flow

##### Key Files to Reference

Key components:
- BeatPrints/spotify.py (API integration)
- BeatPrints/lyrics.py (lyrics processing)
- BeatPrints/poster.py (poster generation)
- BeatPrints/image.py (image processing)
- cli/prompt.py (user interaction)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph UI
        CLI["CLI Interface"]
        Validate["Input Validation"]
        Config["Configuration Management"]
    end

    subgraph Core
        SpotifyMod["Spotify Integration"]
        LyricsMod["Lyrics Processing"]
        PosterMod["Poster Generation"]
        ImageMod["Image Processing"]
        WriteMod["Writing/Output"]
        ErrorMod["Error Handling"]
        Utils["Utility Functions"]
        Consts["Constants"]
    end

    subgraph Assets
        Fonts["Font Assets"]
        Templates["Template Assets"]
    end

    subgraph External
        SpotifyAPI["Spotify Web API"]
        LRClib["LRClib API"]
        FileSystem["File System"]
    end

    %% Relationships
    CLI --> Validate
    CLI --> Config
    CLI --> SpotifyMod
    CLI --> LyricsMod
    CLI --> PosterMod

    SpotifyMod --> SpotifyAPI
    LyricsMod --> LRClib
    
    PosterMod --> ImageMod
    PosterMod --> Fonts
    PosterMod --> Templates
    
    ImageMod --> WriteMod
    WriteMod --> FileSystem

    ErrorMod -.-> CLI
    Utils -.-> Core
    Consts -.-> Core

    %% Click events
    click CLI "https://github.com/TrueMyst/BeatPrints/blob/main/cli/prompt.py"
    click Validate "https://github.com/TrueMyst/BeatPrints/blob/main/cli/validate.py"
    click Config "https://github.com/TrueMyst/BeatPrints/blob/main/cli/conf.py"
    click SpotifyMod "https://github.com/TrueMyst/BeatPrints/blob/main/BeatPrints/spotify.py"
    click LyricsMod "https://github.com/TrueMyst/BeatPrints/blob/main/BeatPrints/lyrics.py"
    click PosterMod "https://github.com/TrueMyst/BeatPrints/blob/main/BeatPrints/poster.py"
    click ImageMod "https://github.com/TrueMyst/BeatPrints/blob/main/BeatPrints/image.py"
    click WriteMod "https://github.com/TrueMyst/BeatPrints/blob/main/BeatPrints/write.py"
    click ErrorMod "https://github.com/TrueMyst/BeatPrints/blob/main/BeatPrints/errors.py"
    click Utils "https://github.com/TrueMyst/BeatPrints/blob/main/BeatPrints/utils.py"
    click Consts "https://github.com/TrueMyst/BeatPrints/blob/main/BeatPrints/consts.py"
    click Fonts "https://github.com/TrueMyst/BeatPrints/tree/main/BeatPrints/assets/fonts/"
    click Templates "https://github.com/TrueMyst/BeatPrints/tree/main/BeatPrints/assets/templates/"

    %% Styling
    classDef ui fill:#2374ab
    classDef core fill:#48a9a6
    classDef external fill:#e4cc37
    classDef assets fill:#d3d3d3
    classDef error fill:#d64933

    class CLI,Validate,Config ui
    class SpotifyMod,LyricsMod,PosterMod,ImageMod,WriteMod,Utils,Consts core
    class SpotifyAPI,LRClib,FileSystem external
    class Fonts,Templates assets
    class ErrorMod error
```
