Appearance
WellysaAI iOS
AI-powered wellness application for iOS with multi-environment support and modular architecture.
Requirements
- iOS 17.0+ (unverified — confirm deployment target in project.pbxproj)
- Xcode 16.0+ (unverified — confirm recommended version)
- Swift 5.0+
Tech Stack
Dependencies (unverified — confirm in Package.swift and Package.resolved)
- Firebase (Analytics, Crashlytics) — crash reporting and analytics
- SFSafeSymbols — type-safe SF Symbols access
- SwiftLint — Swift code linting and style enforcement
- SwiftGen — code generation for localization, fonts, and assets
Development Tools
Install required tools via Homebrew:
bash
brew install swiftlint swiftgenSwiftGen runs automatically on build to regenerate type-safe accessors.
Project Structure
WellysaAI_iOS/
├── Core/ # Business logic SPM package
│ └── Sources/
│ ├── CloudflareService/ # Cloudflare API integration
│ ├── DomainTypes/ # Shared models and errors
│ │ ├── General/ # App-wide types (errors, models)
│ │ └── Onboarding/ # Onboarding flow types
│ └── Repositories/ # Data persistence layer (UserDefaults)
│
├── WellysaAI_iOS/ # Main application target
│ ├── Assets.xcassets/ # Image assets (logo, lettermark, app icon)
│ ├── Colors.xcassets/ # Color design tokens
│ └── (additional views/providers — structure TBD)
│
├── Generated/ # SwiftGen output (do not edit manually)
│ ├── Strings.swift # Type-safe localized strings
│ └── Fonts.swift # Type-safe Montserrat font accessors
│
├── Resources/ # Static resources
│ ├── en.lproj/ # English localization
│ ├── pl.lproj/ # Polish localization
│ ├── Montserrat/ # Montserrat font family (Regular, Medium, SemiBold, Bold)
│ └── GoogleService-Info.plist # Firebase configuration
│
└── Config/ # Environment configurations
├── Dev.xcconfig # Development environment
├── Stage.xcconfig # Staging environment
└── Prod.xcconfig # Production environmentArchitecture
Provider Pattern
The app uses a Provider pattern (analogous to ViewModel in MVVM) with strict dependency injection for testability:
┌─────────────────────────────────────────────────────────┐
│ SwiftUI Views │
│ (Presentation layer only) │
└───────────────────────┬─────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ Providers │
│ (@MainActor, ObservableObject) │
│ Coordinate UI state & business logic calls │
└───────────────────────┬─────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ Core SPM Package │
│ Services, Repositories, Domain Types │
└─────────────────────────────────────────────────────────┘Core Package
Local Swift Package Manager module containing all business logic. Exposes multiple targets:
| Target | Purpose |
|---|---|
DomainTypes | Shared models, enums, errors (AppError, AppLanguage, ChatModels, UserData, OnboardingStep) |
Repositories | Data persistence abstractions (SettingsRepository, UserDataRepository) |
CloudflareService | Cloudflare API integration with error handling and request building |
Dependency Injection Pattern
Providers use constructor injection with a Dependencies struct for full testability:
swift
@MainActor
final class ExampleProvider: ObservableObject {
struct Dependencies {
var fetchData: () async throws -> String
}
private let dependencies: Dependencies
init(dependencies: Dependencies) {
self.dependencies = dependencies
}
}
// Production instance
extension ExampleProvider {
static let live = ExampleProvider(dependencies: .init(
fetchData: { try await ExampleService().fetchData() }
))
}
// Mock for testing/previews
extension ExampleProvider {
static let mock = ExampleProvider(dependencies: .init(
fetchData: { "Mock data" }
))
}Multi-Environment Setup
The project supports three build environments via .xcconfig files and Xcode schemes:
- Dev (
Dev.xcscheme) — Development environment with debug features - Stage (
Stage.xcscheme) — Pre-production staging environment - Prod (
Prod.xcscheme) — Production release environment
Environment-specific configuration is managed in Config/ directory. Switch environments by selecting the corresponding scheme in Xcode.
Cloudflare Integration
The CloudflareService module handles communication with Cloudflare APIs:
CloudflareService.swift— Main service implementationRequestBuilder.swift— HTTP request constructionCloudflareError.swift— Typed error handling for API failures
(Unverified — confirm endpoints, authentication strategy, and usage patterns in source files)
Design System
Design tokens synchronized with Figma for consistent styling:
- Spacing — 8pt grid system (unverified location — check
CGFloat+DesignSystem.swiftor Utils/) - Typography — Montserrat font family (Regular, Medium, SemiBold, Bold) via SwiftGen-generated
Fonts.swift - Colors — Design tokens in
Colors.xcassets(Black900, Gray200, Gray300, with opacity variants like Black900A40)
Localization
The app supports English and Polish localization via SwiftGen:
swift
// ❌ Avoid stringly-typed localization
Text("welcome_message")
// ✅ Use type-safe SwiftGen accessors
Text(Strings.welcome)Adding New Localized Strings
- Add key-value pair to
Resources/en.lproj/Localizable.strings - Add corresponding translation to
Resources/pl.lproj/Localizable.strings - Build project — SwiftGen regenerates
Generated/Strings.swiftautomatically - Access via
Strings.*in code
App Configuration
| Setting | Value |
|---|---|
| Supported color schemes | Light mode only |
| Dynamic Type | Capped at .xxLarge |
| Supported orientations | Portrait only |
| Minimum iOS version | 17.0 |
| Localization | English (en), Polish (pl) |
Firebase Integration
- Firebase Analytics — User engagement and behavior tracking
- Firebase Crashlytics — Crash reporting and stability monitoring
Configuration loaded from Resources/GoogleService-Info.plist. Ensure this file is present and matches your Firebase project for each environment.
Code Quality
SwiftLint
Code style and linting rules defined in .swiftlint.yml. Runs automatically on build via Xcode Run Script Phase.
Generated Code
Files in Generated/ are auto-generated by SwiftGen during build. Do not edit manually — changes will be overwritten on next build.
Development Workflow (unverified — confirm with team)
- Select appropriate scheme (Dev/Stage/Prod) in Xcode
- Build project — SwiftGen and SwiftLint run automatically
- Use type-safe accessors (
Strings.*,Fonts.*) for resources - Follow Provider pattern for new features with DI-based testing
- Add localization keys to both
.lprojfiles before referencing in code
Status
Active development. Architecture established with Provider pattern, multi-environment support, and modularized Core package. Onboarding flow and chat models infrastructure in place.