ποΈ microservicematrix
microservicematrix is a modular suite of Python-based microservices that collect, normalize, and publish data from various internet and local sourcesβdesigned for a 128Γ64 RGB LED matrix (Tidbyt-style) but decoupled for flexible display targets.
Extracted data is transformed and then published as update events via Redis Pub/Sub. Consumers like matrixclient and nodewebdisplay render the content in real time or generate static BMPs for testing and archival.
All services are containerized for Kubernetes deployment and are tightly integrated with:
- π
secretmanagerβ secure, multi-source config management (available on PyPI) - π§©
MicroServiceβ uniform abstraction for service logic and configuration
π Service Overview
Each service is a subclass of MicroService, and can run as a long-lived process or invoked in one-shot mode. Configuration is sourced via secretmanager and managed using Kubernetes secrets and YAML deployments.
| Service | Source File | Description | Data Source | Interval |
|---|---|---|---|---|
| AQI | aqi.py |
Air quality index for configured Lat/Long | OpenWeatherMap | 15 min |
| Moon | moon.py |
Moon phase, illumination %, sunrise/set, moonrise/set | MET Norway | 1 hr |
| Weather | weather.py |
Current conditions and forecast (hourly/daily) | OpenWeatherMap | 15 min |
| MyCal | mycal.py |
Personal calendar events (private feed) | Google Calendar | 15 min |
| Events | events.py |
Recurring family events (birthdays, anniversaries) | Static JSON or Google | 24 hr |
| GitHub | github.py |
Repo activity, PR/build status | GitHub API | 30 min |
| MLB | mlb.py |
Baseball scores and daily schedule | ESPN MLB API | Variable* |
| NFL | nfl.py |
Football scores and weekly schedule | ESPN NFL API | 5 min |
| Garmin | garmin.py |
Personal Locator Beacon tracking | Garmin location feed | 1 hr |
* MLB polling logic:
At 11:30 AM EDT, the service checks the day's schedule. It then:
- Sleeps until the first game starts
- Polls every 30 seconds during games
- Sleeps again after the final game ends
π Quick Start (Dev)
Each service will run politely from the commandline - writing to its configured database and pushing Redis updates (if desired).
git clone https://github.com/dekeyrej/microservicematrix
cd microservicematrix
# normal virtual environment tasks
python moon.py
To build and push the container images you can either modify the github/workflows for your environment, or use build.sh and builds.txt in the utilities folders. Build.sh reads builds.txt (which is simply a list of the services to build) and builds an image and pushes it to the registry of your choice.
Once pushed, the microservices can be deployed with:
kubectl apply -f yaml/
Secrets can be passed via secrets.json, .env, Kubernetes secrets, or AES-256 encrypted Kubernetes secrets Vault Transit decrypted - depending on your SecretManager configuration.
π Related Repositories
- β Service abstraction layer and CLI-ready page system
- β Lightweight multi-backend data access and persistence
- β Unified API for secrets from env, file, or Kubernetes
- β RGB LED matrix renderer (hardware and BMP mode)
- β Frontend for live display via SSE/Redis
- β Homelab orchestration and provisioning roles/playbooks
π Project Evolution
-
Initial β Single-service Red Sox game display on ESP32 with CircuitPython
-
V1 β Monolithic Pi client with local and remote data streams
-
V2 β Split into client/server with basic data transport
-
V3 β WebSocket support and browser-based clients
-
V4 β Migration to database-centric transport with Docker & Kubernetes
-
Current β Modular Python microservices with CLI, Redis pub/sub, and multiple display targets