How manirajkatuwal/krab-pub works
Krab is a server-first Rust web framework and reference multi-service application. Its main user flow is a browser request routed by the frontend, rendered as HTML with selectively interactive islands, then hydrated and navigated client-side; the frontend can also call domain services through protocol-aware clients. The workspace adds authentication, user persistence, supervised service composition, and CLI operational controls. Some subsystems are included from README capabilities and the file tree; their internal wiring is not shown where source excerpts were unavailable.
Main entry points: src/main.rs Frontend service · src/main.rs Service orchestrator · rendering.rs Page rendering · protocol_client.rs Protocol client
Components 22
Web experience
- Frontend service
services/service_frontend/src/main.rs - HTTP routes
services/service_frontend/src/routes.rs - Page rendering
services/service_frontend/src/rendering.rs - Island components
crates/framework/krab_client/src/components.rs - Island hydration
crates/framework/krab_client/src/lib.rs - Client navigation
crates/framework/krab_client/src/router.rs
Framework runtime
- Core runtime
crates/framework/krab_core/src/lib.rs - Runtime config
crates/framework/krab_core/src/config.rs - HTTP service
crates/framework/krab_core/src/service.rs - View and server macros
crates/framework/krab_macros/src/lib.rs
Domain services
- Protocol client
services/service_frontend/src/protocol_client.rs - Auth service
services/service_auth/src/main.rs - Users service
services/service_users/src/main.rs - Users API adapters
services/service_users/src/adapters/mod.rs - User domain
services/service_users/src/domain/service.rs - User persistence
services/service_users/src/db/mod.rs - Service contracts
crates/framework/krab_core/src/service_contract.rs
Operations
- Service orchestrator
crates/tooling/krab_orchestrator/src/main.rs - Krab CLI
crates/tooling/krab_cli/src/main.rs - Operational governance
crates/tooling/krab_cli/src/governance.rs
Other components
- Browser user
- PostgreSQL
Connections 23
- Browser user → Frontend service: requests pages
- Frontend service → Runtime config: loads configuration
- Frontend service → HTTP service: serves routes
- Frontend service → HTTP routes: registers routes
- HTTP routes → Page rendering: renders pages
- Page rendering → Browser user: returns HTML
- Page rendering → Island components: renders components
- Browser user → Island hydration: loads WASM
- Island hydration → Client navigation: starts navigation
- Client navigation → Frontend service: fetches pages
- Frontend service → Protocol client: calls domain APIs
- Protocol client → Service contracts: uses service contracts
- Protocol client → Users service: requests user operations
- Auth service → HTTP service: serves HTTP
- Users service → Users API adapters: exposes APIs
- Users API adapters → User domain: dispatches operations
- User domain → User persistence: reads users
- User persistence → PostgreSQL: persists data
- Service orchestrator → Auth service: starts and supervises
- Service orchestrator → Users service: starts and supervises
- Service orchestrator → Frontend service: starts and supervises
- Krab CLI → Operational governance: dispatches governance
- Krab CLI → Service orchestrator: bootstraps stack