{"id":20065052,"url":"https://github.com/ebtech/zero2prod","last_synced_at":"2025-03-02T10:42:50.670Z","repository":{"id":77812285,"uuid":"326582933","full_name":"EbTech/zero2prod","owner":"EbTech","description":"Following zero2prod.com for my own education","archived":false,"fork":false,"pushed_at":"2022-03-26T21:11:55.000Z","size":523,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-12T23:07:50.838Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EbTech.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":"2021-01-04T05:49:25.000Z","updated_at":"2022-01-19T06:41:58.000Z","dependencies_parsed_at":"2023-03-20T22:34:35.676Z","dependency_job_id":null,"html_url":"https://github.com/EbTech/zero2prod","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EbTech%2Fzero2prod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EbTech%2Fzero2prod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EbTech%2Fzero2prod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EbTech%2Fzero2prod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EbTech","download_url":"https://codeload.github.com/EbTech/zero2prod/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241494146,"owners_count":19971870,"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-13T13:48:49.586Z","updated_at":"2025-03-02T10:42:50.647Z","avatar_url":"https://github.com/EbTech.png","language":"Rust","readme":"My adventures in Luca Palmieri's [Zero To Production In Rust](https://www.zero2prod.com).\n\nMake sure you have the following installed:\n- OpenSSL\n- [Rust](https://www.rust-lang.org/tools/install)\n- [Docker](https://docs.docker.com/get-docker) (might need to follow up with `systemctl start docker`)\n- [psql command-line client](https://blog.timescale.com/blog/how-to-install-psql-on-mac-ubuntu-debian-windows)\n- sqlx-cli ([instructions here](scripts/init_db.sh))\n- LLVM stuff ([instructions here](.cargo/config.toml))\n\nTo start up the PostgreSQL and Redis databases in a detached Docker container:\n```\n./scripts/init_db.sh\n./scripts/init_redis.sh\n```\n\nOnce the databases are running, it's possible to build, run or test in the local environment with `cargo build`, `cargo run` or `cargo test`, respectively.\n\nOnce the database is running, it's also possible to statically prepare the binary's SQL queries. This repo already includes the result `sqlx-data.json`, but if necessary this can be generated using (might need to `cargo clean` first):\n```\ncargo sqlx prepare -- --bin zero2prod\n```\n\nTo run in the production environment (the first command just checks if sqlx-data.json is populated correctly):\n```\ncargo sqlx prepare --check -- --bin zero2prod\nsudo docker build --tag zero2prod --file Dockerfile .\nsudo docker run -p 8000:8000 zero2prod\n```\n\nWith the app running in either the local or production environment, you can navigate to \u003chttp://localhost:8000/login\u003e, or simulate client requests using commands such as:\n```\ncurl -v http://127.0.0.1:8000/health_check\ncurl -vd \"name=le%20guin\u0026email=ursula_le_guin%40gmail.com\" http://127.0.0.1:8000/subscriptions\n```\n\nTo deploy the app on DigitalOcean's servers:\n```\ndoctl apps create --spec spec.yaml\n```\n\nTo speed up the inner development loop, install a fast linker (see \"LLVM stuff\" above), then\n```\ncargo install bunyan\ncargo install cargo-watch\ncargo watch -x check -x test -x \"run | bunyan\"\n```\n\nNote: last I checked, there seems to be a problem with the production environment, where the `cargo sqlx prepare --check` and `docker run` commands both fail.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febtech%2Fzero2prod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Febtech%2Fzero2prod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febtech%2Fzero2prod/lists"}