A modular SwiftUI application demonstrating clean architecture, feature reusability, and separation of concerns.
| Login Screen | Feed Screen | Profile Screen |
|---|---|---|
![]() |
![]() |
![]() |
PostsApp is a SwiftUI-based iOS application for browsing, reading, and managing articles. The app features a secure login flow, a feed of articles, and a user profile section. Users can authenticate, view a personalized feed, read article details, and manage their profile information. The app also supports offline mode, allowing users to view the last fetched page of articles even without an internet connection. It is built with a modular architecture, separating each feature into its own module for maintainability and reusability. The Core module provides shared state, error handling, and utilities, while the main app composes these modules and manages navigation and dependencies.
PostsApp/
│
├── Core/ # Shared models, state, error handling, utilities
├── FeedFeature/ # Feed listing and details
├── LoginFeature/ # Login flow
├── ProfileFeature/ # User profile
├── PostsApp/ # App composition, DI, navigation, assets
├── Pods/ # External dependencies (Alamofire, SDWebImage, etc.)
├── build/ # Build artifacts
├── fastlane/ # CI/CD scripts
├── vendor/ # Third-party code
├── PostsApp.xcodeproj/ # Xcode project
├── PostsApp.xcworkspace # Xcode workspace
└── README.md # Project documentation
PostsApp
├── Core
│ ├── AppState.swift
│ ├── ContentState.swift
│ ├── NetworkError.swift
│ ├── Utilities
│ └── Core.docc
├── FeedFeature
│ ├── Sources
│ └── FeedFeature.docc
├── LoginFeature
│ ├── LoginModel.swift
│ ├── LoginProvider.swift
│ ├── LoginService.swift
│ ├── LoginView.swift
│ ├── LoginViewModel.swift
│ └── LoginFeature.docc
├── ProfileFeature
│ ├── ProfileUser.swift
│ ├── ProfileView.swift
│ └── ProfileFeature.docc
├── PostsApp
│ ├── AppDI.swift
│ ├── KeyChainHelper.swift
│ ├── PostsAppApp.swift
│ ├── RootView.swift
│ ├── Assets.xcassets
│ ├── Feed
│ ├── Feed.xcdatamodeld
│ ├── Preview Content
│ └── Info.plist
├── Pods
│ ├── Alamofire
│ ├── SDWebImage
│ ├── SDWebImageSwiftUI
│ └── ...
├── build
├── fastlane
├── vendor
├── PostsApp.xcodeproj
├── PostsApp.xcworkspace
└── README.md
- Core: Import in any feature for shared state, error handling, and utilities.
- FeedFeature: Use
FeedViewandFeedViewModelfor feed UI and logic. - LoginFeature: Use
LoginViewwith aLoginProviderfor login UI. - ProfileFeature: Use
ProfileViewwith aProfileUsermodel. - PostsApp: Composes features, manages navigation, and dependency injection.
import LoginFeature
let provider = LoginProvider(
viewModel: LoginViewModel(LoginService(), onLoginSuccess: { user in
// Handle login success
}),
loginViewImage: Image("login_bg", bundle: .main)
)
LoginView(provider: provider)
.environmentObject(appState)- Each module contains a
.doccfolder with markdown documentation. - See
Core/Core.docc/Core.md,FeedFeature/FeedFeature.docc/FeedFeature.md, etc.
This structure enables easy feature reuse, testability, and clean separation of concerns.
For more details, see the documentation in each module.


