# loisi105/dungeons_and_deadlines architecture

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

- Interactive diagram: https://gitdiagram.com/loisi105/dungeons_and_deadlines
- Repository: https://github.com/loisi105/dungeons_and_deadlines

## Overview

Dungeons & Deadlines is an iOS pixel-art RPG that turns project deadlines into boss fights. Users create or join a raid, plan tasks, start the fight, then deal damage by completing tasks and running focus sessions; the app tracks phases, health, party contributions and the final report. SwiftUI feature views sit above shared game rules and SwiftData storage, while intents and widgets expose common actions on system surfaces. Multiplayer sync is optional and Firebase-backed. Several feature links are documented in the README; unsampled implementation details are not inferred.

Main entry points: [`Packages/DDKit/Sources/DDIntents/GameActions.swift`](https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/DDIntents/GameActions.swift) (Shared actions), [`DungeonsAndDeadlines/App/DungeonsAndDeadlinesApp.swift`](https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/App/DungeonsAndDeadlinesApp.swift) (App and tabs), [`Packages/DDKit/Sources/GameCore/BossEngine.swift`](https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/GameCore/BossEngine.swift) (Boss rules), [`Packages/DDKit/Sources/DDPersistence/RaidStore.swift`](https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/DDPersistence/RaidStore.swift) (Raid store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_root["App and tabs"]
  node_environment["App services"]
end

subgraph group_raid["Raid planning"]
  node_raidui["Raid setup"]
  node_bossselect["Boss selection<br/>[BossSwitcher.swift]"]
  node_tasks["Quest log<br/>[TasksView.swift]"]
end

subgraph group_game["Fight and progress"]
  node_boss["Boss fight<br/>[BossView.swift]"]
  node_focus["Focus timer<br/>[FocusView.swift]"]
  node_meter["Damage meter<br/>[MeterView.swift]"]
  node_report["Raid report<br/>[ReportView.swift]"]
  node_engine["Boss rules<br/>[BossEngine.swift]"]
  node_damage["Damage rules<br/>[DamageConfig.swift]"]
  node_phases["Phase rules<br/>[Phase.swift]"]
  node_focusmodel["Focus session model<br/>[FocusSession.swift]"]
end

subgraph group_state["Game state"]
  node_store[("Raid store<br/>[RaidStore.swift]")]
  node_identity["Player identity"]
  node_syncengine["Sync coordinator<br/>[SyncEngine.swift]"]
  node_raidsync["Raid sync<br/>[RaidSync.swift]"]
  node_firebase["Firebase REST<br/>[FirebaseREST.swift]"]
end

subgraph group_surfaces["System surfaces"]
  node_actions["Shared actions<br/>[GameActions.swift]"]
  node_intents["App intents<br/>[Intents.swift]"]
  node_widgets["Widgets<br/>[BossWidget.swift]"]
  node_live["Live Activity"]
  node_screen["Focus shielding"]
  node_screenframework["Screen Time rules"]
  node_gamecenter["Game Center"]
end

node_player(("Player"))
node_firebase_service[("Firebase")]

node_player -->|"opens"| node_root
node_root -->|"bootstraps"| node_environment
node_root -->|"offers raid setup"| node_raidui
node_root -->|"opens quest log"| node_tasks
node_root -->|"opens boss tab"| node_boss
node_root -->|"offers focus timer"| node_focus
node_root -->|"offers meter"| node_meter
node_root -->|"shows report"| node_report
node_raidui -.->|"creates raid"| node_store
node_tasks -->|"completes tasks"| node_actions
node_tasks -->|"edits tasks"| node_store
node_bossselect -->|"offers joining"| node_raidui
node_actions -->|"writes game state"| node_store
node_store -->|"derives boss state"| node_engine
node_engine -->|"uses damage config"| node_damage
node_engine -->|"uses phase rules"| node_phases
node_store -->|"stores sessions"| node_focusmodel
node_focus -->|"controls focus"| node_actions
node_boss -->|"invokes game actions"| node_actions
node_meter -->|"reads fight stats"| node_engine
node_report -.->|"presents fight results"| node_engine
node_actions -->|"uses player identity"| node_identity
node_intents -.->|"dispatches actions"| node_actions
node_widgets -->|"shares action path"| node_actions
node_live -->|"shares action path"| node_actions
node_actions -->|"reconciles shield"| node_screenframework
node_screen -->|"uses shield rules"| node_screenframework
node_environment -->|"configures sync"| node_syncengine
node_syncengine -->|"delegates sync"| node_raidsync
node_raidsync -.->|"uses REST"| node_firebase
node_firebase -->|"communicates with"| node_firebase_service
node_environment -->|"configures service"| node_gamecenter
node_environment -->|"registers change callback"| node_actions

click node_root "https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/App/DungeonsAndDeadlinesApp.swift"
click node_environment "https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/App/AppEnvironment.swift"
click node_raidui "https://github.com/loisi105/dungeons_and_deadlines/tree/main/DungeonsAndDeadlines/Features/Raid"
click node_bossselect "https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/Features/Root/BossSwitcher.swift"
click node_tasks "https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/Features/Tasks/TasksView.swift"
click node_boss "https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/Features/Boss/BossView.swift"
click node_focus "https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/Features/Focus/FocusView.swift"
click node_meter "https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/Features/Meter/MeterView.swift"
click node_report "https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/Features/Report/ReportView.swift"
click node_engine "https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/GameCore/BossEngine.swift"
click node_damage "https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/GameCore/DamageConfig.swift"
click node_phases "https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/GameCore/Phase.swift"
click node_focusmodel "https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/GameCore/FocusSession.swift"
click node_store "https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/DDPersistence/RaidStore.swift"
click node_identity "https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/DDPersistence/LocalIdentity.swift"
click node_syncengine "https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/Sync/SyncEngine.swift"
click node_raidsync "https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/DDSync/RaidSync.swift"
click node_firebase "https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/DDSync/FirebaseREST.swift"
click node_actions "https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/DDIntents/GameActions.swift"
click node_intents "https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/DDIntents/Intents.swift"
click node_widgets "https://github.com/loisi105/dungeons_and_deadlines/blob/main/DDWidgets/BossWidget.swift"
click node_live "https://github.com/loisi105/dungeons_and_deadlines/blob/main/DDWidgets/FocusLiveActivity.swift"
click node_screen "https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/App/FocusBlocking.swift"
click node_screenframework "https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/DDScreenTime/ScreenTimeShield.swift"
click node_gamecenter "https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/App/GameCenterService.swift"

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_root,node_environment toneBlue
class node_raidui,node_bossselect,node_tasks,node_firebase_service toneAmber
class node_boss,node_focus,node_meter,node_report,node_engine,node_damage,node_phases,node_focusmodel toneMint
class node_store,node_identity,node_syncengine,node_raidsync,node_firebase toneRose
class node_actions,node_intents,node_widgets,node_live,node_screen,node_screenframework,node_gamecenter,node_player toneIndigo
```

## Components

### App shell

- [App and tabs](https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/App/DungeonsAndDeadlinesApp.swift): `DungeonsAndDeadlines/App/DungeonsAndDeadlinesApp.swift`
- [App services](https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/App/AppEnvironment.swift): `DungeonsAndDeadlines/App/AppEnvironment.swift`

### Raid planning

- [Raid setup](https://github.com/loisi105/dungeons_and_deadlines/tree/main/DungeonsAndDeadlines/Features/Raid): `DungeonsAndDeadlines/Features/Raid`
- [Boss selection](https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/Features/Root/BossSwitcher.swift): `DungeonsAndDeadlines/Features/Root/BossSwitcher.swift`
- [Quest log](https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/Features/Tasks/TasksView.swift): `DungeonsAndDeadlines/Features/Tasks/TasksView.swift`

### Fight and progress

- [Boss fight](https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/Features/Boss/BossView.swift): `DungeonsAndDeadlines/Features/Boss/BossView.swift`
- [Focus timer](https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/Features/Focus/FocusView.swift): `DungeonsAndDeadlines/Features/Focus/FocusView.swift`
- [Damage meter](https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/Features/Meter/MeterView.swift): `DungeonsAndDeadlines/Features/Meter/MeterView.swift`
- [Raid report](https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/Features/Report/ReportView.swift): `DungeonsAndDeadlines/Features/Report/ReportView.swift`
- [Boss rules](https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/GameCore/BossEngine.swift): `Packages/DDKit/Sources/GameCore/BossEngine.swift`
- [Damage rules](https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/GameCore/DamageConfig.swift): `Packages/DDKit/Sources/GameCore/DamageConfig.swift`
- [Phase rules](https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/GameCore/Phase.swift): `Packages/DDKit/Sources/GameCore/Phase.swift`
- [Focus session model](https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/GameCore/FocusSession.swift): `Packages/DDKit/Sources/GameCore/FocusSession.swift`

### Game state

- [Raid store](https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/DDPersistence/RaidStore.swift): `Packages/DDKit/Sources/DDPersistence/RaidStore.swift`
- [Player identity](https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/DDPersistence/LocalIdentity.swift): `Packages/DDKit/Sources/DDPersistence/LocalIdentity.swift`
- [Sync coordinator](https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/Sync/SyncEngine.swift): `DungeonsAndDeadlines/Sync/SyncEngine.swift`
- [Raid sync](https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/DDSync/RaidSync.swift): `Packages/DDKit/Sources/DDSync/RaidSync.swift`
- [Firebase REST](https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/DDSync/FirebaseREST.swift): `Packages/DDKit/Sources/DDSync/FirebaseREST.swift`

### System surfaces

- [Shared actions](https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/DDIntents/GameActions.swift): `Packages/DDKit/Sources/DDIntents/GameActions.swift`
- [App intents](https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/DDIntents/Intents.swift): `Packages/DDKit/Sources/DDIntents/Intents.swift`
- [Widgets](https://github.com/loisi105/dungeons_and_deadlines/blob/main/DDWidgets/BossWidget.swift): `DDWidgets/BossWidget.swift`
- [Live Activity](https://github.com/loisi105/dungeons_and_deadlines/blob/main/DDWidgets/FocusLiveActivity.swift): `DDWidgets/FocusLiveActivity.swift`
- [Focus shielding](https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/App/FocusBlocking.swift): `DungeonsAndDeadlines/App/FocusBlocking.swift`
- [Screen Time rules](https://github.com/loisi105/dungeons_and_deadlines/blob/main/Packages/DDKit/Sources/DDScreenTime/ScreenTimeShield.swift): `Packages/DDKit/Sources/DDScreenTime/ScreenTimeShield.swift`
- [Game Center](https://github.com/loisi105/dungeons_and_deadlines/blob/main/DungeonsAndDeadlines/App/GameCenterService.swift): `DungeonsAndDeadlines/App/GameCenterService.swift`

### Other components

- **Player**
- **Firebase**

## Connections

- Player → App and tabs: opens (evidence: `README.md`)
- App and tabs → App services: bootstraps (evidence: `DungeonsAndDeadlines/App/AppEnvironment.swift`)
- App and tabs → Raid setup: offers raid setup (evidence: `README.md`)
- App and tabs → Quest log: opens quest log (evidence: `README.md`)
- App and tabs → Boss fight: opens boss tab (evidence: `README.md`)
- App and tabs → Focus timer: offers focus timer (evidence: `README.md`)
- App and tabs → Damage meter: offers meter (evidence: `README.md`)
- App and tabs → Raid report: shows report (evidence: `README.md`)
- Raid setup → Raid store: creates raid
- Quest log → Shared actions: completes tasks (evidence: `DungeonsAndDeadlines/Features/Tasks/TasksView.swift`)
- Quest log → Raid store: edits tasks (evidence: `DungeonsAndDeadlines/Features/Tasks/TasksView.swift`)
- Boss selection → Raid setup: offers joining (evidence: `DungeonsAndDeadlines/Features/Root/BossSwitcher.swift`)
- Shared actions → Raid store: writes game state (evidence: `Packages/DDKit/Sources/DDIntents/GameActions.swift`)
- Raid store → Boss rules: derives boss state (evidence: `Packages/DDKit/Sources/DDPersistence/RaidStore.swift`)
- Boss rules → Damage rules: uses damage config (evidence: `Packages/DDKit/Sources/GameCore/BossEngine.swift`)
- Boss rules → Phase rules: uses phase rules (evidence: `Packages/DDKit/Sources/GameCore/BossEngine.swift`)
- Raid store → Focus session model: stores sessions (evidence: `Packages/DDKit/Sources/DDPersistence/RaidStore.swift`)
- Focus timer → Shared actions: controls focus (evidence: `DungeonsAndDeadlines/Features/Focus/FocusView.swift`)
- Boss fight → Shared actions: invokes game actions (evidence: `DungeonsAndDeadlines/Features/Boss/BossView.swift`)
- Damage meter → Boss rules: reads fight stats (evidence: `Packages/DDKit/Sources/GameCore/BossEngine.swift`)
- Raid report → Boss rules: presents fight results
- Shared actions → Player identity: uses player identity (evidence: `Packages/DDKit/Sources/DDIntents/GameActions.swift`)
- App intents → Shared actions: dispatches actions
- Widgets → Shared actions: shares action path (evidence: `README.md`)
- Live Activity → Shared actions: shares action path (evidence: `README.md`)
- Shared actions → Screen Time rules: reconciles shield (evidence: `Packages/DDKit/Sources/DDIntents/GameActions.swift`)
- Focus shielding → Screen Time rules: uses shield rules (evidence: `DungeonsAndDeadlines/App/FocusBlocking.swift`)
- App services → Sync coordinator: configures sync (evidence: `DungeonsAndDeadlines/App/AppEnvironment.swift`)
- Sync coordinator → Raid sync: delegates sync (evidence: `DungeonsAndDeadlines/Sync/SyncEngine.swift`)
- Raid sync → Firebase REST: uses REST (evidence: `README.md`)
- Firebase REST → Firebase: communicates with (evidence: `README.md`)
- App services → Game Center: configures service (evidence: `DungeonsAndDeadlines/App/AppEnvironment.swift`)
- App services → Shared actions: registers change callback (evidence: `DungeonsAndDeadlines/App/AppEnvironment.swift`)
