Files
LumaWeb/docs/ARCHITECTURE.md
T
wt 54bfc0f34f
Foundation checks / foundation (push) Successful in 1m12s
initial commit
2026-10-14 17:47:38 +07:00

43 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Архитектурные границы
Это целевое разделение; modules ещё предстоит реализовать после выбора стека.
```text
UI components / routes
↓ commands ↑ view models
Application use cases / lifecycle
↓ ports
Domain models / pure policies
↕ adapters
IndexedDB / XMPP WSS / crypto worker / media worker / browser APIs
↕
External XMPP + upload + TURN + maps + push gateway
```
## Каталоги реализации
- `src/domain/`: модели и pure policies без UI/network.
- `src/application/`: use cases, event reducers, account-bound operation context.
- `src/ports/`: интерфейсы, errors, capability contracts.
- `src/adapters/`: xmpp, storage, crypto, media, notifications.
- `src/ui/`: tokens, primitive components, feature views, routes.
- `src/workers/`: crypto/media off-main work.
- `src/platform/`: browser lifecycle, permission, multi-tab coordination.
- `services/push/`: минимальный Web Push gateway; не messaging backend и не OMEMO endpoint.
- `infra/`: local fixtures/server/HTTPS/WSS/turn and deployment configuration.
- `tests/`: unit, contract, integration, browser, interoperability, security, tooling.
Расширения файлов/commands определяет accepted stack ADR. В карточках scope без расширения обозначает logical module stem: после ADR создаётся файл с принятым расширением, не файл без расширения.
## Направления зависимостей
Domain не импортирует adapters/UI. UI вызывает application commands, не Signal/session/network internals. Adapters реализуют ports. Event содержит accountId, conversationId/eventId и generation/cancellation context; поздний результат старого аккаунта отбрасывается.
Durable history mutations и checkpoint — одна transaction boundary. Внешняя доставка и локальная запись не образуют общей distributed transaction: retries должны учитывать факт возможной успешной отправки.
Gateway хранит только необходимые push subscription/registration metadata; encrypted message plaintext ему недоступен. CORS не обходится скрытым decrypting proxy.
## Governance
Любое изменение shared contract требует ADR/contract update и focused contract tests. До этого downstream owner не угадывает поля интерфейса. Интерфейсы сначала фиксируются в S01, затем implementers добавляют concrete code.