Skip to main content

Overview

The web-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

Handles user registration, login, password recovery, OAuth 2.0 flows, and JWT issuance.
Every resource in Rapida is scoped to an Organization → Project hierarchy. The web-api enforces this scoping at the gRPC interceptor level.
Each entity stores 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.
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.
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.
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

Edit docker/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

SECRET is used for JWT signing and credential vault encryption. All services must share the same value. Changing it in production will invalidate all active sessions and make stored vault credentials unreadable. Rotate carefully.

Running


Database Migrations

Migrations run automatically at service startup using golang-migrate. Migration files are in api/web-api/migrations/ and follow sequential naming:
To run manually during local development:

Health & Observability


Troubleshooting

The most common cause is PostgreSQL not yet healthy. Check make logs-web and confirm the postgres container is Up (healthy).
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.
  • Ensure the relevant oauth2 keys are set in docker/web-api/web.yml.
  • Verify the redirect URI registered with the OAuth provider exactly matches UI_HOST.
  • The target downstream service must be running and healthy.
  • Verify INTEGRATION_HOST, ENDPOINT_HOST, ASSISTANT_HOST point to reachable addresses.
  • Check make status to confirm all containers are Up.

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.