# Technology Stack

**Analysis Date:** 2026-01-09

## Languages

**Primary:**
- Swift 5.0 - All iOS application code (`SportsTime/*.swift`)

**Secondary:**
- Python 3 - Data scraping and CloudKit import scripts (`Scripts/*.py`)

## Runtime

**Environment:**
- iOS 26.2 deployment target (`SportsTime.xcodeproj/project.pbxproj`)
- Apple Silicon + Intel support

**Package Manager:**
- None (native Xcode project, no SPM/CocoaPods/Carthage)
- Python: pip with `Scripts/requirements.txt`

## Frameworks

**Core:**
- SwiftUI - Primary UI framework (`Features/**/*.swift`)
- UIKit - PDF generation, graphics (`Export/PDFGenerator.swift`)
- Observation - Modern reactive state (`@Observable` ViewModels)

**Data:**
- SwiftData - Local persistence (`Core/Models/Local/*.swift`)
- CloudKit - Remote sync, public database (`Core/Services/CloudKitService.swift`)

**Location & Maps:**
- MapKit - Routing, search, snapshots (`Core/Services/LocationService.swift`, `Export/Services/MapSnapshotService.swift`)
- CoreLocation - Coordinates, geocoding support

**Media:**
- PDFKit - Document generation (`Export/PDFGenerator.swift`)
- Photos/PhotosUI - Photo library access (`Features/Progress/ViewModels/PhotoImportViewModel.swift`)
- ImageIO - Image encoding/decoding

**AI/ML:**
- FoundationModels - On-device AI for route descriptions (`Core/Services/RouteDescriptionGenerator.swift` - currently disabled)

**Security:**
- CryptoKit - Cryptographic operations (`Core/Services/BootstrapService.swift`)

**Testing:**
- Swift Testing - Primary test framework (`SportsTimeTests/*.swift`)
- XCTest - UI tests (`SportsTimeUITests/*.swift`)

**Build/Dev:**
- Xcode 16+ - Build system
- xcodebuild - CLI builds and tests

## Key Dependencies

**Critical:**
- SwiftData - Local data persistence and caching
- CloudKit - Schedule sync and photo backup
- MapKit - Core trip planning (routing, EV charging, POI search)

**Infrastructure:**
- Foundation URLSession - HTTP networking for sports APIs
- Combine - Reactive patterns alongside Observation

**Python Pipeline:**
- requests>=2.28.0 - HTTP client for web scraping
- beautifulsoup4>=4.11.0 - HTML parsing
- pandas>=2.0.0 - Data manipulation
- lxml>=4.9.0 - XML/HTML parsing backend
- cryptography>=41.0.0 - CloudKit import (optional)

## Configuration

**Environment:**
- No .env files required
- CloudKit container configured in entitlements
- Bundle ID: `com.t-t.SportsTime`

**Build:**
- `SportsTime.xcodeproj` - Native Xcode project
- `Info.plist` - App configuration with background modes

**Background Modes:**
- `remote-notification` - Push notifications
- `fetch` - Background refresh
- `processing` - Background tasks

## Platform Requirements

**Development:**
- macOS with Xcode 16+
- iOS Simulator (iPhone 17, iOS 26.2)
- No external dependencies

**Production:**
- iOS 26.2+ deployment target
- CloudKit entitlement required
- Location services permission

---

*Stack analysis: 2026-01-09*
*Update after major dependency changes*
