Project

spikard

0.02
There's a lot of open issues
Rust-centric multi-language HTTP framework with polyglot bindings
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

 Project Readme

Spikard

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

Powered by Rust. Native performance for HTTP routing, validation, and middleware. Write once, bind everywhere.

Key Features

  • 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.
  • Fixture-driven testing - shared JSON fixtures drive tests across language bindings for behavioral consistency.
  • 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, OpenAPI 3.1 specs, and sidecars.
  • Tower middleware - compression, rate limiting, timeouts, request IDs, authentication, and static file serving.
  • Lifecycle hooks - onRequest, preValidation, preHandler, onResponse, and onError.
  • WebSocket, SSE, background tasks - bidirectional and server-sent streams plus fire-and-forget background jobs.
  • CLI and MCP server - initialize projects, generate code, validate schemas, and integrate with MCP-compatible tools.

Installation

Each binding ships through its native package manager. Use the package README for platform requirements and build details.

Target Package README
Rust spikard on crates.io crates/spikard
Python spikard on PyPI packages/python
Node.js @spikard/node on npm crates/spikard-node
WASM @spikard/node-wasm on npm crates/spikard-wasm
Ruby spikard on RubyGems packages/ruby
PHP goldziher/spikard on Packagist packages/php
Elixir spikard on Hex packages/elixir
Go github.com/Goldziher/spikard packages/go
Java dev.spikard:spikard on Maven Central packages/java
C# Spikard on NuGet packages/csharp
Kotlin dev.spikard:spikard on Maven Central packages/kotlin
Dart spikard on pub.dev packages/dart
Swift Spikard through SwiftPM packages/swift
Zig spikard through build.zig.zon packages/zig
C FFI spikard-ffi shared/static library crates/spikard-ffi

Quick Start

Python

from spikard import Spikard
from spikard.config import ServerConfig
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(config=ServerConfig(port=8000))

TypeScript

import { Spikard, ServerConfig } from "@spikard/node";

const app = new Spikard();

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

const config = new ServerConfig({ port: 8000 });
app.run(config);

Architecture

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

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. Binding code stays thin: type conversion, error conversion, and runtime integration.

Development

task setup
task build
task test
task test:e2e
task lint
task format

Run task --list for the full task catalog.

Project Status

  • Rust core is stable.
  • Binding packages follow the Rust crate version.
  • E2E coverage is fixture-driven and shared across supported language targets.

Contributing

See CONTRIBUTING.md. Generated binding and e2e files should be changed through Rust source, fixtures, templates, or alef.toml.

License

MIT License - see LICENSE for details.