Announcement

A minimal Kipchak starter project

Mamluk · · 3 min read
A minimal Kipchak starter project

Version 4.0 of the Kipchak starter project is the smallest complete Kipchak API. It starts as one FrankenPHP container and contains one versioned resource, an OpenAPI document generated from the code, a health check and tests. Developers add the drivers and middleware their API needs.

composer create-project kipchak/starter my-api
cd my-api
docker compose up --watch

What the starter contains

The previous starter project demonstrated every free driver and middleware. It required 25 packages, started eight services, including MySQL, CouchDB, Memcached and RabbitMQ, and needed two manual commands before CouchDB would run. The new starter requires four packages: Kipchak’s core, the Config and Logger drivers and the Error middleware.

Its example resource, GET /v1/sultans, has a route, a controller, a model and a data transfer object, in the folders a Kipchak API uses for each. The controller’s PHP attributes describe each operation and the data transfer object’s attributes describe its schema, and the API serves the OpenAPI document built from them at /openapi.json. composer openapi writes the same document to a file for client generation or continuous integration, and fails if the document has a problem. Errors use the same JSON envelope as every other response.

The tests boot the API as a FrankenPHP worker does and send requests to it without a web server. They check each route, and that the OpenAPI document describes every route and is valid.

Time to first request

From an empty directory, with nothing downloaded beforehand, the API answered its first request after 3 minutes and 29 seconds, on a connection of about 30 Mbit/s. Most of that time is the download of the runtime image, so it is shorter on a faster connection. The starter project documentation gives the measurement in full, with the commands to repeat it.

Instructions for coding assistants

The starter includes an AGENTS.md file, which coding assistants such as Claude Code, Codex and Cursor read before they change a project. It states where routes, controllers, data transfer objects and configuration are kept, how to add an endpoint, how to run the tests, and the rules that worker mode requires. An assistant otherwise tends to write Kipchak code as it would write code for Slim Framework or Laravel. The index of the Kipchak documentation for language models remains at https://kipchak.dev/llms.txt.

The examples repository

The demonstrations of each driver and middleware have moved to a new examples repository, with their configuration and a Docker Compose service for each one that needs a server. The documentation of each driver now refers to its configuration there.

Existing Kipchak APIs are not affected. A project created from the starter does not depend on it, so no API needs to change.

The getting started guide describes how to create a project, with or without PHP installed locally.

Share
← Back to the Journal

More from the Journal