Overview
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)All gRPC-web requests from the browser, except for real-time audio, are routed through
web-api. The service validates the JWT and proxies the request to the correct downstream service using typed gRPC clients from pkg/clients/.Components
Authentication & Session Management
Authentication & Session Management
Handles user registration, login, password recovery, OAuth 2.0 flows, and JWT issuance.
Organization & Project Hierarchy
Organization & Project Hierarchy
Every resource in Rapida is scoped to an Each entity stores
Organization → Project hierarchy. The web-api enforces this scoping at the gRPC interceptor level.organization_id and project_id via the Organizational base model. The gRPC auth interceptor rejects any request where the JWT’s organization claim does not match the target resource.Credential Vault
Credential Vault
Provider API keys and OAuth tokens are encrypted with AES-256 before storage. The encryption key is derived from
SECRET. The vault is the source of truth for all provider credentials — integration-api reads from it at call time.Internal gRPC Proxy
Internal gRPC Proxy
The web-api acts as a proxy for all dashboard gRPC calls. It validates the JWT, extracts the organization context, and forwards to the correct downstream service.
Entity and Data Model
Entity and Data Model
All entities compose base GORM models:
IDs are generated as Snowflake IDs in the
BeforeCreate GORM hook — no UUID dependency. The Snowflake generator is initialized at service startup using the service instance ID.Request Flow
Configuration
Editdocker/web-api/web.yml before starting the service. The variable names below map to nested YAML keys, so POSTGRES__HOST corresponds to postgres.host.
Required variables
Tuning variables
Full environment file
Running
- Docker Compose
- From Source
Database Migrations
Migrations run automatically at service startup using golang-migrate. Migration files are inapi/web-api/migrations/ and follow sequential naming:
Health & Observability
Troubleshooting
Service exits immediately on startup
Service exits immediately on startup
The most common cause is PostgreSQL not yet healthy. Check
make logs-web and confirm the postgres container is Up (healthy).JWT validation fails across services
JWT validation fails across services
All services must share the same secret value. Confirm
secret is identical in docker/web-api/web.yml, docker/assistant-api/assistant.yml, docker/integration-api/integration.yml, and docker/endpoint-api/endpoint.yml.OAuth login redirects fail
OAuth login redirects fail
- Ensure the relevant
oauth2keys are set indocker/web-api/web.yml. - Verify the redirect URI registered with the OAuth provider exactly matches
UI_HOST.
Next Steps
Assistant API
Voice orchestration service that web-api proxies to.
Integration API
Provider credentials used by the vault.
Installation Guide
Deploy the full platform with Docker Compose.
Architecture
Full system topology and routing.