Files
Toju/toju-app/src/app/domains
Myx 07e91a0d09
All checks were successful
Queue Release Build / prepare (push) Successful in 19s
Deploy Web Apps / deploy (push) Successful in 7m55s
Queue Release Build / build-windows (push) Successful in 28m37s
Queue Release Build / build-linux (push) Successful in 47m3s
Queue Release Build / build-android (push) Successful in 20m33s
Queue Release Build / finalize (push) Successful in 3m48s
fix: Bug - Add logout in mobile version of settings, allow clearing data on android
Expose settings logout on mobile where the title bar is hidden, and enable
Capacitor data settings with storage visibility and local erase/sign-out.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 22:31:40 +02:00
..
2026-05-25 17:17:32 +02:00

Domains

Each folder below is a bounded context — a self-contained slice of business logic with its own models, application services, and (optionally) infrastructure adapters and UI.

Quick reference

Domain Purpose Public entry point
attachment File upload/download, chunk transfer, persistence AttachmentFacade
access-control Role, permission, ban matching, moderation, and room access rules normalizeRoomAccessControl(), resolveRoomPermission(), hasRoomBanForUser()
authentication Login / register HTTP orchestration, user-bar UI AuthenticationService
chat Messaging rules, sync logic, GIF/Klipy integration, chat UI KlipyService, canEditMessage(), ChatMessagesComponent
direct-message One-to-one WebRTC messages, offline queueing, delivery state, and friends DirectMessageService, FriendService
direct-call Direct and small-group private calls initiated from people cards and direct messages DirectCallService
experimental-media Optional media playback experiments kept isolated from the default attachment path ExperimentalMediaSettingsService
game-activity Foreground-window-first game detection with confidence scoring (MIN_GAME_CONFIDENCE), focused-window scan suppression in Electron, server metadata matching, P2P now-playing sync, and elapsed playtime formatting GameActivityService, formatGameActivityElapsed()
notifications Notification preferences, unread tracking, desktop alert orchestration NotificationsFacade
plugins Client-only plugin manifests, load ordering, registry state, and signal-server support metadata PluginHostService, PluginRegistryService
profile-avatar Profile picture upload, crop/zoom editing, processing, local persistence, and P2P avatar sync ProfileAvatarFacade
screen-share Source picker, quality presets ScreenShareFacade
server-directory Multi-server endpoint management, health checks, invites, server search UI ServerDirectoryFacade
theme JSON-driven theming, element registry, layout syncing, picker tooling, and Electron saved-theme library management ThemeService
voice-connection Voice activity detection, bitrate profiles, in-channel camera transport VoiceConnectionFacade
voice-session Join/leave orchestration, voice settings persistence VoiceSessionFacade

Detailed docs

The larger domains also keep longer design notes in their own folders:

Folder convention

Every domain follows the same internal layout:

domains/<name>/
├── index.ts                 # Barrel — the ONLY file outsiders import
├── domain/                  # Pure types, interfaces, business rules
│   ├── <name>.models.ts
│   └── <name>.logic.ts      # Pure functions (no Angular, no side effects)
├── application/             # Angular services that orchestrate domain logic
│   └── <name>.facade.ts     # Public entry point for the domain
├── infrastructure/          # Technical adapters (HTTP, storage, WebSocket)
└── feature/                 # Optional: domain-owned UI components / routes
    └── settings/            # e.g. settings subpanel owned by this domain

Rules

  1. Import from the barrel. Outside a domain, always import from domains/<name> (the index.ts), never from internal paths.

  2. No cross-domain imports. Domain A must never import from Domain B's internals. Shared types live in shared-kernel/.

  3. Features compose domains. Top-level features/ components inject domain facades and compose their outputs — they never contain business logic.

  4. Store slices are application-level. store/messages, store/rooms, store/users are global state managed by NgRx. They import from shared-kernel for types and from domain facades for side-effects.

Where do I put new code?

I want to… Put it in…
Add a new business concept New folder under domains/ following the convention above
Add a type used by multiple domains shared-kernel/ with a descriptive file name
Add a UI component for a domain feature domains/<name>/feature/ or domains/<name>/ui/
Add a settings subpanel domains/<name>/feature/settings/
Add a top-level page or shell component features/
Add persistence logic infrastructure/persistence/ or domains/<name>/infrastructure/
Add realtime/WebRTC logic infrastructure/realtime/