# andruxa7/onboarding architecture

> Architecture diagram of the GitHub repository andruxa7/onboarding, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/andruxa7/onboarding
- Repository: https://github.com/andruxa7/onboarding

## Overview

##### Project type and purpose
- This is a native iOS onboarding application built with UIKit.
- Purpose: present a step-by-step onboarding flow with questions and options, fetch content from a remote API, then offer a subscription via StoreKit 2.
- Architecture: Model-View-Presenter (MVP).

##### File structure
- Top-level Xcode project files (.xcodeproj, Info.plist, AppDelegate, SceneDelegate) → standard iOS app bootstrap.
- API folder
– OnboardingData.swift (data model for API response)
– OnboardingService.swift (network layer calling GET /onboarding)
– OnboardingUseCase.swift (business-logic layer orchestrating fetch & state).
- MainPageView folder → UI entry point:
– MainPageViewController.swift (ViewController for the first page)
– MainPagePresenter.swift (Presenter for that screen).
- OnboardingFeature folder → question screens:
– QuestionViewController.swift (UI for each onboarding card)
– QuestionModel.swift (question model)
– AnswerCell.swift (table/collection cell).
- Subscription folder → StoreKit 2 integration:
– Products.storekit (local product stubs)
– Store.swift (subscription manager).
- SuccessViewController.swift and PremiumViewController.swift → final screens.
- Utils/Environment.swift → runtime configuration (e.g., API base URL).
- Assets.xcassets + LaunchScreen.storyboard.

##### README for insights
- Confirms MVP and dynamic onboarding cards via remote API.
- No extra dependencies except SnapKit for layout.
- iOS 16 target, UIKit-only.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "App Bootstrap"
        AD["AppDelegate"]:::config
        SD["SceneDelegate"]:::config
    end

    subgraph "UI Layer"
        MPVC["MainPageViewController"]:::ui
        QVC["QuestionViewController"]:::ui
        AC["AnswerCell"]:::ui
        PVC["PremiumViewController"]:::ui
        SVC["SuccessViewController"]:::ui
    end

    subgraph "Presenter Layer"
        MPP["MainPagePresenter"]:::presenter
    end

    subgraph "UseCase Layer"
        OUC["OnboardingUseCase"]:::logic
    end

    subgraph "Service Layer"
        ONS["OnboardingService"]:::service
        STO["Store"]:::service
    end

    subgraph "Data Models"
        ODB["OnboardingData"]:::data
        QMD["QuestionModel"]:::data
    end

    subgraph "Configuration"
        ENV["Environment"]:::config
        PRD["Products.storekit"]:::config
        AST["Assets.xcassets"]:::config
        LS["LaunchScreen.storyboard"]:::config
    end

    subgraph "External Systems"
        API["Remote Onboarding API"]:::external
        SK2["Apple StoreKit 2"]:::external
    end

    %% Connections
    AD -->|"initializes"| MPVC
    SD -->|"loads scene"| MPVC

    MPVC -->|"user actions"| MPP
    QVC -->|"user actions"| MPP
    MPP -->|"requests data"| OUC
    OUC -->|"calls network"| ONS
    ONS -->|"GET /onboarding"| API
    API -->|"response data"| ONS
    ONS -->|"returns model"| OUC
    OUC -->|"provides view data"| MPP
    MPP -->|"updates UI"| MPVC
    MPP -->|"updates UI"| QVC

    PVC -->|"purchase tapped"| STO
    STO -->|"purchaseProduct()"| SK2
    SK2 -->|"receipt"| STO
    STO -->|"purchase success"| SVC

    ENV -->|"baseURL"| ONS

    OUC -->|"uses"| QMD
    ONS -->|"parses"| ODB

    %% Click Events
    click MPVC "https://github.com/andruxa7/onboarding/blob/main/Onboarding/MainPageView/MainPageViewController.swift"
    click QVC "https://github.com/andruxa7/onboarding/blob/main/Onboarding/OnboardingFeature/QuestionViewController.swift"
    click AC "https://github.com/andruxa7/onboarding/blob/main/Onboarding/OnboardingFeature/AnswerCell.swift"
    click PVC "https://github.com/andruxa7/onboarding/blob/main/Onboarding/PremiumViewController.swift"
    click SVC "https://github.com/andruxa7/onboarding/blob/main/Onboarding/SuccessViewController.swift"
    click MPP "https://github.com/andruxa7/onboarding/blob/main/Onboarding/MainPageView/MainPagePresenter.swift"
    click OUC "https://github.com/andruxa7/onboarding/blob/main/Onboarding/API/OnboardingUseCase.swift"
    click ONS "https://github.com/andruxa7/onboarding/blob/main/Onboarding/API/OnboardingService.swift"
    click STO "https://github.com/andruxa7/onboarding/blob/main/Onboarding/Subscription/Store.swift"
    click ODB "https://github.com/andruxa7/onboarding/blob/main/Onboarding/API/OnboardingData.swift"
    click QMD "https://github.com/andruxa7/onboarding/blob/main/Onboarding/OnboardingFeature/QuestionModel.swift"
    click ENV "https://github.com/andruxa7/onboarding/blob/main/Onboarding/Utils/Environment.swift"
    click PRD "https://github.com/andruxa7/onboarding/blob/main/Onboarding/Subscription/Products.storekit"
    click AST "https://github.com/andruxa7/onboarding/blob/main/Onboarding/Assets.xcassets"
    click LS "https://github.com/andruxa7/onboarding/blob/main/Onboarding/Base.lproj/LaunchScreen.storyboard"
    click AD "https://github.com/andruxa7/onboarding/blob/main/Onboarding/AppDelegate.swift"
    click SD "https://github.com/andruxa7/onboarding/blob/main/Onboarding/SceneDelegate.swift"

    %% Styles
    classDef ui fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef presenter fill:#d4edda,stroke:#333,stroke-width:1px
    classDef logic fill:#fff3cd,stroke:#333,stroke-width:1px
    classDef service fill:#ffeeba,stroke:#333,stroke-width:1px
    classDef data fill:#e2e3e5,stroke:#333,stroke-width:1px
    classDef config fill:#d1ecf1,stroke:#333,stroke-width:1px
    classDef external fill:#f8d7da,stroke:#333,stroke-width:1px
```
