{"id":18275168,"url":"https://github.com/modiimedia/arri","last_synced_at":"2025-05-12T16:10:10.683Z","repository":{"id":180043611,"uuid":"659060025","full_name":"modiimedia/arri","owner":"modiimedia","description":"Arri RPC is a code-first RPC framework for end-to-end type safety in any language","archived":false,"fork":false,"pushed_at":"2025-05-05T05:46:23.000Z","size":5494,"stargazers_count":483,"open_issues_count":15,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-05T06:34:13.207Z","etag":null,"topics":["codegen","codegenerator","http","http-server","rpc","rpc-client","rpc-framework","rpc-server","server-sent-events"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/modiimedia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"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}},"created_at":"2023-06-27T04:11:51.000Z","updated_at":"2025-04-30T12:58:48.000Z","dependencies_parsed_at":"2024-04-02T18:29:48.520Z","dependency_job_id":"6a2cb604-4faf-433e-9672-dcaa12a1bea9","html_url":"https://github.com/modiimedia/arri","commit_stats":null,"previous_names":["modiimedia/autoroutes","modiimedia/arri"],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modiimedia%2Farri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modiimedia%2Farri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modiimedia%2Farri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modiimedia%2Farri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/modiimedia","download_url":"https://codeload.github.com/modiimedia/arri/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253773923,"owners_count":21962195,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["codegen","codegenerator","http","http-server","rpc","rpc-client","rpc-framework","rpc-server","server-sent-events"],"created_at":"2024-11-05T12:12:03.370Z","updated_at":"2025-05-12T16:10:10.677Z","avatar_url":"https://github.com/modiimedia.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"_**WARNING: Breaking changes are likely to happen until v1.0 is released**_\n\n# Arri RPC\n\n[![Discord](https://img.shields.io/discord/1272569268869005322?logo=discord\u0026logoColor=white\u0026logoSize=)](https://discord.gg/5m23HEQss7)\n\nArri RPC is a code-first RPC framework. Type-safe clients get generated directly from your server code meaning you never need to manually write another client again.\n\nClick [here](#server-implementations) to get started with your backend language of choice.\n\nhttps://github.com/user-attachments/assets/15cf68a4-871e-4e7d-b5fc-25dcd1760fc1\n\n## Table of Contents\n\n- [Server Implementations](#server-implementations)\n    - [Typescript](#typescript)\n    - [Go](#go)\n    - [Server Language Roadmap](#server-language-roadmap)\n- [Client Generators](#client-generators)\n- [Other Tooling](#other-tooling)\n- [How Arri RPC Works](#how-arri-rpc-works)\n- [Manually Creating An App Definition](#manually-creating-an-app-definition)\n- [How To Contribute](#how-to-contribute)\n\n## Server Implementations\n\n### Typescript\n\nClick [here](/languages/ts/ts-server/README.md) to get started with a Typescript server.\n\n#### Relevant Libraries\n\n| Name                                                            | Description                                                                                                                                                                    |\n| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| [@arrirpc/server](/languages/ts/ts-server/README.md)            | TS Server framework for Arri RPC                                                                                                                                               |\n| [@arrirpc/schema](/languages/ts/ts-schema/README.md)            | High performance schema builder for validating procedure inputs and outputs. Can also be used as a standalone TS validation library or to generated types for other languages. |\n| [@arrirpc/eslint-plugin](/languages/ts/eslint-plugin/README.md) | Lint rules for building Arri RPC schemas                                                                                                                                       |\n\n### Go\n\nClick [here](/languages/go/go-server/README.md) to get started with Go. Be aware that Go support is still in early stages.\n\n### Server Language Roadmap\n\nI'm currently finishing up the Go server implementation. After that is stable I have the following languages on my shortlist for the next potential server implementation:\n\n- rust\n- dart\n- zig\n\nSee this [guide](/docs/implementing-an-arri-server.md) for information on how to implement your own Arri server\n\n## Client Generators\n\nGenerators get run by the [Arri CLI](/tooling/cli/README.md) during `arri build`, `arri dev`, and `arri codegen`. You can register which generators you want to run in your Arri config (`arri.config.ts` by default)\n\nBelow are the language client generators that are planned to have first party support. This chart tracks the current progress on implementations for these clients. For those interested in creating their own generators, see [this guide](/docs/creating-a-custom-generator.md).\n\n| Language                                            | HTTP | SSE    |\n| --------------------------------------------------- | ---- | ------ |\n| [Typescript](languages/ts/ts-codegen/README.md)     | ✅   | ✅     |\n| [Dart](languages/dart/dart-codegen/README.md)       | ✅   | ✅     |\n| [Rust](languages/rust/rust-codegen/README.md)       | ✅   | ✅     |\n| [Kotlin](languages/kotlin/kotlin-codegen/README.md) | ✅   | ✅     |\n| [Swift](languages/swift/swift-codegen/README.md)    | ✅   | ✅\\*\\* |\n| Go                                                  |      |        |\n| Python                                              |      |        |\n\n✅ completed\n\n🚧 in progress\n\n\\*\\* SSE for Swift is working but it still has some rough edges\n\n## Other Tooling\n\n- [Arri CLI](/tooling/cli/README.md) - CLI tool for run code generators and managing dependencies\n\n## How Arri RPC Works\n\nArri RPC requires two things:\n\n- The [Arri CLI](/tooling/cli/README.md)\n- A valid Arri RPC [server implementation](/docs/implementing-an-arri-server.md)\n\nAll official server implementations are able to create an [Arri App Definition](/specifications/arri_app_definition.md) based on the server defined types and procedures. It also is able to communicate with the Arri CLI via a server plugin (to be documented). Server plugins tell the CLI important information such as: \"How to build the server\", \"How to start the server\" and \"How to get the server's app definition\".\n\nOnce these things are in place the Arri CLI has everything it needs to grab up-to-date type information and pass it to the [client generators](#client-generators)\n\n### What Happens When We Run `arri build`?\n\nThe Arri CLI will do the following:\n\n- Build the server\n- Have the compiled output generate an app definition\n- Take the app definition and pass to the client generators defined in the `arri.config.ts`\n\n### What Happens When We Run `arri dev`\n\nThe Arri CLI will do the following:\n\n- Build the server and start it\n- Request the server's app definition and pass it to the client generators\n- Start a file watcher to watch for file changes\n- When a file is changed:\n    - Do whatever logic is necessary to reload the server (hot-reload for Javascript and kill + restart for Go lang)\n    - Request the server's app definition\n    - If the app definition has changed then pass it to the client generators\n\n## Manually Creating an App Definition\n\nEven though Arri focuses primarily on a code-first approach it allow you to manually create app definitions in the event that you have a server implementation that isn't supported. Once your app definition is created you simply need to point the CLI to the app definition file. This file can be can be a typescript file, JSON file, or a JSON http endpoint.\n\n```bash\narri codegen ./AppDefinition.ts\n\narri codegen ./AppDefinition.json\n\narri codegen https://myapi.com/rpcs/__definition # must accept a GET request\n```\n\nBefore running this command. Make sure you have an arri config created already.\n\n**Example Config:**\n\n```ts\n// arri.config.ts\nimport { defineConfig, generators } from 'arri';\n\nexport default defineConfig({\n    generators: [\n        generators.dartClient({\n            // options\n        }),\n        generators.kotlinClient({\n            // options\n        }),\n        generators.typescriptClient({\n            // options\n        }),\n    ],\n});\n```\n\n### Typescript App Definition (Recommended)\n\nArri comes with some useful helpers that reduces the boilerplate of manually creating a JSON definition file. Additionally the validators created with Arri Schema can be used throughout your app.\n\n```ts\n// AppDefinition.ts\nimport { createAppDefinition } from 'arri';\nimport { a } from '@arrirpc/schema';\n\nconst HelloParams = a.object('HelloParams', {\n    message: a.string(),\n});\n\nconst HelloResponse = a.object('HelloResponse', {\n    message: a.string(),\n});\n\nexport default createAppDefinition({\n    procedures: {\n        sayHello: {\n            transport: 'http',\n            method: 'post',\n            path: '/say-hello',\n            params: HelloParams,\n            response: HelloResponse,\n        },\n    },\n});\n```\n\nAdditionally if you only need cross language types, you can skip defining procedures all together and just pass in models to the helper.\n\n```ts\n// AppDefinition.ts\nimport { createAppDefinition } from 'arri';\nimport { a } from '@arrirpc/schema';\n\nconst HelloParams = a.object('HelloParams', {\n    message: a.string(),\n});\n\nconst HelloResponse = a.object('HelloResponse', {\n    message: a.string(),\n});\n\nexport default createAppDefinition({\n    definitions: {\n        HelloParams,\n        HelloResponse,\n    },\n});\n```\n\nNow `arri codegen ./AppDefinition.ts` will only generate types for each client defined in the arri config.\n\n### JSON App Definition\n\nJSON app definitions are something that would normally be automatically generated by an implementation of ARRI-RPC. Manually creating a JSON app definition is more terse and more subject to human error than the typescript alternative.\n\n```json\n{\n    \"schemaVersion\": \"\u003ccurrent-schema-version\u003e\",\n    \"procedures\": {\n        \"sayHello\": {\n            \"transport\": \"http\",\n            \"method\": \"get\",\n            \"path\": \"/say-hello\",\n            \"params\": \"HelloParams\",\n            \"response\": \"HelloResponse\"\n        }\n    },\n    \"definitions\": {\n        \"HelloParams\": {\n            \"properties\": {\n                \"message\": {\n                    \"type\": \"string\",\n                    \"metadata\": {}\n                }\n            },\n            \"metadata\": {\n                \"id\": \"HelloParams\",\n                \"metadata\": {}\n            }\n        },\n        \"HelloResponse\": {\n            \"properties\": {\n                \"message\": {\n                    \"type\": \"string\",\n                    \"metadata\": {}\n                }\n            },\n            \"metadata\": {\n                \"id\": \"HelloResponse\"\n            }\n        }\n    }\n}\n```\n\n## How To Contribute\n\nContributions are welcome!\n\nPlease read the [contribution guide](/CONTRIBUTING.md) which will guide you through the entire workflow of how to build the source code, how to run the tests, and how to contribute changes to the Arri RPC codebase. Also feel free to reach out on [discord](https://discord.gg/5m23HEQss7) if you have any other additional questions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodiimedia%2Farri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodiimedia%2Farri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodiimedia%2Farri/lists"}