* ✨ feat: 操作日志中间件添加批量插入功能 * Delete GEMINI.md * 🌈 style: 修复格式化错误 * 🐞 fix: 通过asyncio.wait_for兼容py3.10中asyncio.timeout不存在 * 🦄 refactor: 重新组织操作日志批量插入代码逻辑 * 优化代码实现 * 恢复默认配置 * 恢复默认 .gitignore 文件 * 更新队列批处理逻辑
FastAPI Best Architecture - Backend
Docker
-
Make sure you're at the root of the project
-
Run the following Docker command to build container:
docker build -f Dockerfile -t fba_backend_independent . -
Start container
Native boot needs to change
127.0.0.1in.envtohost.docker.internaldocker run -d -p 8000:8000 --name fba_server fba_backend_independent
Contributing
-
Prerequisites
- Python >= 3.10
- Git
- uv
- Fork this repository to your GitHub account
-
Installation and setup
Clone your forked repository:
git clone https://github.com/<your account>/fastapi_best_architecture.gitGo to the root directory of the project, open the terminal, and run the following command:
uv sync --frozen -
Checkout
Checkout a new branch and make your changes
git checkout -b your-new-feature-branch -
Format and Lint
Auto-formatting and lint via
pre-commitpre-commit run --all-files -
Commit and push
Commit your changes and push your branch to the GitHub.
-
PR
Create a PR via GitHub
Scripts
Warning
The following script may not apply to the Windows platform
It is recommended to execute under the backend directory, and chmod authorization may be required
-
pre_start.sh: Perform automatic database migration -
celery-start.sh: For celery docker script, implementation is not recommended -
scripts/format.sh: Perform ruff format check -
scripts/lint.sh: Perform pre-commit formatting -
scripts/export.sh: Execute uv export dependency package