How surelypal/claritydnd works
Clarity is a SwiftUI tabletop role-playing companion for creating and managing D&D-style characters, running campaigns, and coordinating a party locally between players and a Dungeon Master. The character workflow spans creation, a persistent character record, and the character sheet; the party workflow covers finding or hosting a lobby, connecting peers, sharing session updates, and coordinating rests. Other visible capabilities include campaign management, maps, tarot, customizable themes, and database recovery. The README is empty, and sampled source is partial, so uncertain wiring between unsampled views and services is omitted.
Main entry points: PartyManager.swift Party coordinator · PartyManager+Messages.swift Party messages · CampaignManager.swift Campaign manager · DNDCharacter.swift Character model
Components 28
Character management
- Character creation
Views/CharacterCreation/CharacterCreationView.swift - Character store
Core/CharacterStore.swift - Character model
Core/Models/DNDCharacter.swift - Character sheet
Views/CharacterSheet/CharacterSheetView.swift - Tarot cards
Views/Tarot/TarotTabView.swift
Party session
- Party lobby
Views/Party/PartyLobbyView.swift - Searching view
Views/Party/LobbyComponents/SearchingView.swift - Party coordinator
Core/Party/PartyManager.swift - Peer connection
Core/Party/PartyManager+Connection.swift - Party messages
Core/Party/PartyManager+Messages.swift - Message types
Core/Party/PartyMessage.swift - Rest voting
Core/Party/RestVotingManager.swift - DM item storage
Views/Party/DMComponents/DMItemStorageView.swift - Multipeer Connectivity
Campaign tools
- Campaign selection
Views/Party/DMComponents/CampaignSelectionView.swift - Campaign manager
Core/Party/CampaignManager.swift - Campaign model
Core/Models/Campaign.swift - Game rules
Core/Party/GameRules.swift - Campaign map
Views/Map/MapView.swift
App experience
- Theme settings
Views/Settings/ThemeSettingsView.swift - Theme manager
Theme/ThemeManager.swift - UserDefaults
- Recovery screen
Views/Shared/DatabaseRecoveryView.swift - Database recovery
Core/DatabaseRecovery.swift - Backup files
Other components
- Player / DM
- App entry
ClarityApp.swift - App navigation
Views/ContentView.swift
Connections 23
- Player / DM → App entry: launches
- App entry → App navigation: starts
- Player / DM → App navigation: uses
- Character creation → Character model: creates
- Character store → Character model: manages
- Character sheet → Character model: presents
- Party lobby → Party coordinator: coordinates through
- Searching view → Party coordinator: cancels via
- Party coordinator → Peer connection: delegates connection
- Peer connection → Multipeer Connectivity: advertises and connects
- Party coordinator → Party messages: dispatches messages
- Party messages → Message types: encodes and handles
- Party messages → Multipeer Connectivity: sends and receives
- Party coordinator → Rest voting: coordinates votes
- DM item storage → Party coordinator: manages storage through
- Campaign selection → Campaign manager: selects campaigns through
- Campaign manager → Campaign model: loads and saves
- Campaign manager → Backup files: reads and writes JSON
- Campaign map → Campaign model: uses campaign locations
- Theme settings → Theme manager: selects themes through
- Theme manager → UserDefaults: reads and writes selection
- Recovery screen → Database recovery: requests recovery actions
- Database recovery → Backup files: lists and restores