PHPackages                             goldziher/spikard - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. goldziher/spikard

ActivePhp-ext[Framework](/categories/framework)

goldziher/spikard
=================

Rust-centric multi-language HTTP framework with polyglot bindings

v0.16.1(3w ago)107154[9 issues](https://github.com/Goldziher/spikard/issues)MITRustPHP &gt;=8.2CI passing

Since Nov 30Pushed 1w ago3 watchersCompare

[ Source](https://github.com/Goldziher/spikard)[ Packagist](https://packagist.org/packages/goldziher/spikard)[ RSS](/packages/goldziher-spikard/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (5)Versions (87)Used By (0)

[![spikard - polyglot web toolkit](https://raw.githubusercontent.com/Goldziher/spikard/main/docs/assets/spikard-banner.svg)](https://raw.githubusercontent.com/Goldziher/spikard/main/docs/assets/spikard-banner.svg)**One web toolkit, every language.**

Rust-centric polyglot web toolkit. Single Rust core compiled to 15 languages through alef-generated bindings — type-safe routing, OpenAPI/AsyncAPI/GraphQL/JSON-RPC codegen, tower-http middleware, and fixture-driven cross-language testing.

**Rust core** · Python · TypeScript · Ruby · PHP · Elixir · Go · Java · C# · Kotlin · Dart · Swift · Zig · WASM · C FFI

 [ ![Built with alef](https://camo.githubusercontent.com/6890fe86514d95703ddc6b88b89cf79e96d690a0be4ecbcf1129a08aca0656bd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6275696c74253230776974682d616c65662532302544372539302d3030376563363f7374796c653d666c61742d737175617265) ](https://github.com/xberg-io/alef) [ ![Rust](https://camo.githubusercontent.com/2cc7d470353dfdf68903fd5c6facf44e92bed73794b4ba541139497bb640b8e0/68747470733a2f2f696d672e736869656c64732e696f2f6372617465732f762f7370696b6172643f636f6c6f723d303037656336267374796c653d666c61742d737175617265) ](https://crates.io/crates/spikard) [ ![Python](https://camo.githubusercontent.com/7bed9975392205632aff9d05b4ad547635cff34166b90239ee9742a0a51cfc6e/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f7370696b6172643f636f6c6f723d303037656336267374796c653d666c61742d737175617265) ](https://pypi.org/project/spikard/) [ ![Node.js](https://camo.githubusercontent.com/30ee1f1d5fceb23feb6905c2cc938e133f55b3d428e8f10bc24c27aeebde3339/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f407370696b6172642f6e6f64653f636f6c6f723d303037656336267374796c653d666c61742d737175617265) ](https://www.npmjs.com/package/@spikard/node) [ ![WASM](https://camo.githubusercontent.com/fd23dc7e7667f04366f7441d70bca036a03a5f8cdd4609eda1aa7841d6eedbf4/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f407370696b6172642f6e6f64652d7761736d3f636f6c6f723d303037656336267374796c653d666c61742d737175617265) ](https://www.npmjs.com/package/@spikard/node-wasm) [ ![Ruby](https://camo.githubusercontent.com/d6f8aef360d906e0656f92c32108665390009b87f5273751179f48a2825a1c70/68747470733a2f2f696d672e736869656c64732e696f2f67656d2f762f7370696b6172643f636f6c6f723d303037656336267374796c653d666c61742d737175617265) ](https://rubygems.org/gems/spikard) [ ![PHP](https://camo.githubusercontent.com/6f0e25d5ed5c0276de0e16265a03f58dc985013d07312405d24f6a934b2ddd22/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676f6c647a696865722f7370696b6172643f636f6c6f723d303037656336267374796c653d666c61742d737175617265) ](https://packagist.org/packages/goldziher/spikard) [ ![Elixir](https://camo.githubusercontent.com/212a977931ec030b1f677819c8910a8b4b56e33a9677110b33ab950485f42d15/68747470733a2f2f696d672e736869656c64732e696f2f686578706d2f762f7370696b6172643f636f6c6f723d303037656336267374796c653d666c61742d737175617265) ](https://hex.pm/packages/spikard) [ ![Java](https://camo.githubusercontent.com/0a192ccc161e27ecb9a65952291efa35453350735cca63e60fd581b82b1eef2b/68747470733a2f2f696d672e736869656c64732e696f2f6d6176656e2d63656e7472616c2f762f6465762e7370696b6172642f7370696b6172643f636f6c6f723d303037656336267374796c653d666c61742d737175617265) ](https://central.sonatype.com/artifact/dev.spikard/spikard) [ ![Go](https://camo.githubusercontent.com/f7abb606d3749eb4ba979830563ff1920945d3fe18bcdf9e0b454434908b284b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f476f6c647a696865722f7370696b6172643f6c6162656c3d476f26636f6c6f723d303037656336267374796c653d666c61742d737175617265) ](https://github.com/Goldziher/spikard/releases) [ ![C#](https://camo.githubusercontent.com/830539199a78a144c9e6aa2e8d48d22a00f83325a055c0129178a2aee24bd178/68747470733a2f2f696d672e736869656c64732e696f2f6e756765742f762f5370696b6172643f636f6c6f723d303037656336267374796c653d666c61742d737175617265) ](https://www.nuget.org/packages/Spikard/) [ ![Kotlin](https://camo.githubusercontent.com/2e800c2f0ebf0915e7b8436105941d642981f1cfadd4b03dcdf21033f99b85b1/68747470733a2f2f696d672e736869656c64732e696f2f6d6176656e2d63656e7472616c2f762f6465762e7370696b6172642f7370696b6172643f6c6162656c3d4b6f746c696e26636f6c6f723d303037656336267374796c653d666c61742d737175617265) ](https://central.sonatype.com/artifact/dev.spikard/spikard) [ ![Dart](https://camo.githubusercontent.com/e065658c99ef961506dc3a6eba267f4caf91f824974fbe6541bada4c99c0b0e6/68747470733a2f2f696d672e736869656c64732e696f2f7075622f762f7370696b6172643f636f6c6f723d303037656336267374796c653d666c61742d737175617265) ](https://pub.dev/packages/spikard) [ ![Swift](https://camo.githubusercontent.com/7b3e4cbbafa70f62f0ce7c00948cfe496fd2778536252c8519c87d341d67c6cb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53776966742d5370696b6172642d3030376563363f7374796c653d666c61742d737175617265) ](https://github.com/Goldziher/spikard/tree/main/packages/swift) [ ![Zig](https://camo.githubusercontent.com/08f83c011cff1099ad1864167d591bc93860f274fdf0aae9f6e7e33f03c66660/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5a69672d7370696b6172642d3030376563363f7374796c653d666c61742d737175617265) ](https://github.com/Goldziher/spikard/tree/main/packages/zig) [ ![C FFI](https://camo.githubusercontent.com/e01cec795fd551b6ba91f36d530428ec7a6f1dd3c7d436c8658f6754024e288e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f432532304646492d3030376563363f7374796c653d666c61742d737175617265) ](https://github.com/Goldziher/spikard/tree/main/crates/spikard-ffi) [ ![Homebrew](https://camo.githubusercontent.com/311b29826b5a8b4c444ee63e209b7ff0d9acc085cb2881b57418763f1b63a56d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f486f6d65627265772d3030376563363f7374796c653d666c61742d737175617265266c6f676f3d686f6d6562726577266c6f676f436f6c6f723d7768697465) ](https://github.com/Goldziher/homebrew-tap) [ ![License](https://camo.githubusercontent.com/de5edd8650a88e293b50ba4c177aa9c4136d3850619bff0dd3f4f4bcec0c983c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d3030376563363f7374796c653d666c61742d737175617265) ](https://github.com/Goldziher/spikard/blob/main/LICENSE)

[Install](#installation) · [Why spikard](#why-spikard) · [Quick example](#quick-example) · [Docs](https://github.com/Goldziher/spikard)

---

Why spikard
-----------

[](#why-spikard)

CapabilityDetails**Type-safe across bindings**HTTP routing with path, query, body, and header validation. Errors convert losslessly between languages.**Polyglot bindings**Python, TypeScript/Node, Ruby, PHP, Elixir, Go, Java, C#, Kotlin, Dart, Swift, Zig, WASM, Rust, and C FFI.**Schema codegen**Parse OpenAPI 3.0, AsyncAPI 3.0, GraphQL SDL, and JSON-RPC 2.0 specs. Generate handlers and validators per binding.**SQL to HTTP codegen**Annotate SQL queries with `@http GET /path`, `@http_auth bearer:jwt`, and emit route metadata and OpenAPI specs.**Tower middleware**Compression, rate limiting, timeouts, request IDs, JWT/API-key auth, and static file serving.**Lifecycle hooks**`onRequest`, `preValidation`, `preHandler`, `onResponse`, and `onError`.**WebSocket &amp; SSE**Bidirectional streams and server-sent events.**Fixture-driven testing**Shared JSON fixtures drive tests across language bindings for behavioral consistency.**CLI &amp; MCP server**Initialize projects, generate code, validate schemas, and integrate with MCP-compatible tools.Installation
------------

[](#installation)

Each binding ships through its native package manager.

TargetPackageInstallRust`spikard` on crates.io`cargo add spikard`Python`spikard` on PyPI`pip install spikard`Node.js`@spikard/node` on npm`npm install @spikard/node`WASM`@spikard/node-wasm` on npm`npm install @spikard/node-wasm`Ruby`spikard` on RubyGems`gem install spikard`PHP`goldziher/spikard` on Packagist`composer require goldziher/spikard`Elixir`spikard` on HexAdd `{:spikard, "~> 0.1"}` to `mix.exs`Go`github.com/Goldziher/spikard``go get github.com/Goldziher/spikard`Java`dev.spikard:spikard` on Maven CentralMaven/Gradle — see [Java README](packages/java)C#`Spikard` on NuGet`dotnet add package Spikard`Kotlin`dev.spikard:spikard` on Maven CentralMaven/Gradle — see [Kotlin README](packages/kotlin)Dart`spikard` on pub.dev`dart pub add spikard`Swift`Spikard` via SwiftPMAdd to `Package.swift`Zig`spikard` via `build.zig.zon`Add to build manifestC FFI`spikard-ffi` shared/static library[GitHub Releases](https://github.com/Goldziher/spikard/releases)Quick example
-------------

[](#quick-example)

### Python

[](#python)

```
from spikard import Spikard
from msgspec import Struct

class User(Struct):
    id: int
    name: str

app = Spikard()

@app.get("/users/{id:int}")
async def get_user(id: int) -> User:
    return User(id=id, name="Alice")

if __name__ == "__main__":
    app.run(port=8000)
```

### TypeScript

[](#typescript)

```
import { Spikard } from "@spikard/node";

const app = new Spikard();

app.get("/users/{id:int}", async (id: number) => {
  return { id, name: "Alice" };
});

app.run({ port: 8000 });
```

**More examples** (Ruby · PHP · Elixir · Go · Java · C# · Kotlin · Dart · Swift)See the [examples directory](https://github.com/Goldziher/spikard/tree/main/crates/spikard-http/examples) in the repository for working examples in every supported language.

Architecture
------------

[](#architecture)

All bindings call a shared Rust core through thin language-native layers:

**How bindings work**```
Language bindings (Python, Node, Ruby, Go, Java, C#...)
        |
        v
FFI / NAPI / PyO3 / Magnus / runtime bridge
        |
        v
crates/spikard-http      Router, middleware, auth
crates/spikard-core      HTTP types, validation, errors
crates/spikard-codegen   OpenAPI, GraphQL, AsyncAPI, JSON-RPC

```

Bindings are generated from the Rust API surface via [alef](https://github.com/xberg-io/alef). Binding code stays thin: type conversion, error conversion, and runtime integration. Business logic, validation, middleware, and codegen all live in Rust.

**Specification support**- **OpenAPI 3.0** — Route definitions to specs, parameter validators, Swagger/ReDoc UI
- **GraphQL** — SDL schema parsing, query execution, introspection, Handler trait integration
- **AsyncAPI 3.0** — Channel/operation extraction, message validators, WebSocket integration
- **OpenRPC** — JSON-RPC 2.0 method handlers, parameter validation, batch requests

**Middleware stack**Compression (gzip/brotli), rate limiting, timeouts, request IDs, authentication (JWT/API key), static files. Configured via ServerConfig structs. All middleware is implemented in Rust via tower-http.

Development
-----------

[](#development)

```
task setup     # Install dependencies
task build     # Build Rust core (debug)
task test      # Run Rust tests
task test:all  # Run all tests (Rust + bindings)
task e2e:all   # Generate + build + run e2e tests
task format    # Format all code
```

Run `task --list` for the full task catalog.

**Project status**- Rust core is stable and production-ready.
- Binding packages follow the Rust crate version.
- E2E coverage is fixture-driven and shared across supported language targets.
- See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on modifying generated bindings.

License
-------

[](#license)

MIT License — see [LICENSE](LICENSE) for details.

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance95

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

72

Last Release

14d ago

PHP version history (2 changes)0.2.0PHP ^8.2

v0.15.6-rc.1PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/30733348?v=4)[Na'aman Hirschfeld](/maintainers/Goldziher)[@Goldziher](https://github.com/Goldziher)

---

Top Contributors

[![Goldziher](https://avatars.githubusercontent.com/u/30733348?v=4)](https://github.com/Goldziher "Goldziher (2285 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (38 commits)")[![markkimsal](https://avatars.githubusercontent.com/u/54099?v=4)](https://github.com/markkimsal "markkimsal (1 commits)")

---

Tags

bundenoedgehttpnodephppythonrubyrusttypescriptwasmwebhttpframeworkwebrustpolyglot

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/goldziher-spikard/health.svg)

```
[![Health](https://phpackages.com/badges/goldziher-spikard/health.svg)](https://phpackages.com/packages/goldziher-spikard)
```

###  Alternatives

[hprose/hprose

It is a modern, lightweight, cross-language, cross-platform, object-oriented, high performance, remote dynamic communication middleware. It is not only easy to use, but powerful. You just need a little time to learn, then you can use it to easily construct cross language cross platform distributed application system.

2.0k221.3k37](/packages/hprose-hprose)[clue/framework-x

Framework X – the simple and fast micro framework for building reactive web applications that run anywhere.

942746.2k9](/packages/clue-framework-x)[hprose/hprose-swoole

Hprose asynchronous client &amp; standalone server based on swoole

17929.3k10](/packages/hprose-hprose-swoole)[silverstripe/behat-extension

SilverStripe framework extension for Behat

32585.8k5](/packages/silverstripe-behat-extension)[hprose/hprose-yii

Hprose Server for Yii 2

357.2k](/packages/hprose-hprose-yii)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
