Okariuss/VIPER-base
๐ Modular iOS VIPER base project with Auth, onboarding, localization, and Firebase integration. Swift 6+, iOS 15+.
iOS VIPER Base Project
๐ Project Purpose
This project provides a VIPER architecture-based, modular, testable, and scalable starter infrastructure for modern iOS applications.
It is designed for maintainability, readability, and easy management in large-scale projects.
Minimum Requirement:
This project is developed for iOS 15.0 and above.
It leverages modern Swift concurrency features (async/await,@MainActor,Task, etc.) and is fully compatible with Swift 6+ and Xcode 16.4+.
๐ฆ About the Project
- Built on a base VIPER architecture.
- Each module (e.g., Auth, Onboarding, Home) has its own independent VIPER layers:
View,Interactor,Presenter,Entity,Router. - Comes with an embedded Auth module that includes essential flows:
- Login
- Signup
- Password Reset
๐ Flexible Auth Integration
- โ
Firebase Ready:
- Firebase Authentication, Analytics, etc. can be integrated out-of-the-box.
- ๐ ๏ธ Custom Backend:
- Easily integrate your own backend authentication logic.
- Thanks to protocol-oriented and modular VIPER structure, only the Interactor and Service layers need to be updated.
โ ๏ธ IMPORTANT:
To switch the authentication provider (e.g., from Firebase to custom backend),
update the relevant configuration inAppDelegate.swift.
(See the authentication setup section in the file.)
๐งฑ Architecture Advantages
- Modularity: Each module can be developed, tested, and reused independently.
- Easy Customization: Themes, localization, analytics services, and helper components are easily pluggable.
โญ๏ธ Key Features
-
Environment Configuration
- Supports multiple environments (
development,staging,production) viaAppEnvironment. - Automatically selects base URL and environment-specific settings.
- Supports multiple environments (
-
Secure Session & Token Management
- Managed via
SessionManager, securely stores tokens in Keychain.
- Managed via
-
Centralized Validation
ValidationManagerprotocol handles all form/auth validations.
-
Localization
- Multi-language support out-of-the-box.
- Easily add new languages by updating
.stringsfiles.
-
Custom UI Components
- Reusable & themeable:
CustomButton,CustomTextField, etc.
- Reusable & themeable:
-
Firebase App Check Support
- Integrated for added security in dev and prod.
-
Testability
- Protocol-based architecture supports easy unit/UI testing.
- Dependency Injection ready.
๐ ๏ธ Technologies & Approaches Used
- Swift 6.x (Fully compatible with Swift 6.1)
- iOS 15.0+ (Minimum deployment target)
- VIPER Architecture
- UIKit
- Dependency Injection (DI)
async/await,@MainActor,Task- Protocol-Oriented Programming
- Localization & Theming
- Firebase Analytics Integration
- Custom Base Classes
- Clean Code & Documentation
โก๏ธ Setup
1. Clone the repository
git clone https://github.com/Okariuss/VIPER-base.git2. Install dependencies
- Use Swift Package Manager. Open the project in Xcode and wait for it to resolve packages.
3. Firebase Integration (Optional but Recommended)
If you're using Firebase services (e.g., Auth, Analytics):
- Go to Firebase Console.
- Download:
GoogleService-Info.plistfor productionGoogleService-Debug-Info.plistfor development (optional)
- Place the files in the following directory:
iosBase/Resources/Google Firebase/ - โ Ensure exact file names and paths. Incorrect naming or directory will break integration.
4. Configure Authentication
If you're using your own backend for auth:
- Open
AppDelegate.swift - Follow the inline comments to switch between Firebase and custom logic
- Adjust DI containers and auth services accordingly
5. Run the Project
- Open the project in Xcode 16.4+
- Select a build scheme
- Press Run
โ How to Add a New VIPER Module
- Create a folder under
Modules/(e.g.,Profile/) - Add the five VIPER components:
ProfileViewControllerProfilePresenterProfileInteractorProfileEntityProfileRouterProfileBuilder
- Register the module in the DI container if needed
- Use the builder to instantiate and present the module
๐งโ๐ป Contributing
Pull requests and issues are welcome!
Please follow the existing code style and architectural conventions when contributing.
๐ License
MIT
๐ Additional Notes
- Minimum iOS 15.0 required (due to modern Swift concurrency)
- Fully compatible with Swift 6.1 and Xcode 16.4+
Feel free to reach out for questions, feedback, or collaboration!