Metadata-Version: 2.4
Name: bm-fastapi-scaffold
Version: 0.0.1
Summary: FastAPI service scaffold aligned with bm-ai team PATTERNS.md
Author-email: jack <jack.wu@yunlsp.com>
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Framework :: FastAPI
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Code Generators
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# bm-fastapi-scaffold

一行命令起一个对齐团队 `PATTERNS.md` 的 FastAPI monorepo + 首个子服务。

## 安装

```bash
pip install bm-fastapi-scaffold
```

## 用法

```bash
bm-fastapi-scaffold init my-business-project
# 默认 --service app --port 30000 --target .

bm-fastapi-scaffold init my-business-project --service core --port 30010
bm-fastapi-scaffold init my-business-project --target ~/repos
```

生成结构：

```
my-business-project/
├── .env.example
├── .gitignore
├── .gitlab-ci.yml
├── .pre-commit-config.yaml
├── README.md
├── compose.local.yaml
├── install_dev.sh
├── mypy.ini
├── requirements_dev.txt
└── agents/
    └── app/
        ├── app/
        │   ├── __init__.py
        │   ├── _info.py
        │   ├── _log.py
        │   ├── app.py
        │   ├── interface_models.py
        │   ├── server.py
        │   └── settings.py
        ├── tests/
        ├── Dockerfile
        ├── .dockerignore
        ├── start_server.sh
        ├── build.sh
        ├── pyproject.toml
        ├── requirements.txt
        └── requirements_wheels.txt
```

## 起服务

```bash
cd my-business-project
bash install_dev.sh
cd agents/app
python -m app.server
curl http://localhost:30000/
```

## 规范

模板对齐 bm-ai 团队 `PATTERNS.md`：

- `settings.py` 用 `{env: value}` 字典分环境（不写 if/elif）
- `_info.py` 用 `tomllib` 读 pyproject 版本（不用 `importlib.metadata`）
- `pyproject.toml` 含 `requires-python = ">=3.12,<3.13"` 上限
- `.dockerignore` 含 `*.egg-info` 避免污染 build
- Dockerfile 钉死 base 镜像 tag
- 日志走 `util_common.logger.setup_loggers` 异步 JSON logger

## License

MIT
