5.5 KiB
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, moderation, and room access rules | normalizeRoomAccessControl(), resolveRoomPermission() |
| auth | Login / register HTTP orchestration, user-bar UI | AuthService |
| chat | Messaging rules, sync logic, GIF/Klipy integration, chat UI | KlipyService, canEditMessage(), ChatMessagesComponent |
| notifications | Notification preferences, unread tracking, desktop alert orchestration | NotificationsFacade |
| 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:
- attachment/README.md
- access-control/README.md
- auth/README.md
- chat/README.md
- notifications/README.md
- screen-share/README.md
- server-directory/README.md
- voice-connection/README.md
- voice-session/README.md
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
-
Import from the barrel. Outside a domain, always import from
domains/<name>(theindex.ts), never from internal paths. -
No cross-domain imports. Domain A must never import from Domain B's internals. Shared types live in
shared-kernel/. -
Features compose domains. Top-level
features/components inject domain facades and compose their outputs — they never contain business logic. -
Store slices are application-level.
store/messages,store/rooms,store/usersare global state managed by NgRx. They import fromshared-kernelfor 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/ |