Spindle - Type-safe web framework for modern OCaml 5

Show HN: Spindle – a full-featured, type-safe web framework for OCaml 5

Spindle - Type-safe web framework for modern OCaml 5

Spindle is a full-featured web framework built for OCaml 5, bringing type safety to every layer of server development. It generates OpenAPI specs, Zod-style validation, and typed clients directly from your route definitions, so your server, native client, and Melange-compiled frontend can never disagree about paths or data shapes. Beyond REST, it covers WebSockets, server-sent streams, MCP resources with live subscriptions, OAuth 2.0 bearer token verification, and HTTP over Unix sockets. If you've wanted OCaml's rigor without hand-writing boilerplate, Spindle lets you define routes once and get everything else for free.

Spindle gains a third printer from the walk OpenAPI and Zod read, so the three cannot disagree: wiretype's module for every shape, a component named for the route, and a function per route over the browser's fetch.

More from this day

2026-11-07