{"id":19357870,"url":"https://github.com/swiftsoftwaregroup/swift-api-rest-rs-warp","last_synced_at":"2026-02-25T07:08:14.804Z","repository":{"id":250972133,"uuid":"835966033","full_name":"swiftsoftwaregroup/swift-api-rest-rs-warp","owner":"swiftsoftwaregroup","description":"REST Web API using Rust and Warp","archived":false,"fork":false,"pushed_at":"2024-07-31T03:48:01.000Z","size":339,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T00:43:34.368Z","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}},"created_at":"2024-07-30T22:18:26.000Z","updated_at":"2024-07-31T03:48:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"9e1030a9-c4cc-4e7c-86bb-2c30160817e6","html_url":"https://github.com/swiftsoftwaregroup/swift-api-rest-rs-warp","commit_stats":null,"previous_names":["swiftsoftwaregroup/swift-api-rest-rs-warp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Fswift-api-rest-rs-warp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Fswift-api-rest-rs-warp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Fswift-api-rest-rs-warp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Fswift-api-rest-rs-warp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swiftsoftwaregroup","download_url":"https://codeload.github.com/swiftsoftwaregroup/swift-api-rest-rs-warp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243358212,"owners_count":20277991,"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":[],"created_at":"2024-11-10T07:09:29.964Z","updated_at":"2025-11-01T04:04:22.353Z","avatar_url":"https://github.com/swiftsoftwaregroup.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swift-api-rest-rs-warp\n\nThis project implements a simple API just to illustrate how one would go about implementing a REST API using [Warp](https://github.com/seanmonstar/warp) and [Rust](https://www.rust-lang.org/). This repository is largely a copy of [swift-api-rest-rs](https://github.com/swiftsoftwaregroup/swift-api-rest-rs) but using Warp instead of Actix Web. \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 --allow-dirty\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 dotenv\ncargo add warp \n\ncargo add serde --features derive\ncargo add serde_json\ncargo add chrono --features serde\n\ncargo add utoipa --features chrono\n\ncargo add diesel --features sqlite,r2d2\ncargo add diesel_migrations\n\n# dev packages\ncargo add tokio-test --dev\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftsoftwaregroup%2Fswift-api-rest-rs-warp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswiftsoftwaregroup%2Fswift-api-rest-rs-warp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftsoftwaregroup%2Fswift-api-rest-rs-warp/lists"}