← Projects

Decoy

A scriptable mock API server built from plain-text routes and live-editable behaviour.

Decoy is a file-based mock API server. A route is a readable KDL file containing its method, path, responses, headers, documentation, and optional latency. Folders inherit defaults through their own KDL files, so an entire collection remains visible in the filesystem.

It shares a philosophy and several core components with Quiver, but it solves the other side of the problem: Quiver sends requests; Decoy provides the service they can talk to.

Mocks that behave like systems

Static fixtures are useful until a client needs authentication, pagination, rate limits, changing state, or different answers for different inputs.

Decoy templates can read path parameters, query values, headers, and JSON bodies. They can generate timestamps and UUIDs, transform values, and select one of several named responses using rules. Artificial latency can be applied at route or folder level.

For behaviour beyond templates, Decoy embeds sandboxed Lua 5.4. Pre-response and post-response hooks can inspect a request, modify a response, and store values across calls. A rule can also execute a Lua script to construct its response directly. This makes it possible to model stateful workflows without turning a mock into a second application backend.

Scripts cannot access the filesystem, operating system, package loader, or debugger. The boundary is intentional: a mock collection should be safe to clone and inspect before it is trusted.

Change the server while it runs

The HTTP layer is built on Axum. Collections are shared behind a read/write lock, allowing routes and scripts to be edited while the server continues serving requests.

The Ratatui interface combines a collection tree, tabbed route and script editors, server controls, and a console for request and Lua output. An egui desktop shell uses the same engine and editing components. Shared interaction patterns with Quiver make the two tools feel like parts of one workshop without making them the same project.

Decoy is a way to keep test infrastructure close to the contract it represents: plain files, real behaviour where it matters, and very little ceremony between an idea and a running endpoint.

Want to try it?

It is not yet available for public consumption, but watch this space.