How tryswiftai/financialanalyst works
Financial Analyst is an iOS app for requesting AI-generated financial analysis of public companies. Users choose a company and timeframe, optionally add a question, and start an analysis; the analysis screen builds a prompt, streams a response from Perplexity, decodes the incoming content, and displays financial metrics, growth, highlights, and source links. The graph follows those request and presentation stages and includes the supporting input and response models. Some presentation modules are unsampled; their links are included only where the excerpts or source index show their use.
Main entry points: AnalysisView.swift Analysis workflow · ContentView.swift Home screen · InputForm.swift Prompt builder · MetricsGrid.swift Metrics grid
Components 18
App experience
- App entry
FinancialAnalyst/FinancialAnalystApp.swift - Home screen
FinancialAnalyst/ContentView.swift - Input form
FinancialAnalyst/Views/InputFormView.swift
Analysis request
- Prompt builder
FinancialAnalyst/Models/InputForm.swift - Analysis workflow
FinancialAnalyst/Views/AnalysisView/AnalysisView.swift - Perplexity client
FinancialAnalyst/API/PerplexityClient.swift
Analysis data
- Company choices
FinancialAnalyst/Models/Company.swift - Timeframe choices
FinancialAnalyst/Models/Timeframe.swift - Streamed response model
FinancialAnalyst/Models/GeneratedFinancialAnalysis.swift
Results presentation
- Company header
FinancialAnalyst/Views/AnalysisView/CompanyHeaderView.swift - Metrics grid
FinancialAnalyst/Views/AnalysisView/MetricsGrid.swift - Metric display
FinancialAnalyst/Views/AnalysisView/MetricView.swift - Revenue growth
FinancialAnalyst/Views/AnalysisView/RevenueGrowthView.swift - Key highlights
FinancialAnalyst/Views/AnalysisView/KeyHighlightsView.swift - Source results
FinancialAnalyst/Views/AnalysisView/SearchResultsView.swift - Source link row
FinancialAnalyst/Views/AnalysisView/SearchResultRowView.swift
Other components
- User
- Perplexity API
Connections 20
- App entry → Home screen: launches
FinancialAnalyst/FinancialAnalystApp.swift - User → Home screen: uses
- Home screen → Input form: shows
FinancialAnalyst/ContentView.swift - Home screen → Analysis workflow: opens
FinancialAnalyst/ContentView.swift - Input form → Prompt builder: edits
FinancialAnalyst/Views/InputFormView.swift - Prompt builder → Company choices: uses choices
FinancialAnalyst/Models/InputForm.swift - Prompt builder → Timeframe choices: uses choices
FinancialAnalyst/Models/InputForm.swift - Analysis workflow → Prompt builder: builds prompt
FinancialAnalyst/Views/AnalysisView/AnalysisView.swift - Analysis workflow → Perplexity client: requests stream
FinancialAnalyst/Views/AnalysisView/AnalysisView.swift - Perplexity client → Perplexity API: streams request
FinancialAnalyst/API/PerplexityClient.swift - Analysis workflow → Streamed response model: decodes chunks
FinancialAnalyst/Views/AnalysisView/AnalysisView.swift - Analysis workflow → Company header: renders
FinancialAnalyst/Views/AnalysisView/AnalysisView.swift - Analysis workflow → Metrics grid: renders
FinancialAnalyst/Views/AnalysisView/AnalysisView.swift - Analysis workflow → Revenue growth: renders
FinancialAnalyst/Views/AnalysisView/AnalysisView.swift - Analysis workflow → Key highlights: renders
FinancialAnalyst/Views/AnalysisView/AnalysisView.swift - Analysis workflow → Source results: renders
FinancialAnalyst/Views/AnalysisView/AnalysisView.swift - Metrics grid → Streamed response model: displays metrics
FinancialAnalyst/Views/AnalysisView/MetricsGrid.swift - Metrics grid → Metric display: renders
FinancialAnalyst/Views/AnalysisView/MetricsGrid.swift - Source results → Streamed response model: displays sources
FinancialAnalyst/Views/AnalysisView/SearchResultsView.swift - Source results → Source link row: renders
FinancialAnalyst/Views/AnalysisView/SearchResultsView.swift