Understand the Domain Layer and Code Interfaces
mainThe application logic is organized into three Ash domains. Each domain exposes a code interface consisting of plain functions. When calling these functions from the web layer, you must provide an actor: option to ensure authorization policies are enforced.
| Domain | Resources | Key Concepts |
|---|---|---|
Realworld.Accounts | User, Token | AshAuthentication (registration, sign-in, token revocation), policy bypass vs. anonymous access, self-only updates |
Realworld.Articles | Article, Tag, ArticleTag, Comment, Favorite | Derived attributes (slug, sanitized markdown), manage_relationship for tags, paginated/filtered feeds, aggregates/calculations, PubSub notifiers, upserts |
Realworld.Profiles | Follow | Actor-scoped reads, idempotent upsert creates, policy-guarded destroys |