Architecture
Architecture
High-level architecture of the Kaiten platform.
Architecture
Kaiten follows a modular monolith architecture with vertical feature slices, event-driven integration, and infrastructure-as-code deployment.
System Overview
┌─────────────────────────────────────────────────────────┐
│ Traefik (API Gateway) │
│ ├── JWT Middleware (Clerk/OIDC) │
│ ├── ForwardAuth Middleware (API tokens) │
│ └── Routing (path-based → services) │
├─────────────────┬───────────────────────────────────────┤
│ Go API Server │ Worker / Event Processor │
│ (Fiber + Huma) │ (Dapr + Svix) │
│ REST + GraphQL │ Webhook delivery │
│ + OFREP │ │
├─────────────────┴───────────────────────────────────────┤
│ PostgreSQL 17 (WAL logical replication) │
│ ├── Domain tables │
│ ├── outbox_events (CDC source) │
│ └── feature_audit_trail │
├─────────────────────────────────────────────────────────┤
│ Event Pipeline (optional) │
│ Debezium → RabbitMQ → Dapr → Svix │
├─────────────────────────────────────────────────────────┤
│ React Dashboard │ MCP Server (FastMCP) │
│ (TanStack Router)│ (AI assistant integration) │
└──────────────────┴──────────────────────────────────────┘Key Design Decisions
| Decision | Choice | Rationale |
|---|---|---|
| Architecture | Modular monolith | Simplicity + module isolation without microservice overhead |
| API Framework | Fiber + Huma v2 | OpenAPI generation, validation, structured operations |
| Database | PostgreSQL 17 | WAL logical replication for CDC, JSONB for flexible schemas |
| Event Delivery | Transactional outbox + CDC | Guarantees at-least-once without dual writes |
| Auth Gateway | Traefik | Plugin ecosystem, JWT validation, ForwardAuth |
| Feature Flags | CEL + OFREP | Standard evaluation language + OpenFeature compatibility |
Learn More
- API Internals — Module structure and code organization
- Event Pipeline — Detailed CDC flow
- Database — Schema design and migrations

