# sourcefabric/airtime architecture

> Architecture diagram of the GitHub repository sourcefabric/airtime, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sourcefabric/airtime
- Repository: https://github.com/sourcefabric/airtime

## Overview

Airtime is a web-based collaborative radio-station management and broadcast-automation application. Station personnel manage media and programming through the web interface; shows are scheduled for timed playback, with Liquidsoap providing playout to broadcast outputs. The graph preserves documented media-library, playlist, smart-block, live-streaming, scheduling, and playout capabilities. Source excerpts establish some API, show-service, and history-service relationships; links for unsampled subsystems are left out or marked unverified.

Main entry points: [`airtime_mvc/application/controllers/ApiController.php`](https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/controllers/ApiController.php) (Station API), [`airtime_mvc/application/services/ShowService.php`](https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/services/ShowService.php) (Show scheduling service), [`airtime_mvc/application/models/Show.php`](https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/Show.php) (Show model), [`airtime_mvc/application/controllers`](https://github.com/sourcefabric/airtime/tree/2.5.x/airtime_mvc/application/controllers) (Management interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Management"]
  node_webapp["Management interface"]
  node_api["Station API<br/>[ApiController.php]"]
  node_access["Authentication and access<br/>[Auth.php]"]
  node_media["Media library<br/>[Library.php]"]
  node_ingest["Media monitoring"]
end

subgraph group_programming["Programming"]
  node_playlists["Playlists and blocks<br/>[Playlist.php]"]
  node_showservice["Show scheduling service<br/>[ShowService.php]"]
  node_showmodel["Show model<br/>[Show.php]"]
  node_scheduler["Automation scheduler<br/>[Scheduler.php]"]
  node_scheduledata["Schedule records"]
end

subgraph group_broadcast["Broadcast Operations"]
  node_history["Playback history<br/>[HistoryService.php]"]
  node_streamconfig["Stream settings<br/>[StreamSetting.php]"]
  node_webstreams["Web streams<br/>[Webstream.php]"]
  node_liquidsoap["Liquidsoap playout"]
  node_outputs(("Broadcast outputs"))
end

subgraph group_persistence["Persistence"]
  node_dbaccess["Database access<br/>[Database.php]"]
  node_db[("Station database<br/>[CcShow.php]")]
end

node_personnel(("Station personnel"))

node_personnel -->|"manages station"| node_webapp
node_webapp -.->|"requests operations"| node_api
node_api -->|"uses show data"| node_showmodel
node_api -->|"records playback"| node_history
node_personnel -->|"adds material"| node_media
node_personnel -->|"creates playlists"| node_playlists
node_personnel -->|"schedules shows"| node_showservice
node_showservice -->|"uses show model"| node_showmodel
node_showservice -->|"queries schedule"| node_scheduledata
node_personnel -->|"configures automation"| node_scheduler
node_scheduler -.->|"dispatches playback"| node_liquidsoap
node_liquidsoap -->|"streams audio"| node_outputs
node_personnel -->|"uses stream URLs"| node_webstreams
node_personnel -.->|"configures streams"| node_streamconfig
node_ingest -.->|"updates library"| node_media
node_api -.->|"reads and writes"| node_dbaccess
node_showmodel -.->|"queries show data"| node_db
node_dbaccess -.->|"accesses records"| node_db

click node_webapp "https://github.com/sourcefabric/airtime/tree/2.5.x/airtime_mvc/application/controllers"
click node_api "https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/controllers/ApiController.php"
click node_access "https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/Auth.php"
click node_media "https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/Library.php"
click node_ingest "https://github.com/sourcefabric/airtime/tree/2.5.x/python_apps/media-monitor"
click node_playlists "https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/Playlist.php"
click node_showservice "https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/services/ShowService.php"
click node_showmodel "https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/Show.php"
click node_scheduler "https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/Scheduler.php"
click node_scheduledata "https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/airtime/CcScheduleQuery.php"
click node_history "https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/services/HistoryService.php"
click node_streamconfig "https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/StreamSetting.php"
click node_webstreams "https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/Webstream.php"
click node_dbaccess "https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/common/Database.php"
click node_db "https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/airtime/CcShow.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_api,node_access,node_media,node_ingest toneBlue
class node_playlists,node_showservice,node_showmodel,node_scheduler,node_scheduledata toneAmber
class node_history,node_streamconfig,node_webstreams,node_liquidsoap,node_outputs toneMint
class node_dbaccess,node_db toneRose
class node_personnel toneIndigo
```

## Components

### Web Management

- [Management interface](https://github.com/sourcefabric/airtime/tree/2.5.x/airtime_mvc/application/controllers): `airtime_mvc/application/controllers`
- [Station API](https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/controllers/ApiController.php): `airtime_mvc/application/controllers/ApiController.php`
- [Authentication and access](https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/Auth.php): `airtime_mvc/application/models/Auth.php`
- [Media library](https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/Library.php): `airtime_mvc/application/models/Library.php`
- [Media monitoring](https://github.com/sourcefabric/airtime/tree/2.5.x/python_apps/media-monitor): `python_apps/media-monitor`

### Programming

- [Playlists and blocks](https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/Playlist.php): `airtime_mvc/application/models/Playlist.php`
- [Show scheduling service](https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/services/ShowService.php): `airtime_mvc/application/services/ShowService.php`
- [Show model](https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/Show.php): `airtime_mvc/application/models/Show.php`
- [Automation scheduler](https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/Scheduler.php): `airtime_mvc/application/models/Scheduler.php`
- [Schedule records](https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/airtime/CcScheduleQuery.php): `airtime_mvc/application/models/airtime/CcScheduleQuery.php`

### Broadcast Operations

- [Playback history](https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/services/HistoryService.php): `airtime_mvc/application/services/HistoryService.php`
- [Stream settings](https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/StreamSetting.php): `airtime_mvc/application/models/StreamSetting.php`
- [Web streams](https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/Webstream.php): `airtime_mvc/application/models/Webstream.php`
- **Liquidsoap playout**
- **Broadcast outputs**

### Persistence

- [Database access](https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/common/Database.php): `airtime_mvc/application/common/Database.php`
- [Station database](https://github.com/sourcefabric/airtime/blob/2.5.x/airtime_mvc/application/models/airtime/CcShow.php): `airtime_mvc/application/models/airtime/CcShow.php`

### Other components

- **Station personnel**

## Connections

- Station personnel → Management interface: manages station (evidence: `README`)
- Management interface → Station API: requests operations
- Station API → Show model: uses show data (evidence: `airtime_mvc/application/controllers/ApiController.php`)
- Station API → Playback history: records playback (evidence: `airtime_mvc/application/controllers/ApiController.php`)
- Station personnel → Media library: adds material (evidence: `README`)
- Station personnel → Playlists and blocks: creates playlists (evidence: `README`)
- Station personnel → Show scheduling service: schedules shows (evidence: `README`)
- Show scheduling service → Show model: uses show model (evidence: `airtime_mvc/application/services/ShowService.php`)
- Show scheduling service → Schedule records: queries schedule (evidence: `airtime_mvc/application/services/ShowService.php`)
- Station personnel → Automation scheduler: configures automation (evidence: `README`)
- Automation scheduler → Liquidsoap playout: dispatches playback
- Liquidsoap playout → Broadcast outputs: streams audio (evidence: `README`)
- Station personnel → Web streams: uses stream URLs (evidence: `README`)
- Station personnel → Stream settings: configures streams
- Media monitoring → Media library: updates library
- Station API → Database access: reads and writes
- Show model → Station database: queries show data
- Database access → Station database: accesses records
