{"id":39357220,"url":"https://github.com/codeitlikemiley/service_template","last_synced_at":"2026-01-18T02:38:47.723Z","repository":{"id":212555521,"uuid":"731696777","full_name":"codeitlikemiley/service_template","owner":"codeitlikemiley","description":"Create GRPC Services in secs","archived":false,"fork":false,"pushed_at":"2024-06-12T07:54:14.000Z","size":70,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-12T13:01:23.066Z","etag":null,"topics":["cargo-generate","grpc","hyper","proto","rpc","rust","rust-lang","template","tonic"],"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/codeitlikemiley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2023-12-14T16:58:06.000Z","updated_at":"2024-06-12T07:54:17.000Z","dependencies_parsed_at":"2023-12-24T00:15:44.158Z","dependency_job_id":"0db8e1a5-027d-4334-889b-5797910a1f65","html_url":"https://github.com/codeitlikemiley/service_template","commit_stats":null,"previous_names":["codeitlikemiley/service_template"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/codeitlikemiley/service_template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeitlikemiley%2Fservice_template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeitlikemiley%2Fservice_template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeitlikemiley%2Fservice_template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeitlikemiley%2Fservice_template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeitlikemiley","download_url":"https://codeload.github.com/codeitlikemiley/service_template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeitlikemiley%2Fservice_template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28526584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cargo-generate","grpc","hyper","proto","rpc","rust","rust-lang","template","tonic"],"created_at":"2026-01-18T02:38:46.830Z","updated_at":"2026-01-18T02:38:47.689Z","avatar_url":"https://github.com/codeitlikemiley.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GRPC Service Generator\n\n[![Build Service Template](https://github.com/codeitlikemiley/service_template/actions/workflows/build.yml/badge.svg)](https://github.com/codeitlikemiley/service_template/actions/workflows/build.yml)\n\n## Requirements\n\nNote: Install the following before you can use the template generator.\n\n- [rust, rustup, cargo](https://www.rust-lang.org/tools/install)\n- [cargo-generate](https://cargo-generate.github.io/cargo-generate/installation.html)\n- [protoc](https://grpc.io/docs/protoc-installation/)\n- [server_template](https://github.com/codeitlikemiley/server_template)\n- [workspacer](https://github.com/codeitlikemiley/workspacer) (optional cli tools to manage rust workspace)\n\n## GRPC Client\n\n- [grpcurl](https://github.com/fullstorydev/grpcurl)\n- [evans_cli](https://github.com/ktr0731/evans)\n- [Postman](https://www.postman.com/downloads/)\n\n\n## Workspace Setup\n\n\u003e Note: You can ignore this step if you already set it up\n\n- [ ] Set up Workspace\n```sh\nmkdir \u003cworkspace_root\u003e\ncd \u003cworkspace_root\u003e\n```\n\n- [ ] Update workspace `Cargo.toml` file content below.\n      \nNote: The workspacer command above would generate this Code on `Cargo.toml`\n\n```toml\n[workspace]\nresolver = \"2\"\nmembers = [\n    server,\n    # add here services here after you generated it\n    auth, # example service\n]\n```\n\nor you can download and install [workspacer cli](https://github.com/codeitlikemiley/workspacer) and use it to manage your workspace\n\n```sh\nmkdir \u003cworkspace_root\u003e\nworkspacer init\n# by default it has the server in the member\n# to add more services\nworspacer add services/auth\n# you can also remove service\nworkspacer rm service/auth\n# to view all current members of workspace\nworkspacer ls\n```\n\nExample Workspace Tree Structure\n```sh\nworkspace (root)\n├── Cargo.toml\n│\n├── backend (server_template)\n│\n├── frontend (dioxus_template)\n│\n└── services (service_template)\n    └── \u003cservice_name\u003e\n        ├── proto\n        │  └── \u003cservice_name\u003e.proto\n        ├── src\n        │    ├── \u003cservice_name.rs\u003e (generated with cargo build)\n        │    ├── \u003cservice_name_impl.rs\u003e\n        │    └── lib.rs\n        ├── cargo-generate.toml\n        └── Cargo.toml\n\n```\n\n- [ ] Create the Server\n\n```sh\ncd \u003cworkspace_root\u003e\ncargo generate --git codeitlikemiley/server_template --name server\n```\n\n## Favorite The template \n\n`~/.cargo/cargo-generate.toml` if this file dont exist please create it first `touch ~/.cargo/cargo-generate.toml`\n\n- [ ] Create Folder for Templates\n\n```sh\ncd ~/.cargo\nmkdir templates\ncd templates\ngit clone https://github.com/codeitlikemiley/services_template\ngit clone https://github.com/codeitlikemiley/server_template\n```\n\n- [ ] Add to favorites [services_template](https://github.com/codeitlikemiley/services_template) and [server_template](https://github.com/codeitlikemiley/server_template)\n\n```toml\n[values]\ngh_username = \"YOUR_USERNAME\"\nide = \"none|vscode\"\n\n[favorites.services]\npath = \"/Users/YOUR_USERNAME/.cargo/templates/services_template\"\n\n[favorites.server]\npath = \"/Users/YOUR_USERNAME/.cargo/templates/server_template/\"\n```\n\n- [ ]  Generate Server and Services template with short cut\n\n```sh\ncargo generate services --name auth\ncargo generate server --name server\n```\n\n\n## Usage: Generating a new GRPC Service from the template\n\n- [ ] Change directory to the services directory.\n\n```bash\ncd \u003cworkspace_root\u003e/services\n```\n\n- [ ] Generate a new GRPC Service.\n\n```sh\ncargo generate --git codeitlikemiley/services_template --name auth\n\n```\n\n### Test your Service with GRPC Client\n\n1. Run Server\n\n```sh\ncargo run -p server\n```\n\n2. Use `grpcurl` Client\n\nTo invoke the specific rpc method use the following command\n```sh\ngrpcurl -plaintext -import-path ./services/auth/proto -proto auth.proto -d '{\"name\": \"Tonic\"}' '[::1]:50051' auth.AuthService.Login\n```\n\nexample output:\n```json\n{\n  \"message\": \"Hello Uriah!\"\n}\n```\n\n\nNote: that the example `auth.AuthService.Login` is the `package_name.ServiceName.MethodName` from the `auth.proto` file\n\n`auth.proto`\n\n```protobuf\npackage auth;\n\nservice AuthService {\n  rpc Login (LoginRequest) returns (LoginResponse) {}\n}\n```\n\n## [License](LICENSE)\n\n## Pull Requests\n\nIf you need to make changes to the template, please submit a pull request.\n\n## Learning Resources\n\nFor more info how to use cargo-generate check this [link](https://cargo-generate.github.io/cargo-generate/usage.html)\n\nLearn about Liquid Templating [here](https://shopify.github.io/liquid/)\n\nTo learn more about Rust Tonic click this [link](https://github.com/hyperium/tonic/blob/master/examples/helloworld-tutorial.md)\n\nLearn more about Embedded Scripting for Rust [here](https://rhai.rs/book/about/index.html) , link for [LSP](https://github.com/rhaiscript/lsp) on vscode\n\nExample usage of Rhai Scripting on the template [here](https://cargo-generate.github.io/cargo-generate/templates/scripting.mini-example.html#Rhai-extensions)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeitlikemiley%2Fservice_template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeitlikemiley%2Fservice_template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeitlikemiley%2Fservice_template/lists"}