dev-resources.site
for different kinds of informations.
MVVM directory structure for larger project
Published at
1/15/2025
Categories
swift
architecture
Author
Pheak Pheasa
Key Additions:
1. Modularization: Break the app into separate modules (e.g., UserModule, ProductModule) to improve scalability and collaboration in large teams.
2. DependencyInjection: Using DI frameworks (like Swinject) to handle dependencies across the app, improving testability and flexibility.
3. Managers: More specific app-wide managers like PushNotificationManager, AnalyticsManager for cross-functional management.
4. Tests: Better structured tests with different types of testing (e.g., unit tests, UI tests, integration tests).
5. Documentation: More extensive documentation covering architecture, APIs, and other design considerations.
MyApp/
ā
āāā Models/ # Data models representing app entities
ā āāā User.swift
ā āāā Product.swift
ā āāā ...
ā
āāā Views/ # UI components (Views)
ā āāā MainView.swift
ā āāā UserView.swift
ā āāā ProductView.swift
ā āāā ...
ā
āāā ViewModels/ # ViewModels responsible for data-binding and logic
ā āāā MainViewModel.swift
ā āāā UserViewModel.swift
ā āāā ProductViewModel.swift
ā āāā ...
ā
āāā Services/ # Layer for API calls, data handling, etc.
ā āāā NetworkService.swift
ā āāā AuthService.swift
ā āāā ImageService.swift
ā āāā ...
ā
āāā Persistence/ # Local data storage, CoreData, SQLite, etc.
ā āāā CoreDataManager.swift
ā āāā DatabaseMigration.swift
ā āāā PersistenceService.swift
ā
āāā Helpers/ # Reusable utilities or helper methods
ā āāā Extensions/
ā āāā DateFormatterHelper.swift
ā āāā NetworkingHelper.swift
ā āāā ...
ā
āāā Resources/ # Images, JSON, etc.
ā āāā Images/
ā āāā Localizations/
ā āāā Fonts/
ā āāā ...
ā
āāā Supporting Files/ # Configurations, AppDelegate, SceneDelegate, etc.
ā āāā AppDelegate.swift
ā āāā SceneDelegate.swift
ā āāā Info.plist
ā āāā Assets.xcassets
ā
āāā UI/ # UI-specific components (e.g., custom buttons, loaders)
ā āāā CustomButton.swift
ā āāā LoadingIndicator.swift
ā āāā CustomView.swift
ā āāā ...
ā
āāā Coordinators/ # Responsible for navigation flow
ā āāā MainCoordinator.swift
ā āāā UserCoordinator.swift
ā āāā FlowCoordinator.swift
ā
āāā Network/ # Network layer, handling API calls, caching, etc.
ā āāā APIClient.swift
ā āāā APIConstants.swift
ā āāā ResponseHandler.swift
ā āāā ...
ā
āāā Managers/ # Handles app-wide management logic
ā āāā SessionManager.swift
ā āāā PushNotificationManager.swift
ā āāā AnalyticsManager.swift
ā
āāā Utils/ # Miscellaneous utilities
ā āāā AppUtils.swift
ā āāā Logging.swift
ā
āāā Modularization/ # For large projects, consider splitting into modules
ā āāā UserModule/ # Example of separate feature module
ā ā āāā UserModels/
ā ā āāā UserViews/
ā ā āāā UserViewModels/
ā ā āāā UserServices/
ā ā āāā UserCoordinator.swift
ā āāā ProductModule/ # Another example
ā āāā ProductModels/
ā āāā ProductViews/
ā āāā ProductViewModels/
ā āāā ProductServices/
ā āāā ProductCoordinator.swift
ā
āāā DependencyInjection/ # Dependency Injection setup (e.g., using Swinject)
ā āāā DIContainer.swift
ā āāā ServicesAssembly.swift
ā āāā ViewModelsAssembly.swift
ā
āāā Tests/ # Unit and UI tests
ā āāā ViewModelsTests/
ā āāā ServicesTests/
ā āāā PersistenceTests/
ā āāā UITests/
ā āāā ...
ā
āāā Documentation/ # Project-related documentation
āāā README.md
āāā API_Documentation.md
āāā Architecture.md
Articles
12 articles in total
MVVM directory structure for larger project
currently reading
how to get SSH Keys for gitlab for mac?
read article
Directory structure for building a stock system using FastAPI
read article
Docker compose down with remove all everything related.
read article
To generate an SSH key in Ubuntu
read article
To reset head of your branch comment
read article
Here are the steps to prepare before you start coding a web application.
read article
How to allow remote connections to PostgreSQL on Linux
read article
To create a Docker network
read article
To view the last 100 lines of logs from a Docker container and continue to follow new logs
read article
ubuntu server create database and create new user with password for there database in postgresql.
read article
Using postgresql with nuxt3 by ORM(sequelize)
read article
Featured ones: