# magnus-encoded/station-to-station architecture

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

- Interactive diagram: https://gitdiagram.com/magnus-encoded/station-to-station
- Repository: https://github.com/magnus-encoded/station-to-station

## Overview

Station to Station is a pair of native apps for recording concert attendance as a timeline, planning future gigs, and connecting concert histories with friends. The principal workflow is to add or import a gig, persist its attendance and setlist data, then explore it on the timeline; adjacent flows support tickets, setlists, playlists, and media. Friends exchange identities and gig information phone-to-phone, while setlist.fm and Spotify provide external services. The graph emphasizes documented workflows and indexed module references; some subsystem links are omitted because their implementation was not sampled.

Main entry points: [`ios/StationToStation/Data/TimelineStore.swift`](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/TimelineStore.swift) (Timeline store), [`ios/StationToStation/Data/SetlistFm/SetlistFmClient.swift`](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/SetlistFm/SetlistFmClient.swift) (setlist.fm client), [`ios/StationToStation/Features/Contacts/ContactsController.swift`](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Features/Contacts/ContactsController.swift) (Contacts), [`ios/StationToStation/Features/Gig/GigController.swift`](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Features/Gig/GigController.swift) (Gig records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Gig experience"]
  node_android_app["Android app<br/>[MainActivity.kt]"]
  node_ios_app["iOS app<br/>[App.swift]"]
  node_gig["Gig records"]
  node_tickets["Ticket handling"]
  node_photos["Gig photos<br/>[PhotoLibrary.swift]"]
end

subgraph group_timeline["Timeline and planning"]
  node_planning["Gig planning"]
  node_timeline_logic["Timeline logic"]
  node_timeline_store[("Timeline store")]
end

subgraph group_connections["Friends and exchange"]
  node_contacts["Contacts"]
  node_exchange["Peer exchange"]
  node_gossip["Gossip presence"]
end

subgraph group_music["Setlists and playlists"]
  node_setlists["Setlist workflows"]
  node_setlist_api["setlist.fm client"]
  node_playlist["Playlist creation"]
  node_spotify["Spotify client"]
  node_musicbrainz["MusicBrainz lookup"]
end

subgraph group_platform["Platform services"]
  node_settings[("Settings and credentials<br/>[Settings.swift]")]
end

node_user(("Concertgoer"))
node_setlist_service["setlist.fm"]
node_spotify_service["Spotify"]
node_musicbrainz_service["MusicBrainz"]
node_nearby_devices(("Nearby phones"))

node_user -->|"uses"| node_ios_app
node_user -->|"uses"| node_android_app
node_ios_app -.->|"routes actions"| node_gig
node_gig -->|"saves attendance"| node_timeline_store
node_gig -.->|"fetches setlist"| node_setlist_api
node_gig -->|"manages media"| node_photos
node_planning -->|"creates planned gigs"| node_timeline_store
node_planning -->|"notifies contacts"| node_gossip
node_timeline_store -.->|"stores timeline facts"| node_timeline_logic
node_contacts -->|"loads friend attendance"| node_setlist_api
node_contacts -->|"merges nights"| node_timeline_store
node_contacts -.->|"exchanges contacts"| node_exchange
node_nearby_devices -->|"shares peer-to-peer"| node_exchange
node_contacts -->|"deletes received media"| node_photos
node_gossip -->|"reads gig state"| node_timeline_store
node_setlists -->|"searches and fetches"| node_setlist_api
node_setlists -->|"stores lookup results"| node_timeline_store
node_setlist_api -->|"requests API"| node_setlist_service
node_playlist -.->|"creates playlists"| node_spotify
node_spotify -->|"requests API"| node_spotify_service
node_setlists -.->|"resolves artists"| node_musicbrainz
node_musicbrainz -.->|"looks up artists"| node_musicbrainz_service
node_setlist_api -->|"gets API key"| node_settings
node_spotify -.->|"reads credentials"| node_settings

click node_android_app "https://github.com/magnus-encoded/station-to-station/blob/main/android/app/src/main/java/io/github/magnusencoded/stationtostation/MainActivity.kt"
click node_ios_app "https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/App.swift"
click node_gig "https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Features/Gig/GigController.swift"
click node_tickets "https://github.com/magnus-encoded/station-to-station/tree/main/ios/StationToStation/Data/Ticket"
click node_photos "https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/PhotoLibrary.swift"
click node_planning "https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Features/Planning/PlanningController.swift"
click node_timeline_logic "https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/TimelineLogic.swift"
click node_timeline_store "https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/TimelineStore.swift"
click node_contacts "https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Features/Contacts/ContactsController.swift"
click node_exchange "https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/Exchange/ContactExchange.swift"
click node_gossip "https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Features/Gossip/GossipController.swift"
click node_setlists "https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Features/Setlists/SetlistsController.swift"
click node_setlist_api "https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/SetlistFm/SetlistFmClient.swift"
click node_playlist "https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Features/Playlist/PlaylistController.swift"
click node_spotify "https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/Spotify/SpotifyClient.swift"
click node_musicbrainz "https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/MusicBrainzClient.swift"
click node_settings "https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/Settings.swift"

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_android_app,node_ios_app,node_gig,node_tickets,node_photos toneBlue
class node_planning,node_timeline_logic,node_timeline_store toneAmber
class node_contacts,node_exchange,node_gossip toneMint
class node_setlists,node_setlist_api,node_playlist,node_spotify,node_musicbrainz toneRose
class node_settings,node_user,node_setlist_service,node_spotify_service,node_musicbrainz_service,node_nearby_devices toneIndigo
```

## Components

### Gig experience

- [Android app](https://github.com/magnus-encoded/station-to-station/blob/main/android/app/src/main/java/io/github/magnusencoded/stationtostation/MainActivity.kt): `android/app/src/main/java/io/github/magnusencoded/stationtostation/MainActivity.kt`
- [iOS app](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/App.swift): `ios/StationToStation/App.swift`
- [Gig records](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Features/Gig/GigController.swift): `ios/StationToStation/Features/Gig/GigController.swift`
- [Ticket handling](https://github.com/magnus-encoded/station-to-station/tree/main/ios/StationToStation/Data/Ticket): `ios/StationToStation/Data/Ticket`
- [Gig photos](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/PhotoLibrary.swift): `ios/StationToStation/Data/PhotoLibrary.swift`

### Timeline and planning

- [Gig planning](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Features/Planning/PlanningController.swift): `ios/StationToStation/Features/Planning/PlanningController.swift`
- [Timeline logic](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/TimelineLogic.swift): `ios/StationToStation/Data/TimelineLogic.swift`
- [Timeline store](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/TimelineStore.swift): `ios/StationToStation/Data/TimelineStore.swift`

### Friends and exchange

- [Contacts](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Features/Contacts/ContactsController.swift): `ios/StationToStation/Features/Contacts/ContactsController.swift`
- [Peer exchange](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/Exchange/ContactExchange.swift): `ios/StationToStation/Data/Exchange/ContactExchange.swift`
- [Gossip presence](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Features/Gossip/GossipController.swift): `ios/StationToStation/Features/Gossip/GossipController.swift`

### Setlists and playlists

- [Setlist workflows](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Features/Setlists/SetlistsController.swift): `ios/StationToStation/Features/Setlists/SetlistsController.swift`
- [setlist.fm client](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/SetlistFm/SetlistFmClient.swift): `ios/StationToStation/Data/SetlistFm/SetlistFmClient.swift`
- [Playlist creation](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Features/Playlist/PlaylistController.swift): `ios/StationToStation/Features/Playlist/PlaylistController.swift`
- [Spotify client](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/Spotify/SpotifyClient.swift): `ios/StationToStation/Data/Spotify/SpotifyClient.swift`
- [MusicBrainz lookup](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/MusicBrainzClient.swift): `ios/StationToStation/Data/MusicBrainzClient.swift`

### Platform services

- [Settings and credentials](https://github.com/magnus-encoded/station-to-station/blob/main/ios/StationToStation/Data/Settings.swift): `ios/StationToStation/Data/Settings.swift`

### Other components

- **Concertgoer**
- **setlist.fm**
- **Spotify**
- **MusicBrainz**
- **Nearby phones**

## Connections

- Concertgoer → iOS app: uses (evidence: `README.md`)
- Concertgoer → Android app: uses (evidence: `README.md`)
- iOS app → Gig records: routes actions
- Gig records → Timeline store: saves attendance (evidence: `ios/StationToStation/Features/Gig/GigController.swift`)
- Gig records → setlist.fm client: fetches setlist (evidence: `ios/StationToStation/Features/Gig/GigController.swift`)
- Gig records → Gig photos: manages media (evidence: `ios/StationToStation/Features/Gig/GigController.swift`)
- Gig planning → Timeline store: creates planned gigs (evidence: `ios/StationToStation/Features/Planning/PlanningController.swift`)
- Gig planning → Gossip presence: notifies contacts (evidence: `ios/StationToStation/Features/Planning/PlanningController.swift`)
- Timeline store → Timeline logic: stores timeline facts (evidence: `ios/StationToStation/Data/TimelineLogic.swift`)
- Contacts → setlist.fm client: loads friend attendance (evidence: `ios/StationToStation/Features/Contacts/ContactsController.swift`)
- Contacts → Timeline store: merges nights (evidence: `ios/StationToStation/Features/Contacts/ContactsController.swift`)
- Contacts → Peer exchange: exchanges contacts (evidence: `ios/StationToStation/Features/Contacts/ContactsController.swift`)
- Nearby phones → Peer exchange: shares peer-to-peer (evidence: `README.md`)
- Contacts → Gig photos: deletes received media (evidence: `ios/StationToStation/Features/Contacts/ContactsController.swift`)
- Gossip presence → Timeline store: reads gig state (evidence: `ios/StationToStation/Features/Gossip/GossipController.swift`)
- Setlist workflows → setlist.fm client: searches and fetches (evidence: `ios/StationToStation/Features/Setlists/SetlistsController.swift`)
- Setlist workflows → Timeline store: stores lookup results (evidence: `ios/StationToStation/Features/Setlists/SetlistsController.swift`)
- setlist.fm client → setlist.fm: requests API (evidence: `ios/StationToStation/Data/SetlistFm/SetlistFmClient.swift`)
- Playlist creation → Spotify client: creates playlists (evidence: `ios/StationToStation/Features/Playlist/PlaylistController.swift`)
- Spotify client → Spotify: requests API (evidence: `ios/StationToStation/Data/Spotify/SpotifyClient.swift`)
- Setlist workflows → MusicBrainz lookup: resolves artists (evidence: `ios/StationToStation/Features/Setlists/SetlistsController.swift`)
- MusicBrainz lookup → MusicBrainz: looks up artists
- setlist.fm client → Settings and credentials: gets API key (evidence: `ios/StationToStation/Data/SetlistFm/SetlistFmClient.swift`)
- Spotify client → Settings and credentials: reads credentials (evidence: `ios/StationToStation/Data/Spotify/SpotifyClient.swift`)
