Move API key para Secrets.swift fora do versionamento
- Secrets.swift entra no .gitignore; Secrets.swift.example fica como modelo - Adiciona .gitignore (xcuserdata, DerivedData) e README com instruções Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# Segredos — nunca versionar (copie de Secrets.swift.example)
|
||||
Bible-Week/Secrets.swift
|
||||
|
||||
# Xcode
|
||||
xcuserdata/
|
||||
DerivedData/
|
||||
*.xcuserstate
|
||||
@@ -54,9 +54,8 @@ struct Chapter: Decodable, Hashable {
|
||||
enum BibleAPI {
|
||||
static let baseURL = URL(string: "https://bible.falehandix.com.br")!
|
||||
|
||||
// NOTA: para produção, mover para um Secrets.xcconfig (fora do controle de
|
||||
// versão) ou para o Keychain. Mantido aqui apenas para a prova de conceito.
|
||||
static let apiKey = "3717732ae41aa989ec7e0b30568784d78d23a8e026f5df889d82ae4b54f2986b"
|
||||
// A chave vive em Secrets.swift (gitignored) — ver Secrets.swift.example.
|
||||
static let apiKey = Secrets.bibleAPIKey
|
||||
|
||||
/// Faz um GET na API e decodifica a resposta JSON.
|
||||
static func get<T: Decodable>(_ path: String, query: [URLQueryItem] = []) async throws -> T {
|
||||
|
||||
26
README.md
Normal file
26
README.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Bible Week
|
||||
|
||||
App iOS de leitura bíblica (SwiftUI) com a tradução **Nova Bíblia Viva (NBV)**,
|
||||
consumida de uma API REST própria.
|
||||
|
||||
## Recursos
|
||||
|
||||
- 📖 Leitura livre: 66 livros, navegação por capítulo
|
||||
- 🗓️ **Plano Bíblia em 180 Dias**: três trilhas diárias (História, Sabedoria e
|
||||
Profetas, Novo Testamento) cobrindo os 1.189 capítulos
|
||||
- 🔔 Lembrete diário por notificação local (sem serviços externos), com
|
||||
deep link direto para a Leitura de Hoje
|
||||
|
||||
## Como compilar
|
||||
|
||||
1. Copie `Secrets.swift.example` para `Bible-Week/Secrets.swift`
|
||||
2. Preencha a chave da API (`bibleAPIKey`)
|
||||
3. Abra `Bible-Week.xcodeproj` no Xcode e rode (⌘R)
|
||||
|
||||
O `Secrets.swift` está no `.gitignore` — nunca versione chaves.
|
||||
|
||||
## Testes
|
||||
|
||||
- Unitários (framework Testing): cronograma do plano, estado/persistência e
|
||||
conteúdo das notificações — ⌘U
|
||||
- UI (XCUIAutomation): fluxo de leitura e ativação do lembrete
|
||||
15
Secrets.swift.example
Normal file
15
Secrets.swift.example
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// Secrets.swift.example
|
||||
//
|
||||
// Modelo do arquivo de segredos. Para compilar o projeto:
|
||||
// 1. Copie este arquivo para Bible-Week/Secrets.swift
|
||||
// 2. Preencha a chave da API
|
||||
// O Secrets.swift real está no .gitignore e nunca é versionado.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum Secrets {
|
||||
/// Chave da API da Bíblia (header X-API-Key).
|
||||
static let bibleAPIKey = "COLOQUE_SUA_CHAVE_AQUI"
|
||||
}
|
||||
Reference in New Issue
Block a user