{"id":19036138,"url":"https://github.com/tx7do/fastapi-poetry-demo","last_synced_at":"2025-04-23T19:04:59.518Z","repository":{"id":183017572,"uuid":"669475513","full_name":"tx7do/fastapi-poetry-demo","owner":"tx7do","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-29T03:45:54.000Z","size":396,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T02:33:32.122Z","etag":null,"topics":["fastapi","makefile","minio","poetry","pytest","python","python3","redis","swagger-ui","tortoise-orm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tx7do.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":"2023-07-22T11:58:48.000Z","updated_at":"2025-03-11T01:50:27.000Z","dependencies_parsed_at":"2024-05-29T05:24:50.139Z","dependency_job_id":"f94010b7-2eba-49c5-8f3c-a699d63f7519","html_url":"https://github.com/tx7do/fastapi-poetry-demo","commit_stats":null,"previous_names":["tx7do/fastapi-poetry-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tx7do%2Ffastapi-poetry-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tx7do%2Ffastapi-poetry-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tx7do%2Ffastapi-poetry-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tx7do%2Ffastapi-poetry-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tx7do","download_url":"https://codeload.github.com/tx7do/fastapi-poetry-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249348729,"owners_count":21255312,"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":["fastapi","makefile","minio","poetry","pytest","python","python3","redis","swagger-ui","tortoise-orm"],"created_at":"2024-11-08T21:53:32.984Z","updated_at":"2025-04-17T14:33:56.080Z","avatar_url":"https://github.com/tx7do.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastapi-poetry-demo\r\n\r\n## 技术栈\r\n\r\n- [Python](https://www.python.org/)\r\n- [Poetry](https://python-poetry.org/)\r\n- [FastAPI](https://fastapi.tiangolo.com/)\r\n- [Tortoise ORM](https://tortoise.github.io/)\r\n\r\n## 运行时环境需求\r\n\r\n- Ubuntu 22.04 LTS\r\n- Python 3.9+\r\n\r\n## 安装Poetry\r\n\r\n通过安装脚本进行安装（可以保证安装到最新的版本）：\r\n\r\n```bash\r\ncurl -sSL https://install.python-poetry.org | python3 -\r\n```\r\n\r\n将配置添加到`.bashrc`：\r\n\r\n```bash\r\nexport PATH=\"/home/ubuntu/.local/bin:$PATH\"\r\n```\r\n\r\n## 初始化项目，下载依赖项\r\n\r\n```bash\r\npoetry install\r\n```\r\n\r\n## 导出依赖项配置到requirements.txt\r\n\r\n```bash\r\npoetry export --output config/requirements.txt\r\n```\r\n\r\n不导出Hash：\r\n\r\n```bash\r\npoetry export -f requirements.txt --output config/requirements-prod.txt --without-hashes\r\n```\r\n\r\n## 运行服务\r\n\r\n```bash\r\npoetry run python3 app/main.py\r\n```\r\n\r\n## 运行测试\r\n\r\n测试全部用例：\r\n\r\n```bash\r\npytest\r\n```\r\n\r\n测试API：\r\n\r\n```bash\r\npytest tests/api -v -s\r\n```\r\n\r\n测试数据库增删改查：\r\n\r\n```bash\r\npytest tests/crud -v -s\r\n```\r\n\r\n## 访问API文档\r\n\r\n- Swagger：\u003chttp://127.0.0.1:8000/docs\u003e\r\n- Redoc：\u003chttp://127.0.0.1:8000/redoc\u003e\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftx7do%2Ffastapi-poetry-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftx7do%2Ffastapi-poetry-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftx7do%2Ffastapi-poetry-demo/lists"}