Welcome to the Timor technical documentation. This documentation provides comprehensive coverage of the architecture, implementation details, and design decisions behind the Timor Spotify playlist manager.
| Document | Description |
|---|---|
| Architecture | System overview, component interactions, threading model |
| Data Models | SwiftData schemas, runtime types, relationships |
| OAuth Flow | Authentication sequence, token management |
| API Reference | Complete API documentation for all public types |
| State Management | Observable patterns, view bindings, state flow |
| Caching | Cache strategy, invalidation, performance |
| Security | Credential storage, certificate pinning, threat model |
graph TB
subgraph "UI Layer"
Views[SwiftUI Views]
end
subgraph "State Layer"
SM[SpotifyManager]
PUM[PlaylistUndoManager]
end
subgraph "API Layer"
SWAPI[SpotifyWebAPI]
RL[RateLimiter]
end
subgraph "Persistence"
SD[(SwiftData)]
KC[(Keychain)]
end
Views --> SM
SM --> SWAPI
SM --> SD
SWAPI --> RL
SWAPI --> KC
All application state flows through SpotifyManager, which:
- Coordinates API calls via
SpotifyWebAPI - Manages local cache via SwiftData
- Provides
@Publishedproperties for SwiftUI bindings - Handles undo/redo via
PlaylistUndoManager
Timor uses an aggressive caching strategy:
- Immediate display — Show cached data instantly
- Background validation — Verify cache via Spotify's snapshot ID
- Selective refresh — Only fetch when cache is stale
- Result: ~80% reduction in API calls
Cross-platform support via compile-time conditionals:
TrackTableView(macOS) vsTrackListView(iOS)- Native dialogs per platform
- Shared business logic (~90%)
For new contributors, we recommend:
- Architecture — Understand the big picture
- Data Models — Learn the data structures
- State Management — Understand reactive patterns
- OAuth Flow — Authentication deep dive
- API Reference — Complete API coverage
- Caching — Performance optimizations
- Security — Security measures
All documentation uses Mermaid diagrams. To view them:
- GitHub — Renders automatically
- VS Code — Install "Markdown Preview Mermaid Support" extension
- Xcode — Use a Markdown preview extension or view on GitHub
Each document follows a consistent structure:
# Title
Overview paragraph
## Concept Overview (with Mermaid diagram)
## Implementation Details
### Subsection with code examples
## Best Practices / Considerations
## Related Documents
When modifying code:
- Check if changes affect documented behavior
- Update relevant diagrams in architecture docs
- Update API reference for signature changes
- Add notes about breaking changes
- Main README — User-facing documentation
- CONTRIBUTING — Contribution guidelines
- SECURITY — Security policy
- LICENSE — MIT License