How cisumapp/cisum works
Purpose and entry points
Cisum is a modular Swift/SwiftUI music client for iOS and macOS. Platform app targets start in iOS/cisum/iOSApp.swift and macOS/cisum/macOSApp.swift, then delegate composition and root UI to Core. iOS also ships a lyrics widget/Live Activity extension under iOS/Lyrics/LyricsLiveActivity.swift.
Application composition and navigation
Core owns application bootstrapping, dependency/service composition, root presentation, navigation state, and deep-link handling. Feature modules should integrate through this boundary rather than construct global services directly.
• Modules/Core/Sources/Core/AppBootstrap.swift
• Modules/Core/Sources/Core/ServicesContainer.swift
• Modules/Core/Sources/Core/RootView.swift
• Modules/Core/Sources/Core/AppRouter.swift
• Modules/Core/Sources/Core/DeepLinkCoordinator.swift
Shared domain and platform foundations
Shared Swift packages define the cross-feature media, provider, playlist, import, playback, and deep-link contracts. Networking centralizes HTTP/auth, Supabase integration, connectivity, and update checks; caching holds reusable media and resolved-playback URL state. These packages form the boundary between feature UI/orchestration and remote or persistent behavior.
• Modules/Shared/Models/Sources/Models/MediaProvider.swift
• Modules/Shared/Models/Sources/Models/MediaRefs.swift
• Modules/Shared/Models/Sources/Models/Playlists/Playlist.swift
• Modules/Shared/Networking/Sources/Networking/NetworkingClient.swift
• Modules/Shared/Networking/Sources/Networking/SupabaseService.swift
• Modules/Shared/Caching/Sources/Caching/MediaCacheStore.swift
Playback pipeline
Player is the primary stateful runtime subsystem. PlayerViewModel coordinates queue, loading, fallback, audio session, lyrics, artwork, and UI presentation. PlaybackEngine drives AVPlayer-level playback; queue persistence restores state; resolvers translate provider media references into playable URLs, including YouTube and provider SDK paths. Player state feeds mini/expanded player UI and likely the lyrics extension.
• Modules/Features/Player/Sources/Player/PlayerViewModel.swift
• Modules/Features/Player/Sources/Player/Controllers/PlaybackEngine.swift
• Modules/Features/Player/Sources/Player/Controllers/QueueManager.swift
• Modules/Features/Player/Sources/Player/PlaybackURLResolver.swift
• Modules/Features/Player/Sources/Player/QueuePersistenceStore.swift
• Modules/Features/Player/Sources/Player/PlayerModule.swift
Discovery, search, and content presentation
Home, Discover, Search, and media-detail modules provide browsing and federated lookup over shared models/providers. Search has its own overlay/controller and history/cache-hint persistence, then results navigate into track, album, artist, and playlist detail wrappers. Reusable visual primitives live separately in Aesthetics.
• Modules/Features/Search/Sources/Search/SearchViewModel.swift
• Modules/Features/Search/Sources/Search/SearchOverlayController.swift
• Modules/Features/Home/Sources/Home/HomeModule.swift
• Modules/Features/Albums/Sources/Albums/AlbumDetailWrapper.swift
• Modules/Features/Artists/Sources/Artists/ArtistDetailWrapper.swift
• Modules/Shared/Aesthetics/Sources/Aesthetics/UI/ArtworkPipeline.swift
Library, playlists, and import/reconciliation
Library manages central media and playlist-facing state. Imports are provider-specific adapters (Apple Music, Spotify, YouTube, local files) selected by a factory and surfaced through progress services/UI. Imported tracks are normalized/reconciled through shared canonical import models before becoming library or playlist data. Playlist-specific stores also support import jobs and share links.
• Modules/Features/Library/Sources/Library/CentralMediaStore.swift
• Modules/Features/Library/Sources/Library/Importing/ImportServicesFactory.swift
• Modules/Features/Library/Sources/Library/Importing/ImportProgressFacade.swift
• Modules/Shared/Models/Sources/Models/Import/CanonicalSongReconciler.swift
• Modules/Features/Playlists/Sources/Playlists/PlaylistLibraryStore.swift
• Modules/Features/Playlists/Sources/Playlists/PlaylistShareLink.swift
Identity, providers, and extensions
Authentication supports Apple sign-in plus persisted YouTube credentials in Keychain. Plugins configure streaming-provider manifests, Spotify session/cache, and Last.fm scrobbling. Radio combines Spotify and YouTube sources through a hybrid provider; Profile maintains listening history and analytics. External integrations materially include Apple Music, Spotify, YouTube, Last.fm, Supabase, AVFoundation, Keychain, and platform audio/media APIs.
• Modules/Features/Authentication/Sources/Authentication/AuthService.swift
• Modules/Features/Authentication/Sources/Authentication/KeychainYouTubeStorage.swift
• Modules/Features/Plugins/Sources/Plugins/SpotifySessionCoordinator.swift
• Modules/Features/Plugins/Sources/Plugins/LastFMScrobbler.swift
• Modules/Features/Radio/Sources/Radio/HybridRadioProvider.swift
• Modules/Features/Profile/Sources/Profile/ListeningHistoryStore.swift
Main entry points: PlayerViewModel.swift Player Runtime · ServicesContainer.swift Services Container · AppBootstrap.swift App Bootstrap · SearchViewModel.swift Discovery & Search
Components 19
App Targets
- iOS App
iOS/cisum/iOSApp.swift - macOS App
macOS/cisum/macOSApp.swift - Lyrics Live Activity
iOS/Lyrics/LyricsLiveActivity.swift
Composition
- App Bootstrap
Modules/Core/Sources/Core/AppBootstrap.swift - Services Container
Modules/Core/Sources/Core/ServicesContainer.swift - Root UI
Modules/Core/Sources/Core/RootView.swift - Router & Deep Links
Modules/Core/Sources/Core/DeepLinkCoordinator.swift
Shared Foundations
- Domain Models · Media, providers, playlists, imports, and deep links.
Modules/Shared/Models/Sources/Models/MediaProvider.swift - Networking · HTTP, authentication, Supabase, connectivity, and updates.
Modules/Shared/Networking/Sources/Networking/NetworkingClient.swift - Media Cache · Caches media and resolved playback URLs.
Modules/Shared/Caching/Sources/Caching/MediaCacheStore.swift
Feature Systems
- Player Runtime · Coordinates queue, loading, fallback, audio, lyrics, artwork, and player UI.
Modules/Features/Player/Sources/Player/PlayerViewModel.swift - Playback Engine
Modules/Features/Player/Sources/Player/Controllers/PlaybackEngine.swift - Playback URL Resolver · Resolves provider references to playable URLs.
Modules/Features/Player/Sources/Player/PlaybackURLResolver.swift - Discovery & Search · Federated search routes results to media details.
Modules/Features/Search/Sources/Search/SearchViewModel.swift - Library & Import · Selects provider adapters and normalizes imported tracks.
Modules/Features/Library/Sources/Library/Importing/ImportServicesFactory.swift - Playlists · Maintains playlist data, import jobs, and share links.
Modules/Features/Playlists/Sources/Playlists/PlaylistLibraryStore.swift - Identity & Provider Plugins · Apple sign-in, YouTube credentials, Spotify session, and Last.fm scrobbling.
Modules/Features/Authentication/Sources/Authentication/AuthService.swift - Radio & Profile · Combines Spotify/YouTube radio with listening history.
Modules/Features/Radio/Sources/Radio/HybridRadioProvider.swift
External Platforms
- Music & Platform APIs · Apple Music, Spotify, YouTube, Last.fm, Supabase, AVFoundation, Keychain, and media APIs.
Connections 24
- iOS App → App Bootstrap: starts
- macOS App → App Bootstrap: starts
- App Bootstrap → Services Container: composes
- App Bootstrap → Root UI: presents
- Root UI → Router & Deep Links: navigates via
- Services Container → Player Runtime: provides
- Services Container → Discovery & Search: provides
- Services Container → Library & Import: provides
- Services Container → Identity & Provider Plugins: provides
- Router & Deep Links → Discovery & Search: routes to
- Discovery & Search → Domain Models: uses
- Discovery & Search → Player Runtime: plays selections
- Library & Import → Domain Models: reconciles into
- Library & Import → Playlists: imports into
- Playlists → Domain Models: uses
- Player Runtime → Playback Engine: controls
- Player Runtime → Playback URL Resolver: resolves media through
- Player Runtime → Media Cache: reads and writes
- Playback URL Resolver → Networking: requests URLs
- Identity & Provider Plugins → Networking: configures access
- Networking → Music & Platform APIs: integrates
- Identity & Provider Plugins → Music & Platform APIs: authenticates and streams
- Radio & Profile → Identity & Provider Plugins: uses provider sessions
- Lyrics Live Activity → Player Runtime: consumes player state