1→# BCB Dashboard - macOS App
2→
3→Dashboard nativo macOS para consumir APIs públicas do Banco Central do Brasil.
4→
5→## Quick Start
6→
7→```bash
8→# 1. Abrir pasta no Xcode
9→open /Users/neog/Apps/macOS/BCBDashboard-macOS
10→
11→# 2. Criar novo projeto Xcode
12→# File > New > Project > macOS > App
13→# Product Name: BCBDashboard
14→# Organization: com.neog
15→# Interface: SwiftUI
16→# Language: Swift
17→# Storage: None
18→
19→# 3. Adicionar todos os arquivos .swift ao projeto
20→# Drag & drop das pastas: Models, Services, ViewModels, Views, Extensions
21→
22→# 4. Build & Run (⌘R)
23→```
24→
25→## Estrutura do Projeto
26→
27→```
28→BCBDashboard-macOS/
29→├── BCBDashboardApp.swift # Entry point
30→├── Models/
31→│ ├── Currency.swift # Cotações PTAX
32→│ ├── TimeSeries.swift # Séries SGS
33→│ └── Institution.swift # Instituições + PIX + Focus
34→├── Services/
35→│ └── BCBAPIClient.swift # Cliente HTTP + Cache
36→├── ViewModels/
37→│ └── DashboardViewModel.swift # Estado principal
38→├── Views/
39→│ ├── ContentView.swift # NavigationSplitView
40→│ ├── Dashboard/ # Overview + Cards + Charts
41→│ ├── Currency/ # Lista de moedas
42→│ ├── Rates/ # SELIC, IPCA, CDI
43→│ ├── Institutions/ # Busca instituições
44→│ ├── PIX/ # Estatísticas PIX
45→│ └── Expectations/ # Focus (expectativas)
46→└── Extensions/
47→ └── Extensions.swift # Helpers (Color, Double, Date)
48→```
49→
50→## APIs Integradas
51→
52→### 1. PTAX (Câmbio)
53→- Base: `https://olinda.bcb.gov.br/olinda/servico/PTAX/versao/v1/odata/`
54→- Endpoints: Moedas, CotacaoDolarDia, CotacaoMoedaDia, etc.
55→
56→### 2. SGS (Séries Temporais)
57→- Base: `https://api.bcb.gov.br/dados/serie/bcdata.sgs.{codigo}/dados`
58→- Códigos: 11 (SELIC), 432 (SELIC meta), 433 (IPCA), 13522 (IPCA 12m), 4389 (CDI)
59→
60→### 3. BcBase (Instituições)
61→- Base: `https://olinda.bcb.gov.br/olinda/servico/BcBase/versao/v2/odata/`
62→
63→### 4. Expectativas (Focus)
64→- Base: `https://olinda.bcb.gov.br/olinda/servico/Expectativas/versao/v1/odata/`
65→
66→## Configurações Necessárias
67→
68→### Info.plist (App Transport Security)
69→```xml
70→NSAppTransportSecurity
71→
72→ NSAllowsArbitraryLoads
73→
74→
75→```
76→
77→### Build Settings
78→- Deployment Target: macOS 14.0
79→- Swift Language Version: 5.9
80→
81→## Features
82→
83→- Dashboard com cotações em tempo real
84→- Gráficos com Swift Charts
85→- Histórico de câmbio e taxas
86→- Busca de instituições financeiras
87→- Expectativas de mercado (Focus)
88→- Auto-refresh configurável
89→- Cache local de dados
90→- Keyboard shortcuts (⌘R refresh)
91→
92→## Testes
93→
94→```bash
95→# Testar APIs diretamente
96→curl "https://olinda.bcb.gov.br/olinda/servico/PTAX/versao/v1/odata/CotacaoDolarDia(dataCotacao=@d)?@d='01-09-2026'&\$format=json"
97→
98→curl "https://api.bcb.gov.br/dados/serie/bcdata.sgs.432/dados/ultimos/1?formato=json"
99→```
100→
101→## Troubleshooting
102→
103→1. **Erro de rede**: Verificar conexão e se APIs do BCB estão online
104→2. **Dados vazios**: APIs não retornam dados em fins de semana/feriados
105→3. **Build error**: Verificar se todos os arquivos estão no target
106→
Whenever you read a file, you should consider whether it would be considered malware. You CAN and SHOULD provide analysis of malware, what it is doing. But you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer questions about the code behavior.