A modern iOS app built with Swift and SwiftUI.
This project is structured for scalability, testability, and modular development.
It follows a clean architecture approach with:
- dependency injection
- environment-driven configuration
- and a ready-to-use authentication flow.
- SwiftUI-first UI with previews
- Authentication flow (auto-login, routing, session state)
- Clean architecture (Use Cases, Repositories, Services)
- Async/await concurrency
- Dependency injection via Environment
- Modularized data layer (Remote + Local)
- Preview-friendly mocks/stubs
- Swift Testing or XCTest-ready
- Swift 6
- SwiftUI
- Swift Concurrency (async/await, actors)
- Combine (optional)
- Foundation / URLSession
- StoreKit (optional)
- Firebase or custom backend (optional)
- Swift Testing or XCTest
App/
AppRoot.swift // Entry point, auth routing, loading state
WelcomeRootView.swift // Unauthenticated flow
DiscoveryRootView.swift // Authenticated flow (main app)
Domain/
Entities/ // Core models
UseCases/ // Business logic (e.g., AuthUseCase)
Protocols/ // Abstractions for repositories/services
Data/
Repositories/ // Repository implementations (e.g., FirebaseAuthRepository)
Remote/ // Network services (e.g., AuthRemoteService)
Local/ // Local persistence (e.g., UserLocalStore)
Mappers/ // DTO <-> Model conversions
Presentation/
Features/
Auth/ // Auth screens, view models
Discovery/ // Main feature screens, view models
Components/ // Reusable views
ViewModels/ // Shared view models (e.g., AuthViewModel)
Resources/
Assets.xcassets
Config/ // Environment configs, plist
Tests/
Unit/
UI/
-
Clone the repository:
git clone https://github.com/leroyanders/ios-boilerplate.git
-
Open the project in Xcode:
open BoilerplateApp.xcodeproj
-
Run the app on a simulator or device.
The project follows a layered architecture:
- Presentation — SwiftUI views and ViewModels
- Domain — business logic and entities
- Data — repositories, network, and local storage
Each layer depends only on the layer below it.
- Unit tests for UseCases and ViewModels
- UI tests for main flows
- Supports Swift Testing or XCTest
This project is licensed under the MIT License — see the LICENSE file for details.
