# ciao-games/rewardcenter architecture

> Architecture diagram of the GitHub repository ciao-games/rewardcenter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ciao-games/rewardcenter
- Repository: https://github.com/ciao-games/rewardcenter

## Overview

Reward Center is a Unity SDK for deep-link-driven in-game offerwall campaigns. A game integrates the SDK, passes incoming links, and reports gameplay events; the SDK parses campaign payloads, activates and persists campaign state, then exposes progress and milestone events to the UI. The UI presents onboarding, a tracker, milestone map, and reward celebrations. The README describes a standalone or CiaoSDK module with no backend. Some UI and asset relationships are based on SOURCE INDEX references rather than inspected implementation excerpts.

Main entry points: [`Runtime/RewardCenter.cs`](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/RewardCenter.cs) (Reward Center facade), [`Runtime/UI/RewardCenterOverlay.cs`](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/RewardCenterOverlay.cs) (Reward Center overlay), [`Runtime/Data/PayloadMapper.cs`](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/Data/PayloadMapper.cs) (Payload mapper), [`Runtime/DeepLinkHandler.cs`](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/DeepLinkHandler.cs) (Deep-link handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sdk["SDK orchestration"]
  node_sdk["Reward Center facade<br/>[RewardCenter.cs]"]
  node_config["SDK configuration"]
  node_logger["Logging"]
end

subgraph group_campaign["Campaign processing"]
  node_link["Deep-link handler<br/>[DeepLinkHandler.cs]"]
  node_mapper["Payload mapper<br/>[PayloadMapper.cs]"]
  node_payload["Campaign payload<br/>[CampaignPayload.cs]"]
  node_campaignmodel["Campaign model<br/>[Campaign.cs]"]
  node_milestone["Milestone model<br/>[Milestone.cs]"]
  node_milestonepayload["Milestone payload"]
  node_router["Event router<br/>[EventRouter.cs]"]
end

subgraph group_state["State and assets"]
  node_store["State store<br/>[StateStore.cs]"]
  node_stateobj["Reward Center state"]
  node_downloader["Asset downloader<br/>[AssetDownloader.cs]"]
  node_assetpaths["Asset paths<br/>[AssetPaths.cs]"]
end

subgraph group_ui["Player experience"]
  node_overlay["Reward Center overlay"]
  node_welcome["Welcome popup<br/>[WelcomePopup.cs]"]
  node_map["Milestones map"]
  node_row["Milestone row<br/>[MilestoneRow.cs]"]
  node_tracker["Tracker card<br/>[TrackerCard.cs]"]
  node_celebration["Celebration popup"]
  node_chestpopup["Chest celebration"]
  node_simplepopup["Simple celebration"]
  node_chestview["Chest view<br/>[ChestView.cs]"]
  node_tweener["UI tweener<br/>[CiaoTweener.cs]"]
  node_confetti["Confetti effects"]
end

node_game(("Game integration"))

node_game -.->|"integrates"| node_sdk
node_sdk -->|"loads"| node_config
node_sdk -->|"loads and saves"| node_store
node_sdk -->|"routes events"| node_router
node_sdk -->|"parses links"| node_link
node_sdk -->|"downloads assets"| node_downloader
node_sdk -->|"activates"| node_campaignmodel
node_sdk -->|"publishes completion"| node_milestone
node_sdk -->|"configures"| node_logger
node_link -->|"maps payload"| node_mapper
node_link -->|"deserializes"| node_payload
node_mapper -->|"converts"| node_payload
node_mapper -->|"converts"| node_milestonepayload
node_mapper -->|"creates"| node_campaignmodel
node_mapper -->|"creates"| node_milestone
node_router -->|"updates and saves"| node_store
node_router -->|"completes"| node_milestone
node_store -->|"persists"| node_stateobj
node_stateobj -->|"holds"| node_campaignmodel
node_downloader -->|"uses paths"| node_assetpaths
node_overlay -->|"reads state and subscribes"| node_sdk
node_overlay -->|"drives"| node_welcome
node_overlay -->|"drives"| node_map
node_overlay -->|"drives"| node_tracker
node_overlay -->|"shows"| node_celebration
node_map -->|"renders"| node_row
node_chestpopup -->|"extends"| node_celebration
node_simplepopup -->|"extends"| node_celebration
node_chestpopup -->|"uses"| node_chestview
node_chestview -->|"uses"| node_tweener

click node_sdk "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/RewardCenter.cs"
click node_config "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/RewardCenterConfig.cs"
click node_logger "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/Logger/RewardCenterLogger.cs"
click node_link "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/DeepLinkHandler.cs"
click node_mapper "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/Data/PayloadMapper.cs"
click node_payload "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/Data/CampaignPayload.cs"
click node_campaignmodel "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/Data/Campaign.cs"
click node_milestone "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/Data/Milestone.cs"
click node_milestonepayload "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/Data/MilestonePayload.cs"
click node_router "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/EventRouter.cs"
click node_store "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/StateStore.cs"
click node_stateobj "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/RewardCenterState.cs"
click node_downloader "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/AssetDownloader.cs"
click node_assetpaths "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/AssetPaths.cs"
click node_overlay "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/RewardCenterOverlay.cs"
click node_welcome "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/WelcomePopup.cs"
click node_map "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/MilestonesMapPopup.cs"
click node_row "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/MilestoneRow.cs"
click node_tracker "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/TrackerCard.cs"
click node_celebration "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/CelebrationPopupBase.cs"
click node_chestpopup "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/ChestCelebrationPopup.cs"
click node_simplepopup "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/SimpleCelebrationPopup.cs"
click node_chestview "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/ChestView.cs"
click node_tweener "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/CiaoTweener.cs"
click node_confetti "https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/ConfettiParticleUI.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sdk,node_config,node_logger toneBlue
class node_link,node_mapper,node_payload,node_campaignmodel,node_milestone,node_milestonepayload,node_router toneAmber
class node_store,node_stateobj,node_downloader,node_assetpaths toneMint
class node_overlay,node_welcome,node_map,node_row,node_tracker,node_celebration,node_chestpopup,node_simplepopup,node_chestview,node_tweener,node_confetti toneRose
class node_game toneIndigo
```

## Components

### SDK orchestration

- [Reward Center facade](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/RewardCenter.cs): `Runtime/RewardCenter.cs`
- [SDK configuration](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/RewardCenterConfig.cs): `Runtime/RewardCenterConfig.cs`
- [Logging](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/Logger/RewardCenterLogger.cs): `Runtime/Logger/RewardCenterLogger.cs`

### Campaign processing

- [Deep-link handler](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/DeepLinkHandler.cs): `Runtime/DeepLinkHandler.cs`
- [Payload mapper](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/Data/PayloadMapper.cs): `Runtime/Data/PayloadMapper.cs`
- [Campaign payload](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/Data/CampaignPayload.cs): `Runtime/Data/CampaignPayload.cs`
- [Campaign model](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/Data/Campaign.cs): `Runtime/Data/Campaign.cs`
- [Milestone model](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/Data/Milestone.cs): `Runtime/Data/Milestone.cs`
- [Milestone payload](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/Data/MilestonePayload.cs): `Runtime/Data/MilestonePayload.cs`
- [Event router](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/EventRouter.cs): `Runtime/EventRouter.cs`

### State and assets

- [State store](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/StateStore.cs): `Runtime/StateStore.cs`
- [Reward Center state](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/RewardCenterState.cs): `Runtime/RewardCenterState.cs`
- [Asset downloader](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/AssetDownloader.cs): `Runtime/AssetDownloader.cs`
- [Asset paths](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/AssetPaths.cs): `Runtime/AssetPaths.cs`

### Player experience

- [Reward Center overlay](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/RewardCenterOverlay.cs): `Runtime/UI/RewardCenterOverlay.cs`
- [Welcome popup](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/WelcomePopup.cs): `Runtime/UI/WelcomePopup.cs`
- [Milestones map](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/MilestonesMapPopup.cs): `Runtime/UI/MilestonesMapPopup.cs`
- [Milestone row](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/MilestoneRow.cs): `Runtime/UI/MilestoneRow.cs`
- [Tracker card](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/TrackerCard.cs): `Runtime/UI/TrackerCard.cs`
- [Celebration popup](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/CelebrationPopupBase.cs): `Runtime/UI/CelebrationPopupBase.cs`
- [Chest celebration](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/ChestCelebrationPopup.cs): `Runtime/UI/ChestCelebrationPopup.cs`
- [Simple celebration](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/SimpleCelebrationPopup.cs): `Runtime/UI/SimpleCelebrationPopup.cs`
- [Chest view](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/ChestView.cs): `Runtime/UI/ChestView.cs`
- [UI tweener](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/CiaoTweener.cs): `Runtime/UI/CiaoTweener.cs`
- [Confetti effects](https://github.com/ciao-games/rewardcenter/blob/main/Runtime/UI/ConfettiParticleUI.cs): `Runtime/UI/ConfettiParticleUI.cs`

### Other components

- **Game integration**

## Connections

- Game integration → Reward Center facade: integrates
- Reward Center facade → SDK configuration: loads (evidence: `Runtime/RewardCenter.cs`)
- Reward Center facade → State store: loads and saves (evidence: `Runtime/RewardCenter.cs`)
- Reward Center facade → Event router: routes events (evidence: `Runtime/RewardCenter.cs`)
- Reward Center facade → Deep-link handler: parses links (evidence: `Runtime/RewardCenter.cs`)
- Reward Center facade → Asset downloader: downloads assets (evidence: `Runtime/RewardCenter.cs`)
- Reward Center facade → Campaign model: activates (evidence: `Runtime/RewardCenter.cs`)
- Reward Center facade → Milestone model: publishes completion (evidence: `Runtime/RewardCenter.cs`)
- Reward Center facade → Logging: configures (evidence: `Runtime/RewardCenter.cs`)
- Deep-link handler → Payload mapper: maps payload (evidence: `Runtime/DeepLinkHandler.cs`)
- Deep-link handler → Campaign payload: deserializes (evidence: `Runtime/DeepLinkHandler.cs`)
- Payload mapper → Campaign payload: converts (evidence: `Runtime/Data/PayloadMapper.cs`)
- Payload mapper → Milestone payload: converts (evidence: `Runtime/Data/PayloadMapper.cs`)
- Payload mapper → Campaign model: creates (evidence: `Runtime/Data/PayloadMapper.cs`)
- Payload mapper → Milestone model: creates (evidence: `Runtime/Data/PayloadMapper.cs`)
- Event router → State store: updates and saves (evidence: `Runtime/EventRouter.cs`)
- Event router → Milestone model: completes (evidence: `Runtime/EventRouter.cs`)
- State store → Reward Center state: persists (evidence: `Runtime/StateStore.cs`)
- Reward Center state → Campaign model: holds (evidence: `Runtime/RewardCenterState.cs`)
- Asset downloader → Asset paths: uses paths (evidence: `Runtime/AssetDownloader.cs`)
- Reward Center overlay → Reward Center facade: reads state and subscribes (evidence: `Runtime/UI/RewardCenterOverlay.cs`)
- Reward Center overlay → Welcome popup: drives (evidence: `Runtime/UI/RewardCenterOverlay.cs`)
- Reward Center overlay → Milestones map: drives (evidence: `Runtime/UI/RewardCenterOverlay.cs`)
- Reward Center overlay → Tracker card: drives (evidence: `Runtime/UI/RewardCenterOverlay.cs`)
- Reward Center overlay → Celebration popup: shows (evidence: `Runtime/UI/RewardCenterOverlay.cs`)
- Milestones map → Milestone row: renders (evidence: `Runtime/UI/MilestonesMapPopup.cs`)
- Chest celebration → Celebration popup: extends (evidence: `Runtime/UI/ChestCelebrationPopup.cs`)
- Simple celebration → Celebration popup: extends (evidence: `Runtime/UI/SimpleCelebrationPopup.cs`)
- Chest celebration → Chest view: uses (evidence: `Runtime/UI/ChestCelebrationPopup.cs`)
- Chest view → UI tweener: uses (evidence: `Runtime/UI/ChestView.cs`)
