FastAPI backend scaffold — user auth, social, subscriptions, jobs & LLM
Project description
fastkeel ⚡
FastAPI backend scaffold — user auth, social, subscriptions, jobs & LLM.
pip install fastkeel,一行命令生成完整后端骨架。
Status: v0.1.0 — 生产就绪,MIT 开源。
快速开始
# 安装
pip install fastkeel
# 生成项目
fastkeel new my-app --with-user --with-social --with-payment --with-jobs
cd my-app
# 安装依赖并启动
pip install uvicorn
python main.py
生成的项目直接可用:注册、登录、搭子关系、支付订阅、定时任务 — 一个 main.py 全搞定。
CLI 用法
fastkeel new <项目名> [--with-user] [--with-social] [--with-payment] [--with-jobs] [--path <路径>]
| 参数 | 默认 | 说明 |
|---|---|---|
--with-user |
True | 设备注册 + JWT 认证 |
--with-social |
False | 搭子关系 + 群组管理 |
--with-payment |
False | 订阅管理 + 收据验证 |
--with-jobs |
False | APScheduler 定时任务 |
--path |
. |
项目生成路径 |
不选的模块不注册路由、不创建表、不引入依赖。
模块
| 模块 | 提供 |
|---|---|
core |
FastAPI app factory、Config (TOML + env)、SQLite (WAL)、JWT、CORS + 统一错误处理 |
user |
设备注册、登录、JWT 认证、资料更新 |
social |
搭子邀请码、搭子绑定/解除、群组创建/加入/解散 |
payment |
套餐管理、收据验证(渠道无关)、订阅生命周期、支付流水 |
jobs |
APScheduler 定时任务、心跳检查、SQLite 持久化 |
contrib/llm |
LLM API 客户端(自动重试、限流、流式、结构化输出) |
架构
你的项目
├── main.py # import fastkeel → compose app
├── config.toml # TOML 配置(环境变量覆盖)
├── project/ # 你的业务逻辑
│ ├── routes/
│ ├── logic/
│ └── prompts/
└── tests/
│ pip install fastkeel
v
fastkeel (this repo)
├── core/ # 100% 通用,不修改
├── modules/ # 90% 通用,include_*() 选装
├── contrib/ # 扩展集成,按需 import
└── cli/ # fastkeel new 命令
分层规则:
core/— 项目永不修改。需要改意味着抽象边界要调整modules/— 通过 config 配置,不修改源码project/— 写业务逻辑的地方
开发
# Setup
git clone https://github.com/helioswei/fastkeel
cd fastkeel
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
# Commands
make lint # ruff check .
make test # pytest
make build # python -m build
make publish # build + twine upload
# Test single file
pytest tests/test_modules/test_user.py -v
测试 (122 tests, 1.5s)
| 测试集 | 测试数 |
|---|---|
test_core/ (config, db, auth, middleware, app) |
47 |
test_modules/test_user.py |
13 |
test_modules/test_social.py |
21 |
test_modules/test_payment.py |
13 |
test_modules/test_jobs.py |
5 |
test_contrib/test_llm.py |
8 |
test_cli/test_new.py |
9 |
test_integration.py |
6 |
| 合计 | 122 |
Roadmap
- PyPI release —
python -m build && twine upload dist/* -
user_extra_fieldsdynamic columns —ALTER TABLE ADD COLUMNfrom config - End-to-end generated project test —
fastkeel new→pip install→ serve → curl - Webhook signature verification — validate
payment_webhook_secret
MIT © 2026 Helioswei
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fastkeel-0.1.1.tar.gz
(27.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
fastkeel-0.1.1-py3-none-any.whl
(24.6 kB
view details)
File details
Details for the file fastkeel-0.1.1.tar.gz.
File metadata
- Download URL: fastkeel-0.1.1.tar.gz
- Upload date:
- Size: 27.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e879d84d537ca99b8a21ce87d09e2b5729689189285a0e6461e5eafe15199989
|
|
| MD5 |
23efc6b49057f23a940b31a71e362f65
|
|
| BLAKE2b-256 |
e4a297f19cf0fa1e0d781ccdbaed71eb58a6427a7616e079ed2fef36e5bd2ab8
|
File details
Details for the file fastkeel-0.1.1-py3-none-any.whl.
File metadata
- Download URL: fastkeel-0.1.1-py3-none-any.whl
- Upload date:
- Size: 24.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32ee8ed19768545814fb1616c395311b01eee80d04cd9d9fe4d8d3b2bad17d98
|
|
| MD5 |
4b5d5ffecf2571fb56f430ca13b151ec
|
|
| BLAKE2b-256 |
05de7f9523a056854d65e66ec6d835d35a62385300867957082c8e87d006d406
|