{"id":27648148,"url":"https://github.com/goldziher/spikard","last_synced_at":"2026-02-16T13:18:45.852Z","repository":{"id":285369889,"uuid":"957640843","full_name":"Goldziher/spikard","owner":"Goldziher","description":"Rust-powered, multi-language web toolkit with bindings for Python, Typescript, Ruby and PHP.","archived":false,"fork":false,"pushed_at":"2026-01-25T19:58:55.000Z","size":320967,"stargazers_count":95,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-26T04:17:34.488Z","etag":null,"topics":["bun","deno","edge","http","node","php","python","ruby","rust","typescript","wasm","web"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Goldziher.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-30T21:03:45.000Z","updated_at":"2026-01-25T19:58:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"06c6b8f7-cb04-4945-a94b-fa9cf3c00df8","html_url":"https://github.com/Goldziher/spikard","commit_stats":null,"previous_names":["goldziher/spikard"],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/Goldziher/spikard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Goldziher%2Fspikard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Goldziher%2Fspikard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Goldziher%2Fspikard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Goldziher%2Fspikard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Goldziher","download_url":"https://codeload.github.com/Goldziher/spikard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Goldziher%2Fspikard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28917601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T19:10:10.838Z","status":"ssl_error","status_checked_at":"2026-01-30T19:06:40.573Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bun","deno","edge","http","node","php","python","ruby","rust","typescript","wasm","web"],"created_at":"2025-04-24T02:33:08.676Z","updated_at":"2026-02-16T13:18:45.826Z","avatar_url":"https://github.com/Goldziher.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spikard\n\nA Rust-centric multi-language toolkit for building and validating typed web services. Generate type-safe API handlers from OpenAPI, GraphQL, gRPC/Protobuf, AsyncAPI, or JSON-RPC specifications and deploy to Python, TypeScript, Ruby, PHP, or Elixir.\n\n[![Documentation](https://img.shields.io/badge/docs-spikard.dev-blue)](https://spikard.dev)\n[![Crates.io](https://img.shields.io/crates/v/spikard.svg?color=blue)](https://crates.io/crates/spikard)\n[![PyPI](https://img.shields.io/pypi/v/spikard.svg?color=blue)](https://pypi.org/project/spikard/)\n[![npm](https://img.shields.io/npm/v/@spikard/node.svg?color=blue)](https://www.npmjs.com/package/@spikard/node)\n[![Gem](https://img.shields.io/gem/v/spikard.svg?color=blue)](https://rubygems.org/gems/spikard)\n[![Packagist](https://img.shields.io/packagist/v/spikard/spikard.svg?color=blue)](https://packagist.org/packages/spikard/spikard)\n[![Hex.pm](https://img.shields.io/hexpm/v/spikard.svg?color=blue)](https://hex.pm/packages/spikard)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n## Features\n\n- **Multi-Language Code Generation**: Generate type-safe handlers from OpenAPI 3.0.x, GraphQL SDL, gRPC/Protobuf, AsyncAPI 2.x, or OpenRPC 1.x specifications\n- **Project Scaffolding**: `spikard init` bootstraps starter projects with language-specific tooling\n- **Automatic Quality Validation**: Syntax, type checking, and linting automatically applied to generated code\n- **Zero-Copy Bindings**: Performance-optimized FFI layers (PyO3, napi-rs, magnus, ext-php-rs, Rustler)\n- **Tower-HTTP Runtime**: Complete HTTP/gRPC server with compression, rate limiting, authentication, and CORS\n- **Fixture-Driven Testing**: Comprehensive test coverage with JSON-based fixtures\n\n## Supported Languages\n\n| Language | Version | Package Manager |\n|----------|---------|-----------------|\n| Python | 3.10+ | pip / uv |\n| TypeScript | 5.x | npm / pnpm / yarn |\n| Ruby | 3.2+ | bundler |\n| PHP | 8.2+ | Composer |\n| Elixir | 1.18+ | mix / hex |\n| Rust | 2024 | cargo |\n\n## Quick Start\n\n### Installation\n\n```bash\ncargo install spikard-cli\n```\n\n### Create a New Project\n\n```bash\nspikard init --name my_api --language python\ncd my_api\nuv sync\npython -m my_api.app\n```\n\n### Generate Handlers from Specification\n\n```bash\n# From OpenAPI\nspikard codegen --spec openapi.json --language python --output ./generated\n\n# From GraphQL schema\nspikard codegen --spec schema.graphql --language typescript --output ./src/generated\n\n# From Protobuf schema\nspikard codegen --spec user_service.proto --language python --output ./generated\n```\n\nSee [Init Command Guide](docs/getting-started/init-command.md) for detailed options.\n\n## Code Examples\n\nGenerated handler patterns vary by language. See [examples/](examples/) for complete runnable projects.\n\n**Python:**\n```python\nfrom spikard import Spikard\n\napp = Spikard()\n\n@app.get(\"/users/{user_id}\")\nasync def get_user(user_id: int) -\u003e dict:\n    return {\"id\": user_id, \"name\": \"Alice\"}\n\nif __name__ == \"__main__\":\n    app.run(port=8000)\n```\n\n**TypeScript:**\n```typescript\nimport { Spikard, type Request } from \"@spikard/node\";\n\nconst app = new Spikard();\n\nconst getUser = async (req: Request) =\u003e {\n    return { id: req.params[\"userId\"], name: \"Alice\" };\n};\n\napp.addRoute(\n    { method: \"GET\", path: \"/users/:userId\", handler_name: \"getUser\", is_async: true },\n    getUser\n);\n\napp.run({ port: 8000 });\n```\n\n**Ruby:**\n```ruby\nrequire \"spikard\"\n\napp = Spikard::App.new\n\napp.get \"/users/:user_id\" do |user_id:|\n  { id: user_id, name: \"Alice\" }\nend\n\napp.run(port: 8000)\n```\n\n**PHP:**\n```php\nuse Spikard\\App;\nuse Spikard\\Attributes\\Get;\n\nclass UserController {\n    #[Get('/users/{userId}')]\n    public function getUser(int $userId): array {\n        return ['id' =\u003e $userId, 'name' =\u003e 'Alice'];\n    }\n}\n\n$app = new App();\n$app-\u003eregisterController(new UserController());\n$app-\u003erun();\n```\n\n**Elixir:**\n```elixir\ndefmodule MyApp.Router do\n  use Spikard.Router\n\n  get \"/users/:user_id\", \u0026get_user/1\n\n  defp get_user(request) do\n    user_id = Spikard.Request.get_path_param(request, \"user_id\")\n    Spikard.Response.json(%{id: user_id, name: \"Alice\"})\n  end\nend\n\n{:ok, _server} = Spikard.start(MyApp.Router, port: 8000)\n```\n\n## Benchmarks\n\nAverage throughput across 34 workloads (JSON bodies, path/query params, multipart, urlencoded) at 100 concurrency. [Full results](docs/benchmarks/results.md) | [Methodology](docs/benchmarks/methodology.md)\n\n| Rank | Framework | Language | Avg RPS | P50 (ms) | P99 (ms) |\n|------|-----------|----------|--------:|----------:|----------:|\n| 1 | **spikard-rust** | Rust | 64,516 | 1.43 | 3.93 |\n| 2 | **spikard-bun** | Node | 49,460 | 2.18 | 4.21 |\n| 3 | **spikard-node** | Node | 46,160 | 2.18 | 3.35 |\n| 4 | trongate | PHP | 45,339 | 3.81 | 7.10 |\n| 5 | elysia | Node | 44,326 | 2.41 | 4.68 |\n| 6 | kito | Node | 36,958 | 4.94 | 12.86 |\n| 7 | fastify | Node | 19,167 | 6.74 | 14.76 |\n| 8 | **spikard-php** | PHP | 16,942 | 5.82 | 9.10 |\n| 9 | morojs | Node | 14,196 | 6.44 | 12.61 |\n| 10 | **spikard-python** | Python | 12,623 | 5.55 | 38.39 |\n| 11 | phalcon | PHP | 12,367 | 10.17 | 17.20 |\n| 12 | hono | Node | 10,928 | 10.91 | 18.62 |\n| 13 | litestar | Python | 8,032 | 14.62 | 19.18 |\n| 14 | **spikard-ruby** | Ruby | 7,151 | 14.62 | 18.98 |\n| 15 | fastapi | Python | 6,418 | 16.43 | 21.72 |\n| 16 | robyn | Python | 6,012 | 16.85 | 24.18 |\n| 17 | roda | Ruby | 5,038 | 26.89 | 35.61 |\n| 18 | hanami-api | Ruby | 5,032 | 76.10 | 414.35 |\n\n\u003cdetails\u003e\n\u003csummary\u003eThroughput leaderboard chart\u003c/summary\u003e\n\n![Throughput Leaderboard](docs/assets/benchmarks/01-throughput-leaderboard.svg)\n\u003c/details\u003e\n\n## Code Generation Support\n\nSpikard generates type-safe handlers from multiple API specifications:\n\n| Format | Support | Languages |\n|--------|---------|-----------|\n| OpenAPI 3.0.x | ✅ | Python, TypeScript, Ruby, PHP |\n| GraphQL SDL | ✅ | Python, TypeScript, Ruby, PHP, Rust |\n| gRPC/Protobuf | ✅ | Python, TypeScript, Ruby, PHP, Rust |\n| AsyncAPI 2.x | ✅ | Python, TypeScript, Ruby, PHP |\n| OpenRPC 1.x | ✅ | Python, TypeScript, Ruby, PHP |\n\nAll generated code is automatically validated for syntax, types, and style before output.\n\n## Development\n\nInstall dependencies and build all language bindings:\n\n```bash\ntask setup      # Install all dependencies\ntask build      # Build all language bindings\ntask test       # Run all tests\ntask lint       # Check code quality\ntask format     # Apply formatting\n```\n\nLanguage-specific commands:\n\n```bash\ntask build:python    # Build Python bindings\ntask build:node      # Build Node.js bindings\ntask build:ruby      # Build Ruby bindings\ntask build:php       # Build PHP bindings\ntask build:elixir    # Build Elixir bindings\ntask test:rust       # Run Rust tests\ntask test:python     # Run Python tests\ntask test:js         # Run TypeScript tests\n```\n\n## Documentation\n\nVisit [spikard.dev](https://spikard.dev) for full documentation, guides, and API reference.\n\n- See [examples/](examples/) for runnable sample projects in all languages\n\n## Architecture Highlights\n\n**Thin Binding Pattern:** All language bindings delegate heavy lifting to the Rust core. Bindings handle language-specific type conversions only; no business logic duplication ensures consistency across platforms.\n\n**Zero-Copy Serialization:** Direct PyO3 type construction eliminates JSON round-trips, providing 30-40% performance improvement in Python bindings.\n\n**Quality-First Generation:** Automatic syntax, type, and style validation applied to all generated code. 95%+ test coverage on core generators.\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for setup, development workflow, and code quality standards.\n\n## License\n\nLicensed under the MIT License. See [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoldziher%2Fspikard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoldziher%2Fspikard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoldziher%2Fspikard/lists"}