Purpose
Theweb-api is the primary API backend for the Rapida dashboard. Every request from the browser — authentication, organization setup, assistant management, credential storage — goes through this service. It also acts as the gRPC proxy for downstream services, validating JWT tokens before forwarding requests.
Port
9001 — HTTP · gRPC · gRPC-web (cmux)Language
Go 1.25
Gin (REST) + gRPC
Storage
PostgreSQL
web_db
Redis (session cache)Request Flow
Core Components
Authentication & Session Management
Authentication & Session Management
Handles user registration, login, password recovery, OAuth 2.0, and JWT issuance.
| Feature | Detail |
|---|---|
| Token type | JWT (signed with SECRET, shared across all services) |
| Token storage | Client-side (Authorization header) |
| Session cache | Redis DB 1 |
| OAuth providers | Google, GitHub, Microsoft (configured per deployment) |
| Token expiry | Default 24 hours |
Organization & Project Hierarchy
Organization & Project Hierarchy
Every resource in Rapida is scoped to an The gRPC auth interceptor rejects any request where the JWT’s organization claim does not match the target resource’s
Organization → Project hierarchy. The web-api enforces this at the gRPC interceptor level.organization_id.Credential Vault
Credential Vault
Provider API keys are encrypted with AES-256-GCM before storage. The encryption key is derived from
SECRET.| Operation | Behavior |
|---|---|
| Store key | AES-256-GCM encrypt → write to web_db |
| Retrieve key | Read → decrypt in-memory → forward to integration-api |
| Rotate key | Replace ciphertext; in-flight calls unaffected |
| Audit | Every read/write logged with user ID and timestamp |
gRPC Proxy Routing
gRPC Proxy Routing
The web-api proxies all dashboard gRPC calls after JWT validation:
| gRPC Path Prefix | Forwarded To |
|---|---|
/web_api · /vault_api | Local (web-api) |
/workflow_api · /assistant_api · /knowledge_api | assistant-api:9007 |
/tool_api · /endpoint_api · /webhook_api | endpoint-api:9005 |
/provider_api · /integration_api | integration-api:9004 |
/document_api | document-api:9010 |
/connect_api | Local (OAuth connector) |
/talk_api | Direct to assistant-api via Nginx — not proxied through web-api |
Database Migrations
Database Migrations
Migrations run automatically at service startup using golang-migrate. Migration files are in To run migrations manually:
api/web-api/migrations/:Running
- Docker Compose
- From Source
Health Endpoints
| Endpoint | Purpose |
|---|---|
GET /readiness/ | Service ready (DB + Redis connected) |
GET /healthz/ | Liveness probe |
Troubleshooting
Service exits immediately on startup
Service exits immediately on startup
The most common cause is PostgreSQL not yet healthy.
JWT validation fails across services
JWT validation fails across services
All services must share the same
SECRET value. Confirm it is identical in .web.env, .assistant.env, .integration.env, and .endpoint.env.gRPC proxy returns 'service unavailable'
gRPC proxy returns 'service unavailable'