# acromace/dreambig architecture

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

- Interactive diagram: https://gitdiagram.com/acromace/dreambig
- Repository: https://github.com/acromace/dreambig

## Overview

- App Initialization & Core: Include the AppDelegate (found in DreamBig/Camera/AppDelegate.swift) as the entry point that initializes the app and sets up any shared configurations or ARKit sessions.
- Camera/AR Module: Represent this as a component that handles ARKit operations and the iOS camera. This module includes:
– CameraViewController and its associated scene files (CameraViewController.storyboard, Scene.sks, and Scene.swift). This part is responsible for managing the AR session and rendering the real-world camera view.
- Drawing Module: Represent this as a separate component responsible for capturing the drawing input and processing the Apple Pencil interactions.
– This includes DrawingViewController, DrawingModel, and any custom views like DrawingImageView, which manage the actual drawing experience.
- Emoji Palette Submodule: Since the project provides an emoji-based drawing palette (found under DreamBig/Drawing/EmojiPalette), treat this as its own subcomponent that integrates with the drawing module. This should show how the emoji palette (with its own table view controllers and cells) is invoked from the drawing interface.
- Assets & Storyboards: Although not “active” components, these still play roles in providing design resources – include an “Assets” component (DreamBig/Assets.xcassets) and note the usage of Storyboards for UI layout in both Camera and Drawing modules.

##### Relationships & Data Flows
- AppDelegate to the Camera/AR module, indicating that it initializes or configures the ARKit session.
- Within the Drawing module, show interactions between the DrawingViewController (UI component) and the DrawingModel (business logic) along with the integration of the Emoji Palette as a plug-in/overlay.
- That inputs from the Apple Pencil are captured within the Drawing module and that these inputs are processed (possibly sending commands or state changes back to the UI and/or model).

##### Architectural Patterns and Design Principles
- Clearly denote an MVC pattern – label view controllers (CameraViewController, DrawingViewController) as “View” components, and DrawingModel as the “Model”.
- If there are any indications of delegated interactions (for example, between the Emoji Palette and DrawingViewController), label these interactions as delegation or callback channels.
- How ARKit and possibly SpriteKit (via use of .sks files) are modern frameworks integrated into the user experiences.

##### Incorporate Relevant Technologies and Configuration Files
- Optionally, note that the Info.plist is the configuration file where many app constants are declared.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% App Initialization & Core
    AD("AppDelegate"):::app

    %% Camera/AR Module
    subgraph "Camera/AR Module"
        CV("CameraViewController"):::camera
        CSB("CameraViewController.storyboard"):::camera
        SSKS("Scene.sks"):::camera
        SSW("Scene.swift"):::camera
    end

    %% Drawing Module
    subgraph "Drawing Module"
        DV("DrawingViewController"):::drawing
        DVSB("DrawingViewController.storyboard"):::drawing
        DM("DrawingModel"):::drawing
        DIV("DrawingImageView"):::drawing
    end

    %% Emoji Palette Submodule
    subgraph "Emoji Palette Module"
        EP("EmojiPalette"):::emoji
        EPP("EmojiPalettePopover"):::emoji
        EPTV("EmojiPaletteTableViewController"):::emoji
        EPTSB("EmojiPaletteTableViewController.storyboard"):::emoji
        DECT("DrawingEmojiTableViewCell"):::emoji
    end

    %% Assets & Storyboards
    subgraph "Assets & Storyboards"
        Assets("Assets"):::assets
        Launch("LaunchScreen.storyboard"):::assets
    end

    %% DevOps/Configuration & Project Settings
    subgraph "DevOps/Configuration"
        Xcode("Xcode Project"):::config
        SwiftLint("SwiftLint Config"):::config
        InstallSwiftLint("Install SwiftLint Script"):::config
        Travis("Travis CI"):::config
        InfoPlist("Info.plist"):::config
    end

    %% Relationships & Data Flows
    AD -->|"initializes"| CV
    CV -->|"sendsARData"| DV
    DV -->|"updates"| DM
    DM -->|"notifies"| DV
    DV -->|"invokes"| EP
    EP -->|"callback"| DV
    CSB -.->|"uses"| Assets
    DVSB -.->|"uses"| Assets

    %% Click Events
    click AD "https://github.com/acromace/dreambig/blob/master/DreamBig/Camera/AppDelegate.swift"
    click CV "https://github.com/acromace/dreambig/blob/master/DreamBig/Camera/CameraViewController.swift"
    click CSB "https://github.com/acromace/dreambig/blob/master/DreamBig/Camera/CameraViewController.storyboard"
    click SSKS "https://github.com/acromace/dreambig/blob/master/DreamBig/Camera/Scene.sks"
    click SSW "https://github.com/acromace/dreambig/blob/master/DreamBig/Camera/Scene.swift"
    click DV "https://github.com/acromace/dreambig/blob/master/DreamBig/Drawing/DrawingViewController.swift"
    click DVSB "https://github.com/acromace/dreambig/blob/master/DreamBig/Drawing/DrawingViewController.storyboard"
    click DM "https://github.com/acromace/dreambig/blob/master/DreamBig/Drawing/DrawingModel.swift"
    click DIV "https://github.com/acromace/dreambig/blob/master/DreamBig/Drawing/DrawingImageView.swift"
    click EP "https://github.com/acromace/dreambig/blob/master/DreamBig/Drawing/EmojiPalette/EmojiPalette.swift"
    click EPP "https://github.com/acromace/dreambig/blob/master/DreamBig/Drawing/EmojiPalette/EmojiPalettePopover.swift"
    click EPTV "https://github.com/acromace/dreambig/blob/master/DreamBig/Drawing/EmojiPalette/EmojiPaletteTableViewController.swift"
    click EPTSB "https://github.com/acromace/dreambig/blob/master/DreamBig/Drawing/EmojiPalette/EmojiPaletteTableViewController.storyboard"
    click DECT "https://github.com/acromace/dreambig/blob/master/DreamBig/Drawing/EmojiPalette/DrawingEmojiTableViewCell.swift"
    click Assets "https://github.com/acromace/dreambig/blob/master/DreamBig/Assets.xcassets"
    click Launch "https://github.com/acromace/dreambig/blob/master/DreamBig/Base.lproj/LaunchScreen.storyboard"
    click Xcode "https://github.com/acromace/dreambig/blob/master/DreamBig.xcodeproj"
    click SwiftLint "https://github.com/acromace/dreambig/blob/master/.swiftlint.yml"
    click InstallSwiftLint "https://github.com/acromace/dreambig/blob/master/Scripts/install_swiftlint.sh"
    click Travis "https://github.com/acromace/dreambig/blob/master/.travis.yml"
    click InfoPlist "https://github.com/acromace/dreambig/blob/master/DreamBig/Info.plist"

    %% Styles
    classDef app fill:#f9c74f,stroke:#333,stroke-width:2px
    classDef camera fill:#90be6d,stroke:#333,stroke-width:2px
    classDef drawing fill:#f9844a,stroke:#333,stroke-width:2px
    classDef emoji fill:#f94144,stroke:#333,stroke-width:2px
    classDef assets fill:#577590,stroke:#333,stroke-width:2px,color:#fff
    classDef config fill:#277da1,stroke:#333,stroke-width:2px,color:#fff
```
