How rakshityadav1868/kairo-main works
Kairo is a payment orchestration platform: a merchant integrates through the SDK or dashboard, configures projects, keys, providers and routing, then creates payments/refunds and receives normalized webhook outcomes. The Go API owns routing and provider operations; PostgreSQL-backed services support identity, billing, limits, analytics and audit. The graph also preserves documented dashboard, SDK, provider, webhook and usage capabilities. Some links are limited to the entrypoint’s route/setup excerpt and SOURCE INDEX references; unsampled implementation details are not inferred.
Main entry points: main.go Go API server · db.go PostgreSQL queries · provider_handler.go Webhook ingestion · service.go Payment operations
Components 23
Merchant interfaces
- Dashboard
frontend/app/(dashboard)/projects/[projectId]/page.tsx - Frontend API client
frontend/lib/api.ts - TypeScript SDK
sdk/src/client.ts - SDK HTTP transport
sdk/src/http.ts
API and identity
- Go API server
backend/cmd/api/main.go - Authentication
backend/internal/auth/service.go - Project management
backend/internal/project/handler.go - API key management
backend/internal/apikey/handler.go
Payment orchestration
- Payment operations
backend/internal/payment/service.go - Provider routing
backend/internal/payment/routing_engine.go - Provider integrations
backend/internal/provider/service.go - Provider registry
backend/internal/provider/registry.go - Webhook ingestion
backend/internal/webhook/provider_handler.go - Event normalization
backend/internal/webhook/providers - Webhook dispatch
backend/internal/webhook/dispatcher.go
Operations and insight
- Plan billing
backend/internal/billing/service.go - Usage and limits
backend/internal/usage/service.go - Analytics
backend/internal/analytics/service.go - Audit trail
backend/internal/audit/service.go - PostgreSQL queries
backend/internal/db/queries/db.go
Other components
- Merchant developer
- Payment providers
- Merchant webhook endpoint
Connections 31
- Merchant developer → Dashboard: configures
- Dashboard → Frontend API client: requests data
- Frontend API client → Go API server: calls API
- Merchant developer → TypeScript SDK: integrates
- TypeScript SDK → SDK HTTP transport: uses transport
sdk/src/client.ts - SDK HTTP transport → Go API server: sends requests
- Go API server → Authentication: routes auth
backend/cmd/api/main.go - Go API server → Project management: routes projects
backend/cmd/api/main.go - Go API server → API key management: routes keys
backend/cmd/api/main.go - Go API server → Payment operations: routes payments
backend/cmd/api/main.go - Go API server → Provider routing: routes decisions
backend/cmd/api/main.go - Go API server → Webhook ingestion: routes webhooks
backend/cmd/api/main.go - Go API server → Provider registry: registers providers
backend/cmd/api/main.go - Go API server → Webhook dispatch: starts worker
backend/cmd/api/main.go - Webhook ingestion → Event normalization: maps events
backend/internal/webhook/provider_handler.go - Webhook ingestion → Provider integrations: decrypts credentials
backend/internal/webhook/provider_handler.go - Webhook ingestion → Webhook dispatch: queues events
backend/internal/webhook/provider_handler.go - Webhook ingestion → PostgreSQL queries: records events
backend/internal/webhook/provider_handler.go - Payment operations → Provider routing: selects provider
- Payment operations → Provider integrations: executes payment
- Provider integrations → Payment providers: integrates
- Provider routing → PostgreSQL queries: loads rules
backend/internal/payment/routing_engine.go - Authentication → PostgreSQL queries: stores identities
backend/internal/auth/service.go - Plan billing → PostgreSQL queries: records plan transactions
backend/internal/billing/service.go - Usage and limits → PostgreSQL queries: reads usage
backend/internal/usage/service.go - Analytics → PostgreSQL queries: queries analytics
backend/internal/analytics/service.go - Webhook dispatch → Merchant webhook endpoint: delivers events
- Go API server → Plan billing: routes billing
backend/cmd/api/main.go - Go API server → Usage and limits: routes usage
backend/cmd/api/main.go - Go API server → Analytics: routes analytics
backend/cmd/api/main.go - Go API server → Audit trail: routes audit