# Radio Free Elsewhere ## Project Overview Radio Free Elsewhere is an Internet radio station streaming eclectic music (Celtic folk, ambient/space, surf rock, and more). It runs on Icecast hosted on a Yunohost server. Streams are live and occasional — a few times per week in the evenings, typically around 7:30pm Eastern, running roughly two hours. This is not a 24/7 automated station. The shows have distinct themes and identities: - **O'Morain's Pub** — Celtic folk - **Cosmoeuphoria** — ambient and space music - **Bisexual Surfers From the Twilight of Time** — surf rock and rockabilly - **The Bollocks** - punk rock - **The Spin** - eclectic tunes from all genres ## Scope This repo covers the **website** — the public pages, the admin backend, and the site's MariaDB database. Icecast configuration, Yunohost server administration, and streaming software are out of scope. Do not look for or suggest changes to server-side streaming config. The one approved exception is [cli/poll_icecast.php](cli/poll_icecast.php), a cron job that reads the Icecast status API to record track history. It only reads from Icecast; it never configures it. ## Key Files Public pages: - [index.php](index.php) — Main page. The sidebar shows the queued (or live) show from the database: icon, name, scheduled start time in Eastern and UTC, and description. The main column has the about section. - [live.php](live.php) — Page to send listeners to while streaming. Player on the left, recently played list on the right; the sidebar background and the heading change with the current show. - [now_playing.php](now_playing.php) — Returns the currently playing track as HTML. Called by `index.php` and `live.php` every 15 seconds. - [recently_played.php](recently_played.php) — Returns the current broadcast's track history as table rows for `live.php`. Admin backend ([admin/](admin/)): - [admin/login.php](admin/login.php), [admin/logout.php](admin/logout.php) — Username/password login. - [admin/index.php](admin/index.php) — Dashboard: broadcast status, queue the next show (with an optional date and Eastern start time), switch the live show, clear the queue. - [admin/shows.php](admin/shows.php), [admin/show_edit.php](admin/show_edit.php) — List, add, edit and delete shows, including the description and icon and background image uploads. Shared includes: - [includes/db.php](includes/db.php) — `getDB()` returns a shared PDO connection (session time zone UTC). - [includes/icecast.php](includes/icecast.php) — Icecast fetching/parsing, album art lookup (iTunes Search API) and Last.fm link helpers. - [includes/broadcasts.php](includes/broadcasts.php) — Broadcast lifecycle, show queueing and track history logic. - [includes/auth.php](includes/auth.php) — Admin sessions, login throttling and CSRF helpers. - [includes/admin_layout.php](includes/admin_layout.php) — `adminHeader()`/`adminFooter()` page chrome and `flash()` messages for admin pages. Command-line tools (run over SSH from the site root): - [cli/poll_icecast.php](cli/poll_icecast.php) — Cron-run poller that records broadcasts and tracks. - [cli/set_show.php](cli/set_show.php) — Lists shows, or queues/sets the show by slug, optionally with a start time (`php cli/set_show.php 2026-10-30 19:30`). Same behaviour as the dashboard control. - [cli/create_admin.php](cli/create_admin.php) — Creates an admin account or resets its password. Other: - [sql/schema.sql](sql/schema.sql) — Full database schema plus seed data for the five shows. Safe to re-run. - [config/db_credentials.example.php](config/db_credentials.example.php) — Template for the gitignored `config/db_credentials.php`. - [SETUP.md](SETUP.md) — Step-by-step guide to installing the site on a Yunohost server, including the poller cron job. ## Architecture - **Backend:** PHP only. No Composer, no package manager, no build step. - **Frontend:** HTML5 UP Strata template with custom CSS additions. No npm, no webpack, no preprocessor — edit CSS directly in `assets/css/main.css` or inline `