{"id":24568554,"url":"https://github.com/ohmycloud/zero2prod-axum","last_synced_at":"2025-07-20T16:33:29.716Z","repository":{"id":272409458,"uuid":"916473857","full_name":"ohmycloud/zero2prod-axum","owner":"ohmycloud","description":"zero2prod with axum and sea-orm","archived":false,"fork":false,"pushed_at":"2025-04-26T03:23:02.000Z","size":231,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-15T13:36:57.460Z","etag":null,"topics":["axum","sear-orm"],"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/ohmycloud.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}},"created_at":"2025-01-14T06:58:55.000Z","updated_at":"2025-05-05T12:59:26.000Z","dependencies_parsed_at":"2025-04-26T04:34:04.590Z","dependency_job_id":null,"html_url":"https://github.com/ohmycloud/zero2prod-axum","commit_stats":null,"previous_names":["ohmycloud/zero2prod-axum"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ohmycloud/zero2prod-axum","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohmycloud%2Fzero2prod-axum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohmycloud%2Fzero2prod-axum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohmycloud%2Fzero2prod-axum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohmycloud%2Fzero2prod-axum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ohmycloud","download_url":"https://codeload.github.com/ohmycloud/zero2prod-axum/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohmycloud%2Fzero2prod-axum/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266160760,"owners_count":23885884,"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":["axum","sear-orm"],"created_at":"2025-01-23T14:40:42.322Z","updated_at":"2025-07-20T16:33:29.692Z","avatar_url":"https://github.com/ohmycloud.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zero2Prod\n\nAxum + Sea-Orm\n\n# 部署到 Digital Ocean\n\n```bash\n# 生成 token\n# https://cloud.digitalocean.com/account/api/tokens\ndoctl auth init --context tonken_name\ndoctl apps create --spec spec.yaml --context tonken_name\n```\n\n# 查询数据库\n\n```bash\n# 连接 postgres 数据库\npsql -h localhost -p 5432 -U postgres\n\n# 列出数据库\n\\l newsletter\n\\c newsletter\n\\dt\n\nnewsletter=# \\dt\n                List of relations\n Schema |        Name         | Type  |  Owner\n--------+---------------------+-------+----------\n public | _sqlx_migrations    | table | postgres\n public | seaql_migrations    | table | postgres\n public | subscription_tokens | table | postgres\n public | subscriptions       | table | postgres\n\n\ndelete from subscriptions;\n```\n\n# 启动 Redis\n\n```bash\n. ./scripts/init-redis.sh\ncargo test redirect_to_admin_dashboard_after_login_success\n```\n\n测试时需要启动 Redis 数据库, 否则程序无法构建:\n\n```\nFailed to build application.: IO Error: Os { code: 61, kind: ConnectionRefused, message: \"Connection refused\" }\n```\n\n# 登录后跳转到 Dashboard\n\n```rust\nlet seed_user = \"INSERT INTO users\n    (user_id, username, password_hash) VALUES\n    ('ddf8994f-d522-4659-8d02-c1d479057be6', 'admin', '$argon2id$v=19$m=15000,t=2,p=1$OEx/rcq+3ts//WUDzGNl2g$Am8UFBA4w5NJEmAtquGvBmAlu92q/VQcaoL5AyJPfc8')\";\ndb_connection.execute_unprepared(\"\").await.expect(\"Failed to execute postgres.\");\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohmycloud%2Fzero2prod-axum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fohmycloud%2Fzero2prod-axum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohmycloud%2Fzero2prod-axum/lists"}