QUESTPIE

Documentation

One schema. Every output. Backend-first TypeScript framework with schema-driven codegen.

One Schema. Every Output.

QUESTPIE is a backend-first TypeScript framework where you define your data schema once, and codegen + introspection project it into typed runtimes, APIs, and frontends.

Schema → Codegen → Typed Runtime → Projection → Any Frontend

Define collections, routes, jobs, and hooks as plain files. Codegen wires them into a type-safe runtime. The admin panel, client SDK, and OpenAPI spec are all projections of the same schema — not separate definitions.

Active Development — QUESTPIE follows semantic versioning. The API may change between releases. Full stability is targeted for v3.

How It Works

collections/posts.ts
import { collection } from "#questpie/factories";

export default collection("posts").fields(({ f }) => ({
	title: f.text(255).required(),
	body: f.textarea().localized(),
	cover: f.upload({ to: "assets", mimeTypes: ["image/*"] }),
	author: f.relation("users"),
	status: f.select(["draft", "published"]),
	publishedAt: f.date(),
}));

This single file defines:

  • Database schema — Drizzle table with correct column types
  • API validation — Zod schemas for create/update
  • Query operators — Type-safe where, orderBy, with
  • Client types — End-to-end TypeScript from server to frontend
  • Admin UI — Form fields, list columns, filters (when @questpie/admin is installed)

Package Architecture

Required
questpie              — core runtime (collections, fields, hooks, routes, codegen)
@questpie/<adapter>   — HTTP adapter (hono, elysia, or nextjs)

Optional
@questpie/admin       — admin interface via schema introspection
@questpie/tanstack-query — TanStack Query hooks

Documentation Sections

Canonical Example

All code examples in these docs come from the TanStack Barbershop — a real booking app with 7 collections, server routes, background jobs, email templates, and a full admin dashboard.

On this page