A modern iOS stock tracking application built with SwiftUI, demonstrating best practices in iOS development, API integration, and CI/CD workflows.
This project was built to learn and demonstrate:
- β GitHub Actions CI/CD - Automated build, test, and deployment workflows
- β GitHub Projects - Project management and issue tracking
- β API Integration - Real-time stock data from Alpha Vantage API
- β SwiftUI Architecture - Modern iOS UI development patterns
- π iOS Widgets - Live stock data on the home screen (planned)
- β App Preview - Clean, minimal interface for stock tracking
- β Modern iOS Features - iOS 14+ APIs and SwiftUI 2.0+ patterns
- Real-time Stock Data - Live quotes from Alpha Vantage API
- Clean SwiftUI Interface - Modern iOS design patterns
- Secure Configuration - Environment-based API key management
- Error Handling - Comprehensive error states and user feedback
- Performance Optimized - Efficient data loading and UI updates
- Testing Suite - Unit and UI tests with CI/CD integration
- Xcode 15.0+
- iOS 14.0+ target device/simulator
- Alpha Vantage API key (free at alphavantage.co)
-
Clone the repository
git clone https://github.com/davidmatousek/StockWatcher.git cd StockWatcher -
Configure API Key (choose one method):
Option A: Environment Variable (Recommended)
export ALPHA_VANTAGE_API_KEY="your_api_key_here"
Option B: Local Configuration
# Edit StockWatcher/Property Files/Keys.plist # Add your API key under the "AlphaVantageAPIKey" key
-
Build and Run
open StockWatcher.xcodeproj # Or use command line: xcodebuild -project StockWatcher.xcodeproj -scheme StockWatcher -destination 'platform=iOS Simulator,name=iPhone 16' build
- UI Framework: SwiftUI 2.0+
- Reactive Programming: Combine Framework
- Data Persistence: Core Data
- Networking: URLSession with custom REST manager
- API Provider: Alpha Vantage (migrated from IEX Cloud)
StockWatcher/
βββ Models/ # Data models and business logic
βββ Screens/ # SwiftUI views and screens
βββ Managers/ # Network and data managers
βββ Configuration/ # API keys and app configuration
βββ Extensions/ # Swift extensions and utilities
- StockList.swift - Observable stock data management
- RESTManager.swift - Generic networking layer with Combine
- HomeView.swift - Main stock list interface
- DetailView.swift - Individual stock details and charts
# All tests
xcodebuild test -project StockWatcher.xcodeproj -scheme StockWatcher -destination 'platform=iOS Simulator,name=iPhone 16'
# UI Tests only
xcodebuild test -project StockWatcher.xcodeproj -scheme StockWatcher -only-testing:StockWatcherUITests- GitHub Actions workflow runs on all pull requests
- Automated testing on macOS-latest with latest Xcode
- Test environment automatically provides placeholder API keys
- Performance testing included for app launch metrics
- β No hardcoded API keys - Environment variable configuration
- β Safe optional handling - No force unwrapping in production code
- β Comprehensive error handling - User-friendly error messages
- β Modern SwiftUI patterns - Optimized performance and state management
- β Git security - Keys.plist excluded from version control
- All tests passing
- CI/CD pipeline functional
- Error handling comprehensive
- API migration complete (IEX Cloud β Alpha Vantage)
- Migrated from IEX Cloud to Alpha Vantage API
- Implemented secure API key management
- Fixed all SwiftUI anti-patterns and performance issues
- Updated GitHub Actions for modern Xcode versions
- Added comprehensive test environment support
Alpha Vantage API
- Free Tier: 25 requests/day, 5 requests/minute
- Documentation: Alpha Vantage Docs
- Get API Key: Free Registration
This project is available under the MIT License. See the LICENSE file for more info.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
Built with β€οΈ using SwiftUI and modern iOS development practices