Platform services

Database

The Database service provisions and connects databases for your project. It can attach to an existing shared server or spin up a dedicated one, for MongoDB, PostgreSQL, and Redis.

What it does

Dreambase POSTs webhook events to the Database service; the service acts on them — provisioning servers, running health checks, executing function calls — and calls back into the Dreambase API to report status, logs, and outputs such as a connection string.

Built on NestJS

The Database service is a NestJS application. Each integration exposes a single POST /<name>/webhook endpoint, and the app can run as a single Vercel serverless function or as a local Node process.

Integrations

Each integration has its own dedicated reference page:

Each integration is its own webhook route:

POST/database/webhook
Generic database entry point
POST/mongo/webhook
Connect to an existing / shared MongoDB server
POST/mongod/webhook
Spawn & manage a local mongod process
POST/postgres/webhook
Connect to an existing / shared PostgreSQL server
POST/postgres-server/webhook
Provision a PostgreSQL server (Docker or cloud)
POST/redis/webhook
Provision a Redis instance (shared or dedicated)

The mongo and postgres routes attach a new database on an existing, shared server, while postgres-server provisions a dedicated server (via Docker or a cloud provider) and mongod manages a local mongod process for development. The redis route does both in one service — a namespaced slice of a shared server, or a dedicated instance on the provider of your choice.

Events it handles

All routes understand the same event names:

  • WEBHOOK_CHALLENGE — verify the webhook endpoint.
  • HEALTH_CHECK — confirm the database is reachable.
  • DEPLOYMENT_CREATED — provision/attach the database and return its connection details.
  • DEPLOYMENT_DELETED — tear the database down.
  • DOWNLOAD_STARTED — signal that a build/download has begun.
  • FUNCTION_CALL — run a named database function.

Configuration

The service is configured through environment variables. The most important ones:

VariableRequiredDescription
DREAMBASE_API_URLyesBase URL of the Dreambase API the service calls back into.
CORS_ORIGINSprodComma-separated allowed origins.
MONGO_SHARED_SERVER_URLoptionalShared MongoDB connection string (no database name).
POSTGRES_SHARED_SERVER_URLoptionalShared PostgreSQL connection string (no database name).
REDIS_SHARED_SERVER_URLoptionalShared Redis connection string (redis:///rediss://) for serverType=shared.
PORToptionalLocal server port (default 3008; unused on Vercel).
DISABLE_LOCAL_PROCESSESoptionalForce-treat the runtime as serverless (disables mongod/Docker spawning).
ENABLE_LOCAL_PROCESSESoptionalForce-allow local process spawning on a detected serverless host.

Serverless limitations

On serverless hosts there is no persistent local machine, so the mongod route — which spawns and manages a local process — is meant for local or long-running deployments. Use the shared-server or provisioned-server routes when running serverless.