# shitijg118/solarsystem-ar architecture

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

- Interactive diagram: https://gitdiagram.com/shitijg118/solarsystem-ar
- Repository: https://github.com/shitijg118/solarsystem-ar

## Overview

##### Project Type and Purpose
- This is a full-stack AR mobile application built in Unity, using the Vuforia engine for marker-based AR.  Its goal is to spawn a 3D solar system on a mobile device, allow users to tap planets to retrieve information, and present MCQs in the AR scene.

##### File Structure Analysis
- Top-level directories:
- AssetBundles – prebuilt demo bundles for testing delivery.
- Assets/AddressableAssetsData – Unity Addressables configuration.
- Assets/Editor – migration scripts, custom editor tooling.
- Assets/ExternalDependencyManager & GooglePlayPlugins – build-time plugins for Android, Google Play asset delivery, bundletool integration.
- Assets/Plugins – Android Gradle templates.
- Assets/Solar System Level – core game code: scenes, 3D models, materials, scripts, quiz logic.
- Packages & ProjectSettings – Unity package manifest (Vuforia, external libs) and project config.
- Patterns:
- Component-based Unity architecture.
- Use of Addressables/AssetBundles and Google Play Asset Delivery for runtime asset loading.
- Plugin isolation: Vuforia, LeanTouch, DOTween, TextMeshPro, Google Play core/common/assetdelivery.

##### README Insights
- Confirms use of Unity + Vuforia.
- Describes two runtime services: AR marker detection (Vuforia) and dynamic content (MCQ, planet info).
- No server-side components—entirely on-device, except for potential asset downloads from Google Play.

a. Main Components
- Mobile Device (Camera + Touch Input)
- Vuforia Engine (AR Marker Detection)
- Unity Runtime
– Scene Manager
– SolarSystemController (instantiates planet prefabs)
– QuizManager & UI Controllers (MCQ logic)
– Addressables/AssetBundles Loader
– Plugins (LeanTouch input, DOTween animation, TextMeshPro text rendering)
- Google Play Asset Delivery (runtime asset packs via Play Services)
- Local Resources & Prebundled Assets (Models, Materials, Scenes)
b. Relationships & Interactions
- Camera feed → Vuforia → ARCamera prefab → Unity Scene
- On marker recognized → SolarSystemController spawns planet prefabs
- User tap → LeanTouch → QuizManager opens UI (TextMeshPro)
- Quiz data & 3D models loaded via Addressables; fallback to local if offline
- At first run, Google Play Asset Delivery may fetch large asset packs
c. Architectural Patterns & Principles
- Component-based modularity (each subsystem as a Unity component)
- Separation of concerns: AR detection, content loading, UI/quiz logic
- Lazy loading of assets via Addressables/Asset Bundles for performance
- Plugin isolation: third-party code confined to Plugins/GooglePlayPlugins folders
d. Key Technologies
- Unity Engine
- Vuforia AR SDK
- Unity Addressables & AssetBundles
- Google Play Asset Delivery / Bundletool
- LeanTouch (touch input abstraction)
- DOTween (tweening/animations)
- TextMeshPro (rich text UI)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Input Layer
    MobileInput["Camera & Touch Input"]:::input

    %% AR Detection
    VuforiaEngine["Vuforia Engine"]:::plugin
    MobileInput -->|"Camera Feed"| VuforiaEngine

    %% Unity Runtime
    subgraph "Unity Runtime"
        SceneManager["Scene Manager"]:::unity
        SolarSystemController["SolarSystemController"]:::unity
        QuizUI["Quiz & UI Controllers"]:::unity
        AddressablesLoader["Addressables Loader"]:::unity
    end

    VuforiaEngine -->|"AR Marker Recognized"| SceneManager
    SceneManager -->|"Load Scene & Instantiate ARCamera"| SolarSystemController
    SolarSystemController -->|"Instantiate Prefab"| SolarSystemController
    SolarSystemController -->|"Request Asset"| AddressablesLoader

    %% User Input Flow
    MobileInput -->|"User Tap Event"| LeanTouch
    subgraph "Plugins"
        LeanTouch["LeanTouch Input"]:::plugin
        DOTween["DOTween Animation"]:::plugin
        TextMeshPro["TextMeshPro UI"]:::plugin
    end
    LeanTouch -->|"Tap Detected"| QuizUI
    QuizUI -->|"Render Text"| TextMeshPro
    SolarSystemController -->|"Animate Planet"| DOTween

    %% Asset Delivery
    subgraph "Asset Delivery"
        GPAD["Google Play Asset Delivery"]:::assetDelivery
        AssetBundles["AssetBundles Demo"]:::assetDelivery
        LocalResources["Local Resources"]:::storage
    end
    AddressablesLoader -->|"Download Asset Pack"| GPAD
    AddressablesLoader -->|"Load from Prebundled"| AssetBundles
    AddressablesLoader -->|"Fallback Load"| LocalResources

    %% Click Events
    click VuforiaEngine "https://github.com/shitijg118/solarsystem-ar/blob/main/Assets/Resources/VuforiaConfiguration.asset"
    click SceneManager "https://github.com/shitijg118/solarsystem-ar/tree/main/Assets/Solar System Level/Scenes"
    click SolarSystemController "https://github.com/shitijg118/solarsystem-ar/blob/main/Assets/Solar System Level/Scripts/SolarSystemController.cs"
    click QuizUI "https://github.com/shitijg118/solarsystem-ar/tree/main/Assets/Solar System Level/Scripts"
    click AddressablesLoader "https://github.com/shitijg118/solarsystem-ar/tree/main/Assets/AddressableAssetsData"
    click GPAD "https://github.com/shitijg118/solarsystem-ar/tree/main/Assets/GooglePlayPlugins/com.google.play.assetdelivery/Runtime/Scripts"
    click AssetBundles "https://github.com/shitijg118/solarsystem-ar/tree/main/AssetBundles/AssetDeliveryDemo"
    click LeanTouch "https://github.com/shitijg118/solarsystem-ar/tree/main/Assets/Solar System Level/Plugins/CW/LeanTouch"
    click DOTween "https://github.com/shitijg118/solarsystem-ar/tree/main/Assets/Solar System Level/Plugins/Demigiant/DOTween"
    click TextMeshPro "https://github.com/shitijg118/solarsystem-ar/tree/main/Assets/Solar System Level/TextMesh Pro"

    %% Styles
    classDef unity fill:#cce5ff,stroke:#004085
    classDef plugin fill:#d4edda,stroke:#155724
    classDef assetDelivery fill:#fff3cd,stroke:#856404
    classDef input fill:#f8d7da,stroke:#721c24
    classDef storage fill:#e2e3e5,stroke:#6c757d
```
