{"id":16355364,"url":"https://github.com/emanguy/rust-rest","last_synced_at":"2026-02-20T22:39:54.768Z","repository":{"id":38021319,"uuid":"454772565","full_name":"emanguy/rust-rest","owner":"emanguy","description":"A full template for a REST API written in Rust, engineered for maximum testability.","archived":false,"fork":false,"pushed_at":"2026-01-26T20:00:20.000Z","size":613,"stargazers_count":46,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-27T06:36:53.288Z","etag":null,"topics":["restful-api","rust-lang","web"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emanguy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-02-02T12:49:50.000Z","updated_at":"2026-01-26T20:00:24.000Z","dependencies_parsed_at":"2024-03-08T22:23:47.537Z","dependency_job_id":"3f9843c2-389b-4efd-9570-13eb32d3f094","html_url":"https://github.com/emanguy/rust-rest","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/emanguy/rust-rest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emanguy%2Frust-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emanguy%2Frust-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emanguy%2Frust-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emanguy%2Frust-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emanguy","download_url":"https://codeload.github.com/emanguy/rust-rest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emanguy%2Frust-rest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29667093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T19:49:36.704Z","status":"ssl_error","status_checked_at":"2026-02-20T19:44:05.372Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["restful-api","rust-lang","web"],"created_at":"2024-10-11T01:40:41.033Z","updated_at":"2026-02-20T22:39:54.749Z","avatar_url":"https://github.com/emanguy.png","language":"Rust","readme":"# Rust REST Server Template\n\nThis repository contains a starting point for a testable Rust microservice using Hexagonal Architecture. Here's how to get started:\n\n1. Run `docker compose up` to start the PostgeSQL server that the microservice depends on.\n2. Run `cargo run` to start the microservice.\n\nAdditional documentation and \"getting started\" material can be found in the [template documentation](./doc/README.md).\n\nThis template includes:\n* Unit testing for both HTTP routers and business logic\n* Integration tests against a real Postgres database\n* CI via CircleCI which runs unit and integration tests, lints the code, and verifies formatting\n* OpenAPI documentation via Swagger UI\n* A configurable logger\n* Validation for incoming HTTP request DTOs\n* Tons of documentation on the coding patterns used in the template\n\nTry it out for yourself, contributions are welcome!\n\n## Benchmark\n\nDid a quick load test on the server using `oha` running for 5 minutes:\n\n```\n❯ oha -z 5m http://localhost:8080/users/1/tasks\nSummary:\n  Success rate:\t1.0000\n  Total:\t300.0010 secs\n  Slowest:\t0.6709 secs\n  Fastest:\t0.0054 secs\n  Average:\t0.0324 secs\n  Requests/sec:\t1543.8113\n\n  Total data:\t63.60 MiB\n  Size/request:\t144 B\n  Size/sec:\t217.10 KiB\n\nResponse time histogram:\n  0.014 [1972]   |\n  0.022 [16050]  |■■\n  0.030 [169591] |■■■■■■■■■■■■■■■■■■■■■■■■■\n  0.039 [212188] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■\n  0.047 [46930]  |■■■■■■■\n  0.055 [11667]  |■\n  0.064 [3211]   |\n  0.072 [952]    |\n  0.080 [289]    |\n  0.089 [49]     |\n  0.097 [246]    |\n\nLatency distribution:\n  10% in 0.0245 secs\n  25% in 0.0279 secs\n  50% in 0.0317 secs\n  75% in 0.0353 secs\n  90% in 0.0409 secs\n  95% in 0.0451 secs\n  99% in 0.0556 secs\n\nDetails (average, fastest, slowest):\n  DNS+dialup:\t0.0012 secs, 0.0007 secs, 0.0014 secs\n  DNS-lookup:\t0.0000 secs, 0.0000 secs, 0.0001 secs\n\nStatus code distribution:\n  [200] 463145 responses\n```\n\nMost frequently, the server responds in about 39ms and it was able to process 463k requests in 5 minutes. Needless to say Rust web servers are FAST.\n\n## Swagger Docs\n\nThe Swagger UI (provided by the [utoipa](https://github.com/juhaku/utoipa) crate) can be accessed at http://localhost:8080/swagger-ui when starting the application.\n\n## Tests\n\nUnit tests for both API routers and business logic can be run via `cargo test`.\n\n## Integration tests\n\nProvided on this repo is a framework for integration testing. By default, the integration tests are skipped via the `#[cfg_attr()]` declaration which requires the `integration_test` feature to be enabled.\n\nTo run the tests with the integration tests, run the following:\n\n```bash\n# Create a postgres database to test against\ndocker-compose up -d\n# Run all tests, including integration tests\ncargo test --features integration_test\n```\n\nMore information on integration testing can be found in the [testing documentation](./doc/testing.md#writing-integration-tests).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femanguy%2Frust-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femanguy%2Frust-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femanguy%2Frust-rest/lists"}