A clean architecture C++ application for Raspberry Pi LED matrix displays. Shows real-time statistics from YouTube and Spotify, plus audio level monitoring.
- dB Meter: Interactive audio level monitoring with visual indicators and real-time input
- YouTube Stats: Channel subscriber count, views, and video count
- Spotify Stats: Artist popularity, albums, and top tracks
- Interactive Input: Real-time numeric input for dB values (0-120)
- Clean Architecture: Modular, testable, and maintainable code
./build.sh -r./build.sh./build.sh -rlStats Boards/
├── core/ # Core shared functionality
│ ├── network/ # Network infrastructure
│ ├── arg_parser.* # Command line argument parsing
│ ├── blink_manager.* # Blinking animation utilities
│ ├── border_renderer.* # Border rendering utilities
│ ├── color_utils.* # Color manipulation utilities
│ ├── config.* # Application configuration
│ ├── input_handler.* # Terminal input handling
│ ├── numeric_input_handler.* # Reusable numeric input handler
│ ├── rotating_text.* # Text rotation utilities
│ ├── main_app.* # Main application controller
│ └── main.cc # Application entry point
├── features/ # Feature modules (Clean Architecture)
│ ├── db_meter/ # Audio monitoring feature
│ │ ├── domain/ # Domain layer
│ │ │ └── entities/ # Domain entities (DbColorCalculator)
│ │ └── presentation/ # Presentation layer
│ │ ├── pages/ # App controllers (DbMeterApp)
│ │ └── widgets/ # UI components (DbDisplay)
│ ├── youtube_stats/ # YouTube statistics feature
│ │ ├── data/ # Data layer
│ │ │ ├── datasources/ # API implementations
│ │ │ └── repositories/ # Repository implementations
│ │ ├── domain/ # Domain layer
│ │ │ ├── entities/ # Domain entities
│ │ │ ├── repositories/ # Repository interfaces
│ │ │ └── usecases/ # Business logic
│ │ └── presentation/ # Presentation layer
│ │ ├── pages/ # App controllers
│ │ ├── widgets/ # UI components
│ │ └── providers/ # State management
│ └── spotify_stats/ # Spotify statistics feature
│ ├── data/ # Data layer
│ ├── domain/ # Domain layer
│ └── presentation/ # Presentation layer
├── build/ # Build artifacts (auto-created)
├── build.sh # Main build script
├── Makefile # Make configuration
├── CMakeLists.txt # CMake configuration
├── API_SETUP.md # API setup guide
└── README.md # This file
./build/led_matrix_apps -b 8 # 80% brightness
./build/led_matrix_apps -b 1 # 10% brightness (dim)
./build/led_matrix_apps -b 10 # 100% brightness (bright)db- dB Meter (audio level monitoring with interactive input)youtube- YouTube Counter (channel statistics)spotify- Spotify Counter (artist statistics)back- Return to main menuquit- Exit application
When in dB Meter mode:
- Type numbers (0-120) - Set dB value directly
- Type
r- Reset to default value - Type
back- Return to main menu - Real-time feedback - See border changes as you type
For detailed API setup instructions, see API_SETUP.md.
YouTube API:
export YOUTUBE_API_KEY="your_api_key_here"Spotify API:
export SPOTIFY_CLIENT_ID="your_client_id"
export SPOTIFY_CLIENT_SECRET="your_client_secret"Note: API setup is optional. The dB Meter works without any API configuration.
- Raspberry Pi with LED matrix hardware
- RGB Matrix Library
- C++11 compatible compiler
- libcurl (for API features)
-
Install RGB Matrix Library:
git clone https://github.com/hzeller/rpi-rgb-led-matrix.git cd rpi-rgb-led-matrix make -
Install dependencies:
sudo apt-get install libcurl4-openssl-dev
-
Build the application:
./build.sh
This project follows Clean Architecture principles:
- Core: Shared functionality across features (network, input handling, utilities)
- Features: Self-contained modules with layered architecture:
- Domain: Entities, business logic (DbColorCalculator, etc.)
- Data: API implementations, data sources (YouTube/Spotify APIs)
- Presentation: Controllers, UI components (Apps, Displays)
- Reusable Components: NumericInputHandler, BlinkManager, ColorUtils
- Dependency Inversion: Core components are independent and reusable
- Separation of Concerns: Each component has a single responsibility
- Create feature directory:
features/your_feature/ - Add domain layer:
features/your_feature/domain/- Entities:
domain/entities/ - Repository interfaces:
domain/repositories/ - Use cases:
domain/usecases/
- Entities:
- Add data layer:
features/your_feature/data/- Datasources:
data/datasources/ - Models:
data/models/ - Repository implementations:
data/repositories/
- Datasources:
- Add presentation layer:
features/your_feature/presentation/- Pages (controllers):
presentation/pages/ - Widgets (UI):
presentation/widgets/ - Providers (state):
presentation/providers/
- Pages (controllers):
- Update build files: Add new source files to
build.sh,Makefile,CMakeLists.txt - Update main application: Add feature to
main_app.cpp
- Clean build:
make clean && ./build.sh - Fast build:
make fast(incremental) - Debug build:
make debug - Run after build:
./build.sh -r - Run last build:
./build.sh -rl
This project is open source and available under the MIT License.