{"id":13620101,"url":"https://github.com/ronanyeah/rust-hasura","last_synced_at":"2025-05-07T09:34:37.072Z","repository":{"id":37359424,"uuid":"202069910","full_name":"ronanyeah/rust-hasura","owner":"ronanyeah","description":"Rust / Hasura / GraphQL","archived":false,"fork":false,"pushed_at":"2022-04-19T03:05:26.000Z","size":48,"stargazers_count":140,"open_issues_count":0,"forks_count":18,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-30T11:34:13.371Z","etag":null,"topics":["graphql","hasura","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ronanyeah.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}},"created_at":"2019-08-13T05:20:48.000Z","updated_at":"2024-11-05T00:14:24.000Z","dependencies_parsed_at":"2022-08-08T20:01:24.057Z","dependency_job_id":null,"html_url":"https://github.com/ronanyeah/rust-hasura","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronanyeah%2Frust-hasura","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronanyeah%2Frust-hasura/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronanyeah%2Frust-hasura/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronanyeah%2Frust-hasura/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ronanyeah","download_url":"https://codeload.github.com/ronanyeah/rust-hasura/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252851637,"owners_count":21814185,"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":["graphql","hasura","rust"],"created_at":"2024-08-01T21:00:52.222Z","updated_at":"2025-05-07T09:34:37.044Z","avatar_url":"https://github.com/ronanyeah.png","language":"Rust","funding_links":[],"categories":["Applications","应用程序 Applications","Rust","Templates and Examples"],"sub_categories":["Web Servers","Web服务器 Web Servers"],"readme":"## Rust + Hasura ![Rust](https://github.com/ronanyeah/rust-hasura/workflows/Rust/badge.svg)\n\nThis is an example of a [Rust](https://www.rust-lang.org) server that functions as a [remote schema](https://hasura.io/docs/1.0/graphql/manual/remote-schemas/index.html) for [Hasura](https://hasura.io).\n\nIt demonstrates:\n- user login + signup\n- [JWT authorization w/ refresh cookie](https://hasura.io/blog/best-practices-of-using-jwt-with-graphql/)\n- [typesafe GraphQL requests](https://docs.rs/graphql_client)\n- [uuid](https://docs.rs/uuid) package integration\n\nYou can learn more about this stack from [this talk](https://www.youtube.com/watch?v=ly05IV5isf4).\n\n\n## Package Manager\n\n[Cargo](https://doc.rust-lang.org/cargo/guide)\n\n\n## Setup\n\n-  Your Hasura schema must have a table `user`, with a `id` column of type `uuid`, and also a `username` column of type `text`.\n- Set an [`ADMIN_SECRET`](https://hasura.io/docs/1.0/graphql/manual/deployment/graphql-engine-flags/reference.html) and a [`JWT_SECRET`](https://hasura.io/docs/1.0/graphql/manual/auth/authentication/jwt.html) on the graphql engine, and share these with the Rust server as environment variables.\n- Use [graphqurl](https://www.npmjs.com/package/graphqurl) to generate `schema.json`\n- `gq $HASURA_ENDPOINT -H \"x-hasura-admin-secret: $ADMIN_SECRET\" --introspect --format json \u003e ./graphql/schema.json`\n\n## Start\n- `cargo run`\n\n\n## Environment Variables\n\nKey | Example\n--- | ---\n`PORT` | `8000`\n`HASURA_ENDPOINT` | `http://127.0.0.1:8080/v1/graphql`\n`ADMIN_SECRET` | `foo`\n`JWT_SECRET` | `{\"type\":\"HS256\",\"key\":\"3QQ6FD+o0+c7tzQQVfjpMkNDi2yARAAKzQQk8O2IKoxQQ4nF7EdAh8s3TwpHwrdQQ6R\"}`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronanyeah%2Frust-hasura","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fronanyeah%2Frust-hasura","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronanyeah%2Frust-hasura/lists"}