|
|
||
|---|---|---|
| .. | ||
| TradingDummy | ||
| TradingDummy.xcodeproj | ||
| TradingDummyTests | ||
| TradingDummyUITests | ||
| README.md | ||
README.md
TradingDummy iOS App - Project Structure
Overview
The iOS app is now organized following MVVM architecture with clear separation of concerns.
Directory Structure
TradingDummy/
├── Configuration/
│ └── AppConfig.swift # App-wide configuration (API URLs, timeouts)
├── Models/
│ └── AnalysisModels.swift # Data models (Request/Response)
├── Services/
│ └── TradingAgentsService.swift # API service layer
├── ViewModels/
│ └── TradingAnalysisViewModel.swift # Business logic
├── Views/
│ ├── TradingAnalysisView.swift # Main view
│ ├── AnalysisResultView.swift # Result display components
│ └── SupportingViews.swift # Loading, Error, Welcome views
├── TradingDummyApp.swift # App entry point
└── ContentView.swift # Original demo view (can be removed)
Architecture
Models
AnalysisRequest: Request payload for APIAnalysisResponse: Response data structure with all analysis reports
Services
TradingAgentsService: Singleton service for API communicationAPIError: Custom error types for better error handling
ViewModels
TradingAnalysisViewModel: Manages state and business logic- Uses
@Publishedproperties for SwiftUI binding - Handles async API calls with proper error handling
Views
TradingAnalysisView: Main screen with ticker inputAnalysisResultView: Displays analysis results with expandable cards- Supporting views for different states (loading, error, welcome)
Configuration
Development
- API URL:
http://localhost:8000 - Timeout: 60 seconds
Production
- Update
AppConfig.swiftwith your production URL - Build with Release configuration
Usage
- Open
TradingDummy.xcodeprojin Xcode - Build and run (⌘+R)
- The app uses Xcode 16's file system synchronized groups - all Swift files are automatically included
Testing
- Ensure backend is running:
cd backend && uv run python3 run_api.py - Run the app in simulator
- Enter a ticker symbol and tap "Analyze"
Notes
- All files in subdirectories are automatically included by Xcode 16
- No need to manually add files to the project
- The modular structure makes it easy to add new features or modify existing ones