ddd test 2
This commit is contained in:
@@ -24,10 +24,11 @@ src/app/
|
||||
infrastructure/
|
||||
persistence/ # shared storage adapters and persistence facades
|
||||
realtime/ # shared signaling, peer transport, media runtime state
|
||||
shared-kernel/ # intentionally shared cross-domain contracts and enums
|
||||
core/
|
||||
constants.ts # cross-domain technical constants only
|
||||
helpers/ # transitional pure helpers still being moved out
|
||||
models/ # reusable cross-domain contracts only
|
||||
models/ # transitional shared contracts pending extraction
|
||||
platform/
|
||||
platform.service.ts # runtime/environment detection adapters
|
||||
external-link.service.ts # browser/electron navigation adapters
|
||||
@@ -50,7 +51,8 @@ Dependency direction must stay one-way:
|
||||
3. `domains/*/domain` should stay framework-light and hold domain models plus pure logic.
|
||||
4. `domains/*/infrastructure` may depend on `core/platform/`, browser APIs, HTTP, persistence, and external adapters.
|
||||
5. Top-level `infrastructure/` should hold shared technical runtime implementations; `core/` should hold cross-domain utilities, compatibility entry points, and platform adapters rather than full runtime subsystems.
|
||||
6. `core/models/` should only hold shared cross-domain contracts. Domain-specific models belong inside their domain folder.
|
||||
6. `shared-kernel/` should hold the intentionally shared cross-domain contracts that more than one domain must agree on.
|
||||
7. `core/models/` is transitional and should shrink over time. Domain-specific models belong inside their domain folder, while stable cross-domain contracts should move into `shared-kernel/`.
|
||||
|
||||
## Responsibility Split
|
||||
|
||||
@@ -81,7 +83,9 @@ This keeps feature and domain code platform-agnostic and makes the browser runti
|
||||
- Attachment download-policy rules now live in `domains/attachment/domain/attachment.logic.ts`.
|
||||
- Attachment file-path sanitizing and storage-bucket selection live in `domains/attachment/infrastructure/attachment-storage.helpers.ts`.
|
||||
- New domain types should be placed in a dedicated model file inside their domain folder when they are not shared across domains.
|
||||
- Only cross-domain contracts should stay in `core/models/`.
|
||||
- Only transitional shared contracts should stay in `core/models/`.
|
||||
- Stable cross-domain enums and contracts should be extracted into `shared-kernel/` once ownership is clear.
|
||||
- Shared signaling and attachment transport contracts should live in `shared-kernel/` rather than inside `core/models/`.
|
||||
|
||||
## Incremental Refactor Path
|
||||
|
||||
@@ -118,6 +122,8 @@ The current refactor establishes these patterns:
|
||||
- `domains/voice-connection/` now exposes `application/voice-connection.facade.ts` as the voice-specific Angular-facing boundary.
|
||||
- `domains/screen-share/` now exposes `application/screen-share.facade.ts` plus `application/screen-share-source-picker.service.ts`, and `domain/screen-share.config.ts` is the real source for screen-share presets/options plus `ELECTRON_ENTIRE_SCREEN_SOURCE_NAME`.
|
||||
- Shared transport contracts and the low-level signaling and peer-connection stack now live under `infrastructure/realtime/`.
|
||||
- Shared media preference contracts now live under `shared-kernel/media-preferences.ts`, so `voice-session` settings no longer import `voice-connection` or `screen-share` domain internals.
|
||||
- Shared signaling and attachment contracts now live under `shared-kernel/signaling-contracts.ts` and `shared-kernel/attachment-contracts.ts`, while `core/models/` keeps compatibility re-exports during the migration.
|
||||
- Realtime debug network metric collection now lives in `infrastructure/realtime/logging/debug-network-metrics.ts`; the debug console reads that infrastructure state rather than keeping the metric store inside `core/services/`.
|
||||
- Shared media handling, voice orchestration helpers, noise reduction, and screen-share capture adapters now live in `infrastructure/realtime/media/`.
|
||||
- The old `domains/webrtc/*` and `core/services/webrtc.service.ts` compatibility shims have been removed after all in-repo callers moved to `core/realtime`, `domains/voice-connection/`, and `domains/screen-share/`.
|
||||
@@ -133,6 +139,27 @@ The current refactor establishes these patterns:
|
||||
- Endpoint health probing and fallback transport for server-directory live in `domains/server-directory/infrastructure/server-endpoint-health.service.ts`.
|
||||
- Server-directory HTTP fan-out, endpoint resolution, and API response normalization live in `domains/server-directory/infrastructure/server-directory-api.service.ts`.
|
||||
|
||||
## Shared Kernel Organisation
|
||||
|
||||
`shared-kernel/` is organised by business concept so newcomers can find types
|
||||
by meaning rather than by historical accident:
|
||||
|
||||
| File | Contents |
|
||||
|---|---|
|
||||
| `user.models.ts` | `User`, `UserStatus`, `UserRole`, `RoomMember` |
|
||||
| `room.models.ts` | `Room`, `RoomSettings`, `RoomPermissions`, `Channel`, `ChannelType` |
|
||||
| `message.models.ts` | `Message`, `Reaction`, `DELETED_MESSAGE_CONTENT` |
|
||||
| `moderation.models.ts` | `BanEntry` |
|
||||
| `voice-state.models.ts` | `VoiceState`, `ScreenShareState` |
|
||||
| `chat-events.ts` | `ChatEventType`, `ChatEvent`, `ChatInventoryItem` |
|
||||
| `media-preferences.ts` | `LatencyProfile`, `ScreenShareQuality`, quality presets |
|
||||
| `signaling-contracts.ts` | `SignalingMessage`, `SignalingMessageType` |
|
||||
| `attachment-contracts.ts` | `ChatAttachmentAnnouncement`, `ChatAttachmentMeta` |
|
||||
|
||||
`core/models/index.ts` is now a **pure re-export barrel** that re-exports all
|
||||
of the above (plus domain re-exports like `ServerInfo`) for backward
|
||||
compatibility. New code should import from `shared-kernel/` directly.
|
||||
|
||||
## Next Candidates
|
||||
|
||||
- Migrate remaining voice and room UI from transitional `features/` into domain-local `feature/` and `ui/` folders.
|
||||
|
||||
Reference in New Issue
Block a user