How abdullahgenc/shopping-app works
Project Type & Purpose
• It’s a native iOS application focused on shopping functionality – allowing users to explore products, authenticate (sign in/sign up), view product details, search, manage their basket, and view profiles.
• Key features like onboarding, product listings (fetched via a FakeStore API), and multi-screen navigation are highlighted. The README also lists 3rd party tools (e.g., SnapKit, Firebase Auth/Firestore, Moya, IQKeyboardManager, KingFisher) which integrate into various layers.
Key Components
a. App Lifecycle & System Entry:
• AppDelegate and SceneDelegate (inside the App/Delegates folder). These are the entry points and manage the application lifecycle.
b. Core Infrastructure:
• Constants/Configurations (e.g., UserDefaultConstants)
• Extensions (for Encodable, UIButton, etc.)
• Helper utilities (like AlertPresentable)
• Network layer: The FakeStore API is used to simulate product data fetching.
• SAKit components which include custom views (SAView, SAViewController, SATextView, etc.)
c. Screens / Feature Modules:
• Auth Module:
• Authentication Controllers (e.g., AuthViewController) and associated ViewModels & views (for sign in/sign up).
• Onboarding Module:
• Onboarding screens with both XIB/storyboard and programmatic views.
• Main Tab Bar Module:
• Contains submodules for Products, Basket, Profile, and Search.
• For example, the Products module has its Controller (ProductsViewController), Views (DetailView, ProductsCollectionViewCell), Model (Product.swift), and the corresponding ViewModel.
• Each module follows the MVVM structure: the Controller (UI layer) communicates with its ViewModel, which in turn interacts with the Core (networking, data layer) when needed.
d. UI & Presentation:
• That some screens use Storyboard (initial and auth screens) while others are built programmatically.
• Use of customized UI components from SAKit and external libraries (e.g., SnapKit for constraints, KingFisher for image loading).
e. External Services & Libraries:
• How these external services integrate with the internal network layer (e.g., in the Core/Network folder) or UI adjustments.
Relationships & Data Flow
• The AppDelegate launches the initial onboarding/auth flow.
• Upon successful authentication, navigation shifts to the MainTabBar where each tab corresponds to a feature module.
• Within each module, controllers interact with their view models using delegate patterns and closures.
• ViewModels interact with the network layer (e.g., FakeStore API) to fetch data which is then presented by the controllers.