PI DASH COMMAND CENTER

PROJECT_STATUS: ACTIVE // DISCORD-CONTROLLED PI KIOSK

01 // PROJECT OVERVIEW Flask + discord.py + Canvas

A Discord-controlled dashboard that runs on a Raspberry Pi with a 3.5" screen. The Pi screen acts as a kiosk display; a Discord bot listens for commands and switches the view in real time. The backend is a single Flask app that serves the web UI, exposes JSON APIs, and runs the Discord bot in a background thread.

All secrets (API keys, tokens, URLs) are passed via environment variables in the deployment yaml — the code itself contains no credentials.

01a // BUILD NOTES Vibe-coded with Kilo Code

I used Kilo Code to vibe-code the entire project. The key lesson was decomposition: breaking work into small, focused tasks let Kilo run them flawlessly for free. Larger, monolithic tasks caused issues, so keeping each step scoped and clear was essential.

02 // FEATURES & COMMANDS Discord-driven

Type !? or !menu in Discord for the live command list. Key views:

Media / ARR

!arr — upcoming airings
!new [days] — grabbed in last N days
!next [days] — upcoming window

Info & Tools

!news [query] — news feed
!weather — local forecast
!system — TrueNAS CPU/RAM/net
!hack <target> — terminal view

Visuals

!rain [speed] — digital rain
!dvd — DVD screensaver
!stars — galaxy fly-through
!image <query> [n] — Pixabay gallery

Interactive

!8ball / !8 — shake + purple magic overlay, answer shown on screen then posted to Discord

03 // ARCHITECTURE Master Router + Iframe Views

[ DATA_FLOW ]
DISCORD BOT
Receives commands, updates global screen state (current_view, query params, etc.)
▼
/api/view-status
JSON endpoint polled by the master router every 2s; returns view + params
▼
index.html (Master Router)
Swaps the iframe src to /{view} and handles overlays (e.g. 8-ball shake/magic)

04 // SOURCE CODE app.py + templates

The main Flask + Discord bot application and the HTML templates it serves. Secrets are read from environment variables at runtime.

▶ VIEW app.py (EMBEDDED)
Loading...

HTML TEMPLATES

Click to download individual view templates (served from templates/ by Flask):

05 // DEPLOYMENT Docker Compose

Runs as a container on the Pi (port 8090). All configuration via env vars in docker-compose. Private values are redacted below.

Required

DISCORD_BOT_TOKEN, SONARR_URL, SONARR_API_KEY (and others as needed)

Optional

PIXABAY_API_KEY, TRUENAS_URL, TRUENAS_API_KEY, API_NINJAS_KEY, WEATHER_LATITUDE/LONGITUDE

▶ VIEW DOCKER-COMPOSE (REDACTED)
services: fresh-dashboard: image: python:3.11-alpine container_name: arr_screen_app restart: unless-stopped ports: # Change the left number if port 8090 is already in use on your host - 8090:8090 volumes: # Change './app' to the path where you saved app.py and project files - ./app:/app working_dir: /app environment: # Set your local timezone (e.g., America/New_York, Europe/London) - TZ=Europe/London # Arr & TrueNAS URLs (replace 192.168.1.165 with your server's IP) - SONARR_URL=http://192.168.1.165:8989/api/v3 - RADARR_URL=http://192.168.1.165:7878/api/v3 - TRUENAS_URL=http://192.168.1.165/api/v2.0 # API Keys & Tokens (found in each app's Settings -> General / API) - SONARR_API_KEY=<your_sonarr_api_key> - RADARR_API_KEY=<your_radarr_api_key> - TRUENAS_API_KEY=<your_truenas_api_key> - DISCORD_BOT_TOKEN=<your_discord_bot_token> - API_NINJAS_KEY=<your_api_ninjas_key> - PIXABAY_API_KEY=<your_pixabay_api_key> # Coordinates for weather widget (e.g., 51.5074, -0.1278) - WEATHER_LATITUDE= - WEATHER_LONGITUDE= # Installs required Python packages on startup and runs the app command: > sh -c "pip install --no-cache-dir flask requests discord.py && python -u app.py"