Reference
Example apps
Runnable example apps — one per adapter, across all three repos.
Node.js
The doctreen repo ships runnable
example apps in the example/ folder — clone the repo and run them to see
the full UI in action.
npm run example # Express JS → http://localhost:3000/api/docs
npm run example:ts # Express TS → http://localhost:3000/api/docs
npm run example:fastify # Fastify JS → http://localhost:3001/api/docs
npm run example:fastify:ts # Fastify TS → http://localhost:3001/api/docs
npm run example:hono # Hono JS → http://localhost:3002/api/docs
npm run example:hono:ts # Hono TS → http://localhost:3002/api/docs
npm run example:koa # Koa JS → http://localhost:3003/api/docs
npm run example:koa:ts # Koa TS → http://localhost:3003/api/docs
npm run example:nest # NestJS TS → http://localhost:3001/docs| File | Framework | Highlights |
|---|---|---|
example/app.js | Express | JSDoc, defineRoute, named schemas, error responses, flow presets |
example/app.ts | Express | Fully typed with defineRoute generics, flow presets |
example/fastify-app.js | Fastify | JSDoc, defineRoute, Fastify native JSON Schema, flow presets |
example/fastify-app.ts | Fastify | Fully typed with Fastify route generics, flow presets |
example/hono-app.js | Hono | JSDoc, defineRoute; run via npx tsx |
example/hono-app.ts | Hono | Fully typed with Hono Context |
example/koa-app.js | Koa | JSDoc, defineRoute, @koa/router |
example/koa-app.ts | Koa | Fully typed with Router.RouterContext |
example/nest-app.ts | NestJS | @DocRoute, @Doc* decorators, Zod schemas, s builder |
The Redis-backed drift store reference lives at
example/drift-redis-store.js — see Schema drift.
Python
The doctreen-py repo ships runnable Flask and FastAPI examples:
git clone https://github.com/CanDgrmc/doctreen-py && cd doctreen-py
python -m venv .venv && source .venv/bin/activate
pip install -e ".[flask,pydantic]"
flask --app examples/flask_app run # → http://localhost:5000/docs| File | Framework | Highlights |
|---|---|---|
examples/flask_app.py | Flask | @define_route, Pydantic models, s.* builder, URL-converter path types, validation + drift config |
examples/fastapi_app.py | FastAPI | mount_doctreen beside FastAPI's own docs, drift over app.openapi() |
PHP
The doctreen-php repo doesn't
ship a standalone example app yet — the quickest tour is the
Laravel adapter page plus the repo's test suite,
which exercises the ->doc() macro, exporter parity, validation, drift, and
flows end to end.
Hosted demo
For the live UI without cloning anything, hit the hosted demo at demo.doctreen.dev/docs.