{"id":19357871,"url":"https://github.com/swiftsoftwaregroup/swift-api-rest-rs","last_synced_at":"2026-02-08T08:33:24.213Z","repository":{"id":250386507,"uuid":"834271619","full_name":"swiftsoftwaregroup/swift-api-rest-rs","owner":"swiftsoftwaregroup","description":"REST Web API using Rust and Actix Web","archived":false,"fork":false,"pushed_at":"2025-02-13T16:39:05.000Z","size":520,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-19T03:35:56.984Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swiftsoftwaregroup.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-26T20:12:34.000Z","updated_at":"2025-02-13T16:39:09.000Z","dependencies_parsed_at":"2025-01-20T00:39:40.760Z","dependency_job_id":"8be4afde-a03c-4cbd-96e1-e237cca81896","html_url":"https://github.com/swiftsoftwaregroup/swift-api-rest-rs","commit_stats":null,"previous_names":["swiftsoftwaregroup/swift-api-rest-rs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/swiftsoftwaregroup/swift-api-rest-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Fswift-api-rest-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Fswift-api-rest-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Fswift-api-rest-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Fswift-api-rest-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swiftsoftwaregroup","download_url":"https://codeload.github.com/swiftsoftwaregroup/swift-api-rest-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Fswift-api-rest-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29225478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T06:05:31.539Z","status":"ssl_error","status_checked_at":"2026-02-08T05:58:33.853Z","response_time":57,"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":[],"created_at":"2024-11-10T07:09:30.306Z","updated_at":"2026-02-08T08:33:24.176Z","avatar_url":"https://github.com/swiftsoftwaregroup.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swift-api-rest-rs\nThis project implements a simple API just to illustrate how one would go about implementing a REST API using [Actix Web](https://actix.rs/) and [Rust](https://www.rust-lang.org/). \n\n## Setup\n\n* [Setup for macOS](./docs/setup-macos.md)\n\n## Run\n\n```bash\nsource configure.sh\n\ncargo run\n\n# or\ncargo watch -x check -x run\n\n# or\n./watch.sh\n```\n\nBrowse the docs and test the API via the Swagger UI:\n\n```bash\nopen http://localhost:8001/docs\n```\n\n![swagger-ui](./docs/swagger-ui.png)\n\nBrowse the docs using Redoc. This is an alternative to the Swagger UI:\n\n```bash\nopen http://localhost:8001/redoc\n```\n\n![redoc-ui](./docs/redoc-ui.png)\n\n## Updating the code\n\nConfigure project:\n\n```bash\nsource configure.sh\n```\n\nOpen the project in Visual Studio Code:\n\n```bash\ncode .\n```\n\n## Development\n\n### Code Formatting \u0026 Linting\n\nRun `rustfmt` formatter:\n\n```bash\n# check\ncargo fmt --all -- --check\n\n# fix\ncargo fmt --all\n```\n\nRun `clippy` linter:\n\n```bash\n# check\ncargo clippy -- --deny warnings\n\n# fix\ncargo clippy --fix\n```\n\n### Test\n\nRun tests:\n\n```bash\ncargo test\n```\n\nGenerate test coverage report:\n\n```bash\n./coverage.sh\n\n# or\ncargo tarpaulin --skip-clean --ignore-tests --out Html --output-dir coverage\n\n# open coverage report\nopen coverage/tarpaulin-report.html\n```\n\n### Build\n\n```bash\ncargo build\n```\n\n### Database Management\n\nSetup DB migrations:\n\n```bash\ndiesel setup\n```\n\nGenerate a new DB migration:\n\n```bash\ndiesel migration generate create_books\n```\n\nApply DB migrations:\n\n```bash\ndiesel migration run\n```\n\n## Run in Podman / Docker \n\n\u003e In order to do this you will need Podman. See [Setup Podman on macOS](./docs/setup-podman-macos.md) for details.\n\nRebuild container image and start container:\n\n```bash\n./scripts/podman.sh\n```\n\nDelete container and image:\n\n```bash\n./scripts/podman-delete.sh\n```\n\n## How to create a new project\n\n```bash\n# create new project\ncargo init\n\n# add packages\ncargo add actix-web dotenv\ncargo add diesel --features sqlite,r2d2\n\ncargo add serde --features derive\ncargo add serde_json\ncargo add chrono --features serde\n\ncargo add utoipa --features actix_extras\ncargo add utoipa-swagger-ui --features actix-web\n\ncargo add diesel_migrations\n```\n\nInstall tools :\n\n```bash\n# Diesel CLI\ncargo install diesel_cli --no-default-features --features sqlite\n# Watch\ncargo install cargo-watch\n# Test Coverage\ncargo install cargo-tarpaulin\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftsoftwaregroup%2Fswift-api-rest-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswiftsoftwaregroup%2Fswift-api-rest-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftsoftwaregroup%2Fswift-api-rest-rs/lists"}