{"id":24905760,"url":"https://github.com/mloning/zero2prod-rs","last_synced_at":"2025-07-30T11:39:02.295Z","repository":{"id":275286410,"uuid":"925616821","full_name":"mloning/zero2prod-rs","owner":"mloning","description":"Code for Zero to Production in Rust","archived":false,"fork":false,"pushed_at":"2025-03-16T14:14:14.000Z","size":279,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-28T17:58:34.806Z","etag":null,"topics":["rust","zero2prod"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":false,"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/mloning.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}},"created_at":"2025-02-01T10:05:01.000Z","updated_at":"2025-03-16T14:14:17.000Z","dependencies_parsed_at":"2025-02-16T14:35:52.186Z","dependency_job_id":"0569eddf-4e38-4290-94fb-7fd221df4ebf","html_url":"https://github.com/mloning/zero2prod-rs","commit_stats":null,"previous_names":["mloning/zero2prod-rs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mloning/zero2prod-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mloning%2Fzero2prod-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mloning%2Fzero2prod-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mloning%2Fzero2prod-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mloning%2Fzero2prod-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mloning","download_url":"https://codeload.github.com/mloning/zero2prod-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mloning%2Fzero2prod-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267858877,"owners_count":24155981,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["rust","zero2prod"],"created_at":"2025-02-02T00:24:45.403Z","updated_at":"2025-07-30T11:39:02.274Z","avatar_url":"https://github.com/mloning.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Code for Zero to Production in Rust\n\nMy code from working through [Zero to Production in Rust].\n\n[Zero to Production in Rust]: https://www.zero2prod.com\n\n## Initial setup\n\n- Install Rust\n- Install Docker\n- `brew install libpq` to install `psql`\n- `cargo install sqlx-cli --no-default-features --features rustls,postgres`\n- `cargo install bunyan` for pretty printing logs\n\n## Development\n\n### Run app\n\n- `bash scripts/init_db.sh` to start database server in Docker container (detached) for testing\n- `SKIP_DOCKER=true bash scripts/init_db.sh` to apply migrations to database running in container\n- `psql -h localhost -p 5432 -U postgres` to connect to database server from command line\n- `cargo run | bunyan` to run app with pretty-printed logs\n- `cargo watch --exec 'run | bunyan' --ignore *.md` to run app on file changes\n\n### Run tests\n\n- `cargo watch --exec check --exec test --ignore *.md` to run tests on file changes\n- `TEST_LOG=true cargo test` to see logs from tests, or `TEST_LOG=true cargo test | bunyan` with pretty printing\n\nTo manually test API endpoints, use for example:\n\n- `curl -v http://127.0.0.1:8000/health_check`\n- `curl -v http://127.0.0.1:8000/subscriptions -H \"Content-Type: application/x-www-form-urlencoded\" -d \"email=test@test.com\u0026name=tester\"`\n\n#### Known issues\n\nIf you see the following error, you can increase the maximum number of open file handles:\n\n\u003e thread 'actix-server worker ...' panicked at ... called `Result::unwrap()` on an `Err` value: Os { code: 24, kind: Uncategorized, message: \"Too many open files\" }\n\n- `ulimit -Sn` to see the current soft limit\n- `ulimit -Sn \u003cvalue\u003e` to set a new limit for the current Shell session, e.g. `ulimit -Sn 1000`\n\n### Inspect database\n\n- `psql -h localhost -p 5432 -U postgres` to connect to the database server from command line\n\n### Build Docker image\n\n- `cargo sqlx prepare --workspace`, to work with sqlx offline, together with `SQLX_OFFLINE=true`\n- `docker build --tag zero2prod --file Dockerfile .`\n- `docker run -p 8000:8000 zero2prod`\n\n## Notes\n\n### Tools\n\n- `cargo clippy` for linting\n- `cargo tarpaulin --ignore-tests` for code coverage\n- `cargo watch` for triggering commands automatically on code changes\n- `cargo audit` to check for vulnerabilities\n- `cargo expand` to show result of macro expansions\n- `cargo +nightly udeps` to remove unused dependencies, requires `rustup toolchain install nightly`\n- `cargo tree` to display dependency tree, useful for debugging incompatible dependencies\n\n### Commands\n\n- `rustup update` to update the Rust toolchain including `rustc` and `cargo`\n- `tmux new-session -t \u003cexisting-session\u003e` to attach to the same session multiple times and switch windows independently, using tmux grouped sessions (see [SO post](https://unix.stackexchange.com/a/24288)), e.g. for monitoring output from `cargo watch` commands in separate windows\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmloning%2Fzero2prod-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmloning%2Fzero2prod-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmloning%2Fzero2prod-rs/lists"}