Component Interactions¶
This page explains how Ravyn components connect and where responsibilities change.
Interaction map¶
flowchart TD
App["Ravyn"] --> Include["Include"]
App --> Router["Router"]
Include --> Child["ChildRavyn"]
Child --> Router
Router --> Gateway["Gateway"]
Router --> WS["WebSocketGateway"]
Router --> Controller["Controller"]
Gateway --> Handler["Handler"]
Controller --> Handler
App --> Settings["Settings"]
App --> Lifespan["Lifespan Hooks"]
Responsibility boundaries¶
- Ravyn: top-level composition and defaults.
- Include: route tree composition by prefix or namespace.
- Router: endpoint grouping and local policies.
- Gateway/Controller: endpoint definition style.
- Handler: request-specific orchestration.
Typical call path¶
Ravyn
-> Include / Router
-> Gateway / Controller endpoint
-> dependencies resolve
-> handler runs
Design guidance¶
- Prefer
Includefor domain boundaries (/users,/billing,/admin). - Keep routers feature-scoped and small.
- Use controllers when endpoints share class-level behavior.
- Keep transport concerns at handler level; move business logic to services.