{"id":13995350,"url":"https://github.com/mununki/rust_graphql_api_boilerplate","last_synced_at":"2025-10-27T17:30:32.684Z","repository":{"id":47216585,"uuid":"173050495","full_name":"mununki/rust_graphql_api_boilerplate","owner":"mununki","description":"A Boilerplate of GraphQL API built in Rust + Warp + Juniper + Diesel","archived":false,"fork":false,"pushed_at":"2023-08-09T13:07:07.000Z","size":33,"stargazers_count":95,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-30T08:34:43.381Z","etag":null,"topics":["boilerplate","diesel-rs","graphql","graphql-api","juniper","rust","warp"],"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/mununki.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,"dei":null}},"created_at":"2019-02-28T06:00:13.000Z","updated_at":"2024-07-19T23:48:25.000Z","dependencies_parsed_at":"2024-03-23T22:44:42.501Z","dependency_job_id":null,"html_url":"https://github.com/mununki/rust_graphql_api_boilerplate","commit_stats":null,"previous_names":["mattdamon108/rust_graphql_api_boilerplate"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mununki%2Frust_graphql_api_boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mununki%2Frust_graphql_api_boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mununki%2Frust_graphql_api_boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mununki%2Frust_graphql_api_boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mununki","download_url":"https://codeload.github.com/mununki/rust_graphql_api_boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238527240,"owners_count":19487183,"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":["boilerplate","diesel-rs","graphql","graphql-api","juniper","rust","warp"],"created_at":"2024-08-09T14:03:21.695Z","updated_at":"2025-10-27T17:30:32.342Z","avatar_url":"https://github.com/mununki.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Rust GraphQL API Boilerplate\n\nThis is a boilerplate built with Rust.\n\n## Features\n\n- DB migration with Diesel\n- Sign up\n- Sign in\n- Change password\n- Profile Update\n- JSON web token authentication\n\n## Stacks\n\n- Rust\n- [Warp](https://github.com/seanmonstar/warp) - Web server framework\n- [Juniper](https://github.com/graphql-rust/juniper) - GraphQL library\n- [Diesel](https://github.com/diesel-rs/diesel) - ORM\n- DB: Postgres\n- JSON Web Token : Authentication\n\n## Run\n\n### Without Docker\n\n```shell\n$ git clone https://github.com/mattdamon108/rust_graphql_api_boilerplate\n$ cd rust_graphql_api_boilerplate\n$ echo DATABASE_URL=postgres://username:password@localhost/rust_boilerplate \u003e .env\n$ diesel setup\n$ diesel migration run\n$ cargo run\n```\n\n### Build with Docker\n\n```shell\n$ docker build -t rust_gql .\n$ docker run --rm -d -p 3030:3030 --name running_rust_gql rust_gql\n```\n\n\u003e Change the listening port from `127.0.0.1` to `0.0.0.0` in `main.rs`. Because rust GraphQL API in docker container needs to listen to `0.0.0.0` instead of local interface in order for host to access to the API.\n\n\u003e GraphiQL : connect to 127.0.0.1:3030 with browser\n\n## Schema\n\n### Query\n\n```graphql\nquery {\n  getMyProfile {\n    ok\n    error\n    user {\n      id\n      email\n      first_name\n      last_name\n      bio\n      avatar\n    }\n  }\n}\n```\n\n\u003e Note: JSON web token is needed to be sent as `authorization` in header.\n\n### Mutation\n\n\u003e Sign Up\n\n```graphql\nmutation {\n  signUp(\n    email: \"test@test.com\"\n    password: \"12345678\"\n    firstName: \"graphql\"\n    lastName: \"rust\"\n  ) {\n    ok\n    error\n    user {\n      id\n      email\n      first_name\n      last_name\n      bio\n      avatar\n    }\n  }\n}\n```\n\n\u003e Sign In\n\n```graphql\nmutation {\n  signIn(email: \"test@test.com\", password: \"12345678\") {\n    token\n  }\n}\n```\n\n\u003e Change Password\n\nNote: JSON web token is needed to be sent as `authorization` in header.\n\n```graphql\nmutation {\n  changePassword(password: \"87654321\") {\n    ok\n    error\n    user {\n      id\n      email\n      first_name\n      last_name\n      bio\n      avatar\n    }\n  }\n}\n```\n\n\u003e Change Profile\n\nNote: JSON web token is needed to be sent as `authorization` in header.\n\n```graphql\nmutation {\n  changeProfile(bio: \"Rust fan\") {\n    ok\n    error\n    user {\n      id\n      email\n      first_name\n      last_name\n      bio\n      avatar\n    }\n  }\n}\n```\n\n## Next to do\n\n- [x] User Sign up\n- [x] Hash User Password - with [bcrypt](https://github.com/Keats/rust-bcrypt) crate\n- [x] User Sign in based on Token authentication\n- [x] User profile Update\n- [x] ERROR HANDLING (important!)\n- [x] Deploy using Docker after compile\n- [ ] Optimizing the multithread\n\n## References\n\n- http://alex.amiran.it/post/2018-08-16-rust-graphql-webserver-with-warp-juniper-and-mongodb.html\n- https://github.com/graphql-rust/juniper/tree/master/juniper_warp\n- https://blog.jawg.io/docker-multi-stage-build/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmununki%2Frust_graphql_api_boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmununki%2Frust_graphql_api_boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmununki%2Frust_graphql_api_boilerplate/lists"}