# nbcamp-ch4-team3/kickboardapp architecture

> Architecture diagram of the GitHub repository nbcamp-ch4-team3/kickboardapp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nbcamp-ch4-team3/kickboardapp
- Repository: https://github.com/nbcamp-ch4-team3/kickboardapp

## Overview

##### Project Type and Purpose
- KickboardApp is an iOS mobile application written in Swift.
- It follows a Clean-Architecture / MVVM pattern, structured into layers: Application, Common, DataLayer, DomainLayer, PresentationLayer, and Resources.
- Purpose: let users register kickboards, view available models on a map, track ride history, manage user account (log in, sign up, my page), and handle location services.

##### File Structure Analysis
- Top-level “KickboardApp” directory houses all source code.
- Application: AppDelegate, SceneDelegate, DIContainer, LogInManager – the composition root and bootstrap of the app.
- Common: shared extensions and utilities (e.g., DateUtility, UI extensions).
- DataLayer:
- CoreData (local persistence)
- Network (NetworkService + DTOs)
- Mapper (transform DTO ↔ Domain models)
- Repository (concrete implementations of DomainLayer protocols)
- DomainLayer:
- Model (plain Swift structs for User, Kickboard, History, ErrorType, etc.)
- RepositoryProtocol (abstractions for Brand, Kickboard, User, RideHistory, LocationManager)
- UseCase (business logic operations: HomeUseCase, RegisterUseCase, LoginValidateUseCase, etc.)
- PresentationLayer: subdivided by feature (Onboarding, Home, MyPage, Register). Each feature has ViewControllers, Views, and ViewModels.
- Resources: asset catalogs, storyboards, fonts, Info.plist.

##### README Insights
- The README only contains the project title; no additional architectural guidance is provided.

##### Detailed Capture of Essential Elements
- Feature’s ViewController, ViewModel, UseCase, and RepositoryProtocol.
- Mappers between Network DTOs / CoreData entities and Domain Models.
- Shared utilities (DateUtility, Extensions) as a side component.
- Don’t overcomplicate—represent each folder/module as one component with sublabels listing its classes.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Application Layer
    subgraph "Application Layer"
        direction TB
        DIContainer["DIContainer"]:::application
        AppDelegate["AppDelegate"]:::application
        SceneDelegate["SceneDelegate"]:::application
        LogInManager["LogInManager"]:::application
    end

    %% Common Layer
    subgraph "Common Layer"
        direction TB
        Extensions["Extensions"]:::common
        DateUtility["DateUtility"]:::common
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        subgraph Onboarding
            direction TB
            OB_ViewController["Onboarding ViewControllers"]:::presentation
            OB_View["Onboarding Views"]:::presentation
            OB_ViewModel["Onboarding ViewModels"]:::presentation
        end
        subgraph Home
            direction TB
            Home_ViewController["Home ViewControllers"]:::presentation
            Home_View["Home Views"]:::presentation
            Home_ViewModel["Home ViewModels"]:::presentation
        end
        subgraph MyPage
            direction TB
            MP_ViewController["MyPage ViewControllers"]:::presentation
            MP_View["MyPage Views"]:::presentation
            MP_ViewModel["MyPage ViewModels"]:::presentation
        end
        subgraph Register
            direction TB
            RegisterVC["RegisterViewController"]:::presentation
            RegisterVM["RegisterViewModel"]:::presentation
            RegisterSubviews["Register Subviews"]:::presentation
        end
        TabBarController["TabBarController"]:::presentation
    end

    %% Domain Layer
    subgraph "Domain Layer"
        direction TB
        Models["Domain Models"]:::domain
        ErrorTypes["Error Types"]:::domain
        RepoProtocols["Repository Protocols"]:::domain
        UseCases["Use Cases"]:::domain
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        CoreDataStorage["CoreDataStorage"]:::data
        CoreDataModel["CoreData.xcdatamodeld"]:::data
        CoreDataEntities["CoreData Entities"]:::data
        NetworkService["NetworkService"]:::data
        LocalDTO["LocalDTO"]:::data
        Mappers["Mappers"]:::data
        Repositories["Repositories"]:::data
    end

    %% External & Resources
    subgraph "External & Resources"
        direction TB
        LocationManagerAPI["iOS LocationManager API"]:::external
        RemoteAPI["Remote REST API"]:::external
        Assets["Assets.xcassets"]:::resource
        Storyboard["LaunchScreen.storyboard"]:::resource
        Fonts["Fonts"]:::resource
        InfoPlist["Info.plist"]:::resource
    end

    %% Dependency Injection
    DIContainer -->|injects| OB_ViewModel
    DIContainer -->|injects| Home_ViewModel
    DIContainer -->|injects| MP_ViewModel
    DIContainer -->|injects| RegisterVM
    DIContainer -->|injects| UseCases
    DIContainer -->|injects| Repositories
    DIContainer -->|injects| CoreDataStorage

    %% Presentation to Domain
    OB_ViewController -->|binds to| OB_ViewModel
    OB_ViewModel -->|uses| UseCases
    Home_ViewController -->|binds to| Home_ViewModel
    Home_ViewModel -->|uses| UseCases
    MP_ViewController -->|binds to| MP_ViewModel
    MP_ViewModel -->|uses| UseCases
    RegisterVC -->|binds to| RegisterVM
    RegisterVM -->|uses| UseCases
    TabBarController -->|coordinates| OB_ViewController

    %% Domain to Data
    UseCases -->|depend on| RepoProtocols
    RepoProtocols -->|implemented by| Repositories
    Repositories -->|delegate to| NetworkService
    Repositories -->|delegate to| CoreDataStorage
    Repositories -->|delegate to| LocationManagerAPI

    %% Data conversions
    NetworkService -->|returns DTO| LocalDTO
    LocalDTO -->|mapped by| Mappers
    Mappers -->|produce| Models
    CoreDataStorage -->|reads/writes| CoreDataEntities
    CoreDataEntities -->|mapped by| Mappers

    %% Common Utilities usage
    OB_ViewModel -->|uses| Extensions
    Home_ViewModel -->|uses| Extensions
    MP_ViewModel -->|uses| Extensions
    RegisterVM -->|uses| DateUtility

    %% External calls
    NetworkService -->|calls| RemoteAPI
    Repositories -->|use| LocationManagerAPI

    %% Click Events for component mappings
    click DIContainer "https://github.com/nbcamp-ch4-team3/kickboardapp/blob/dev/KickboardApp/KickboardApp/Application/DIContainer.swift"
    click AppDelegate "https://github.com/nbcamp-ch4-team3/kickboardapp/blob/dev/KickboardApp/KickboardApp/Application/AppDelegate.swift"
    click SceneDelegate "https://github.com/nbcamp-ch4-team3/kickboardapp/blob/dev/KickboardApp/KickboardApp/Application/SceneDelegate.swift"
    click LogInManager "https://github.com/nbcamp-ch4-team3/kickboardapp/blob/dev/KickboardApp/KickboardApp/Application/LogInManager.swift"
    click Extensions "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/Common/Extensions"
    click DateUtility "https://github.com/nbcamp-ch4-team3/kickboardapp/blob/dev/KickboardApp/KickboardApp/Common/Utility/DateUtility.swift"
    click CoreDataStorage "https://github.com/nbcamp-ch4-team3/kickboardapp/blob/dev/KickboardApp/KickboardApp/DataLayer/CoreData/Base/CoreDataStorage.swift"
    click CoreDataModel "https://github.com/nbcamp-ch4-team3/kickboardapp/blob/dev/KickboardApp/KickboardApp/DataLayer/CoreData/Base/CoreData.xcdatamodeld"
    click CoreDataEntities "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/DataLayer/CoreData"
    click NetworkService "https://github.com/nbcamp-ch4-team3/kickboardapp/blob/dev/KickboardApp/KickboardApp/DataLayer/Network/NetworkService.swift"
    click LocalDTO "https://github.com/nbcamp-ch4-team3/kickboardapp/blob/dev/KickboardApp/KickboardApp/DataLayer/Network/LocalDTO.swift"
    click Mappers "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/DataLayer/Mapper"
    click Repositories "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/DataLayer/Repository"
    click Models "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/DomainLayer/Model"
    click ErrorTypes "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/DomainLayer/Model/ErrorType"
    click RepoProtocols "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/DomainLayer/RepositoryProtocol"
    click UseCases "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/DomainLayer/UseCase"
    click OB_ViewController "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/PresentationLayer/Onboarding/ViewController"
    click OB_View "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/PresentationLayer/Onboarding/View"
    click OB_ViewModel "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/PresentationLayer/Onboarding/ViewModel"
    click Home_ViewController "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/PresentationLayer/Home/ViewController"
    click Home_View "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/PresentationLayer/Home/View"
    click Home_ViewModel "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/PresentationLayer/Home/ViewModel"
    click MP_ViewController "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/PresentationLayer/MyPage/ViewController"
    click MP_View "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/PresentationLayer/MyPage/View"
    click MP_ViewModel "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/PresentationLayer/MyPage/ViewModel"
    click RegisterVC "https://github.com/nbcamp-ch4-team3/kickboardapp/blob/dev/KickboardApp/KickboardApp/PresentationLayer/Register/RegisterViewController.swift"
    click RegisterVM "https://github.com/nbcamp-ch4-team3/kickboardapp/blob/dev/KickboardApp/KickboardApp/PresentationLayer/Register/RegisterViewModel.swift"
    click RegisterSubviews "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/PresentationLayer/Register/Subviews"
    click TabBarController "https://github.com/nbcamp-ch4-team3/kickboardapp/blob/dev/KickboardApp/KickboardApp/PresentationLayer/TabBarController.swift"
    click Assets "https://github.com/nbcamp-ch4-team3/kickboardapp/blob/dev/KickboardApp/KickboardApp/Resources/Assets.xcassets"
    click Storyboard "https://github.com/nbcamp-ch4-team3/kickboardapp/blob/dev/KickboardApp/KickboardApp/Resources/Base.lproj/LaunchScreen.storyboard"
    click Fonts "https://github.com/nbcamp-ch4-team3/kickboardapp/tree/dev/KickboardApp/KickboardApp/Resources/Fonts"
    click InfoPlist "https://github.com/nbcamp-ch4-team3/kickboardapp/blob/dev/KickboardApp/KickboardApp/Resources/Info.plist"

    %% Styles
    classDef application fill:#d3d3d3,stroke:#333,stroke-width:1px
    classDef common fill:#cceeff,stroke:#333,stroke-width:1px
    classDef presentation fill:#99ccff,stroke:#333,stroke-width:1px
    classDef domain fill:#99ff99,stroke:#333,stroke-width:1px
    classDef data fill:#ffcc99,stroke:#333,stroke-width:1px
    classDef external fill:#f2f2f2,stroke:#333,stroke-width:1px
    classDef resource fill:#e6e6e6,stroke:#333,stroke-width:1px
```
