QUESTPIE
Adapters

Overview

Adapters are the swappable backends behind QUESTPIE's infrastructure, queue, search, realtime, storage, email, and KV. Pick one per concern in your config and the same app code runs on any of them.

An adapter is the plug-in backend for one piece of infrastructure. Your application code talks to a stable service, app.queue, app.search, ctx.kv, ctx.email, app.storage, and the adapter decides where that work actually runs. Wire one adapter per concern in your config and you can move from Postgres to Redis, local disk to S3, or a dev console to Resend by editing a single block. No handler changes, no dispatch changes, no app-code changes.

This is the QUESTPIE principle in action: core, modules, and your own code reach each backend through the same contract. The built-in adapters implement the exact same seam your own adapter would.

Adapter kinds

QUESTPIE ships six adapter slots. Each page below covers the whole vertical: which backend to choose, how to configure it, and the contract to implement your own.

AdapterWhat it doesDefault
QueueWhere background jobs run, store, schedule, and hand work to a worker.pg-boss (Postgres)
SearchFull-text and semantic search behind .searchable() and app.search.Postgres (FTS + trigram)
RealtimeThe server-side transport that fans out live-query changes across every app instance.poll-based
StorageWhere uploaded file bytes physically live, plus signed URLs and visibility.local filesystem
EmailThe delivery backend for every outgoing email template and one-off message.console (dev)
KVA typed key-value store on ctx.kv with TTL and tag-based invalidation.in-memory

How they wire in

You select an adapter once, in questpie.config.ts (or the .build({ ... }) call), and the rest of your code is untouched. See Configuration for where each slot lives and how the runtime resolves it.

Each adapter declares its own capabilities, so the runtime can fail fast or branch, for example, a queue adapter advertises whether it supports long-running workers or push delivery. The per-adapter pages document the relevant flags.

Custom adapters

Every adapter is defined by a public contract, QueueAdapter, SearchAdapter, RealtimeAdapter, StorageConfig, MailAdapter, KVAdapter, and the built-ins are just implementations of it. To back a concern with a broker the built-ins don't cover, implement the contract and wire your instance into the same config slot. The full build-your-own loop, which applies to every adapter kind, lives in Building a plugin.

On this page