Terminal-based dashboard displaying real-time weather forecasts and bank transaction summaries. Built with Rich library for interactive CLI UI.
Architecture: Client application that connects to centralized API Gateway for all weather and location data.
├── main.py # Entry point wrapper
├── app/
│ ├── main.py # Core app logic
│ ├── config.py # Config loader (config.json)
│ ├── banking.py # CSV parser for bank statements
│ ├── weather.py # WeatherService (gateway integration)
│ ├── location.py # LocationService (gateway + WinRT GPS)
│ ├── paths.py # Directory configuration
│ └── ui/
│ ├── layout.py # Rich UI layout builder
│ ├── theme.py # Terminal themes
│ └── utils.py # UI utilities
├── requirements/
│ ├── apikey.py # Gateway credentials (gitignored)
│ ├── apikey_Def.py # Template for API keys
│ ├── gateway.py # Gateway client (JWT auth + API methods)
│ └── config.json # User settings (theme, refresh rate, units)
└── 02_Bankauszüge/ # Bank CSV statements (gitignored)
All external APIs (OpenWeather, Geoapify, IPRegistry) are accessed through the centralized API Gateway at https://api.novaroma-homelab.uk.
Authentication:
- JWT Bearer token authentication
- Automatic token refresh (tokens expire after 1 hour, refresh at 55 minutes)
- Credentials stored in
requirements/apikey.py(gitignored)
Available Methods:
get_hourly_forecast(lat, lon, units)- 48-hour hourly forecastget_daily_forecast(lat, lon, days, units)- Multi-day forecastgeocode(city)- Convert city name to coordinatesget_location_from_ip(ip)- Get location from IP addresssend_email(to, subject, html, from_email)- Send emails via Resendlist_software()- List all registered software with healthget_software(name)- Health for one software (includesstaleflag)push_software_heartbeat(name, health, details)- Push heartbeat (health: ok/warning/error)list_hardware()- List all registered hardware with health + configget_hardware(name)- Health + config for one device (includesstaleflag)push_hardware_heartbeat(name, health, config, details)- Push heartbeat with optional config
WeatherService (app/weather.py):
fetch_hourly()→gateway.get_hourly_forecast()fetch_weekly()→gateway.get_daily_forecast()- Returns: temps, weather icons, wind speed, timestamps
LocationService (app/location.py):
- Location detection fallback chain: WinRT GPS → IPRegistry → Geoapify
_detect_city_from_ip()→gateway.get_location_from_ip()_geocode_city()→gateway.geocode()
CRITICAL: This file is gitignored and contains sensitive data!
# API Gateway Configuration (centralized API access)
GATEWAY_URL = "https://api.novaroma-homelab.uk"
GATEWAY_USERNAME = "..."
GATEWAY_PASSWORD = "..."
# Email configuration (for gateway send_email calls)
email = "Cmd@api.novaroma-homelab.uk"{
"theme": "autumn",
"refresh_minutes": 10,
"units": "metric",
"use_winrt_location": true,
"live_screen": true,
"bank_rows": 2,
"max_hourly_forecast": 12,
"max_weekly_forecast": 7
}Never commit these files:
/requirements/apikey.py- Gateway credentials/requirements/config.json- May contain sensitive settings/02_Bankauszüge/*- Bank statements
main.py → app/main.py
├── LocationService → (WinRT GPS or gateway.get_location_from_ip()) → gateway.geocode()
├── WeatherService → gateway.get_hourly_forecast() + gateway.get_daily_forecast()
└── Banking → Local CSV parsing
↓
UI Rendering (Rich) → Terminal Dashboard
- No API Keys in Client Code: All external API keys stored server-side only
- Centralized Authentication: Single username/password for all services
- Token-Based Security: JWT tokens with automatic refresh and expiration
- Credential Isolation: Only gateway credentials in client code, external API keys never exposed
# Install dependencies
pip install -r requirements.txt
# Run dashboard
python main.pyTest gateway connectivity:
python -c "from requirements.gateway import GatewayClient; from requirements import apikey; g = GatewayClient(apikey.GATEWAY_URL, apikey.GATEWAY_USERNAME, apikey.GATEWAY_PASSWORD); print(g.get_hourly_forecast(51.5074, -0.1278))"Edit requirements/config.json → "theme": "..." (autumn, sunrise, midnight, ocean, desert)
Edit requirements/config.json → "refresh_minutes": 10
- Edit
requirements/apikey.py - Update
GATEWAY_USERNAMEorGATEWAY_PASSWORD - Do NOT commit this file!