Commit Graph

80 Commits

Author SHA1 Message Date
c84af64ce8 feat: mongodb 单后端精简分支 — Beanie 2.x + pymongo async,移除 MySQL/alembic 2026-08-21 21:28:51 +08:00
981bee5a46 feat: 改造为开箱即用模板 — MySQL/MongoDB(Beanie) 一键切换 + AGENTS.md 开发规范
- src/ 按域组织骨架,示例域 items 双后端实现(SQLAlchemy2.0 async / Beanie 2.x)
- DB_BACKEND 环境变量切换,router 只依赖 Repo Protocol
- alembic 迁移(含初始 items 迁移)、uv 依赖管理、ruff、pytest 异步测试
- Dockerfile + docker-compose(app/mysql/mongo)
- AGENTS.md 重写为本模板开发规范;原最佳实践文档归档 docs/
- 验证:mongodb/mysql 双后端 pytest 全绿 + uvicorn 真实冒烟通过
2026-08-21 21:23:26 +08:00
Yerassyl
5e00aa6095 Update README.md 2026-05-03 23:11:59 +05:00
Yerassyl
52707b6917 Refresh examples for modern stack; promote AGENTS.md to canonical agent ruleset (#89)
* Refresh examples for modern stack; promote AGENTS.md to canonical agent ruleset

Replaces stale code in README.md (python-jose, async_asgi_testclient,
json_encoders, contradictory `Field(ge=18, default=None)`, unused
`model_validator` import) with current equivalents (PyJWT, httpx +
ASGITransport, `@field_serializer`). Adds a top-of-file pointer to
AGENTS.md, a tested-versions line, and inline notes for `Annotated[T,
Depends(...)]` and SQLAlchemy 2.0 async without rewriting every example.
Adds a `dependency_overrides` testing subsection and a BackgroundTasks
vs. task-queue decision table.

Rewrites AGENTS.md as a terse, machine-readable mirror: compatibility
matrix at the top, Do/Don't blocks throughout, an explicit anti-patterns
table covering common AI-agent mistakes, and a quick-reference table.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Sync code-only fixes into README_ZH.md

Mirrors the safe code-only changes from the parent commit into the
Chinese translation:
- python-jose -> PyJWT (import + exception class) in both dependency examples
- async_asgi_testclient -> httpx.AsyncClient + ASGITransport (and fixes
  the previously broken example that mixed both imports)
- Pydantic json_encoders -> @field_serializer for the CustomModel example
- Field(ge=18, default=None) -> Field(ge=18) (the constraint and the
  default contradict each other)
- Removes unused `model_validator` import

No prose changes. Existing Chinese descriptions still accurately
describe the new code. Sections newly added in README.md
(BackgroundTasks vs task queue, dependency_overrides, the agent banner,
the version line, and the Annotated/SQLAlchemy 2.0 inline notes) are
not ported here because they require translation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Trim docs/changelog voice from refresh

Pass over the refresh to keep the article in best-practices voice,
not docs or changelog:

- Drop the "Note on syntax" blockquote in README's Dependencies
  section. It hedged ("Both styles work. New code should prefer
  Annotated.") while every example below kept the default-arg form.
  Removing the callout returns the section to its original shape;
  a full Annotated migration can be its own PR.
- Remove the "json_encoders is deprecated in Pydantic v2" inline
  explainer. The code change already says it.
- Rewrite the databases blockquote into a single in-voice line
  ("For new projects, reach for SQLAlchemy 2.0's async API...")
  instead of an apologetic disclaimer.
- Collapse the "Earlier versions of this article recommended
  async_asgi_testclient" blockquote into a direct sentence.
- Drop the "this file wins — README is narrative, this is the spec"
  precedence line in AGENTS.md. The two files are peers; neither
  outranks the other.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 21:00:34 +05:00
Yuquan Zhu
8fbaf55763 Fix typos in README.md (#82)
* Fix typos in README.md

* Fix typos in README.md
2026-01-10 13:44:50 +05:00
nimaxin
aeac01f285 Rename endpoint to create_profile and add password (#77) 2026-01-10 13:44:25 +05:00
nathanielce24
3f96300886 Change MusicBand class to StrEnum (issue #73) (#80)
Changed to StrEnum, which avoids the need for multiple inheritance (str, Enum) and makes the intent clearer
2026-01-10 13:43:48 +05:00
Yerassyl
da5b691ad1 Fix grammar and improve text readability (#81)
* Fix grammar

* Add FastAPI best practices skill

* Add CLAUDE.md with FastAPI best practices

* Add more tips to CLAUDE.md

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-04 03:28:33 +05:00
qinantong
c65b826c10 Add chinese translation (#72)
* add Chinese translation
2025-08-12 17:45:33 +05:00
Joab
f79f4ddde5 Remove extra space (#71) 2025-08-05 02:18:26 +05:00
Fernando
fe3f4fcfb8 Proofread README.md (#67)
Minor proofreading
2025-04-11 13:30:41 +05:00
Dev Nev
5555113176 Fix typo 2024-09-03 19:07:42 +05:00
Jan Katins
c67ef31915 Fix ruff invocation in latest versions (#51) 2024-08-04 00:05:14 +05:00
Yerassyl Zhanymkanov
a8d29c0c78 Add caution that link is external 2024-06-08 13:21:46 +02:00
Yerassyl Zhanymkanov
94409fd530 Fix typo 2024-06-08 13:17:42 +02:00
Yerassyl Zhanymkanov
00c60c8bdb Add a bit more explicit differentiation between sync and sync 2024-06-08 13:08:34 +02:00
Yerassyl Zhanymkanov
c2c4d1651f Fix the missing Dispatch link 2024-06-08 13:04:26 +02:00
Yerassyl Zhanymkanov
a4c9fc4c1f Reorder FastAPI serialization 2024-06-08 12:44:39 +02:00
Yerassyl Zhanymkanov
d9cca8c318 !Refactor article
Made chapter-like division
Dropped irrelevant points
Updated code to Pydantic v2
2024-06-08 12:32:32 +02:00
Amir Lavasani
eeb8110c22 Update links for smoother navigation (#47) 2024-05-13 16:19:07 +05:00
Collins
f477655e5f Fix typo
Fix typo in Section 19: SQL-first, Pydantic-second
2024-05-02 11:54:38 +05:00
halon
ae98be9cb4 Fix Pydantic BaseSettings url 2023-10-22 14:35:07 +06:00
Nikita Biryukov
d81098db5c Fix the 24th line of contents
* Update README.md

fix the reference to 24th paragraph (linters)

* Update README.md

Fix the headline (24th)
2023-10-08 10:42:56 +06:00
Yerassyl
1dc0eba8cf Update README.md 2023-09-13 12:23:07 +06:00
Yerassyl Zhanymkanov
fc006628fe Fix link to 22 2023-09-02 00:33:00 +06:00
Yerassyl Zhanymkanov
af22d483dd Merge remote-tracking branch 'origin/master'
# Conflicts:
#	README.md
2023-09-02 00:32:02 +06:00
Yerassyl Zhanymkanov
61801e363b Add some explanation to 22 2023-09-02 00:26:11 +06:00
Yerassyl Zhanymkanov
4df45d3899 Mark some examples with Pydantic versions 2023-09-02 00:23:34 +06:00
Yerassyl Zhanymkanov
1fe5dd0031 Upgrade No. 8 to Pydantic v2 2023-09-02 00:22:57 +06:00
Daliseiy
db781d6b54 Fix typo 2023-07-05 00:08:59 +06:00
Daniil Okhlopkov
00704cc2ae Fix typos 2023-06-29 23:09:10 +06:00
sunn
6311937549 Fix typo 2023-04-09 12:22:04 +06:00
tangkikodo
c2b45d4f8e Fix typos 2023-03-13 10:29:11 +06:00
nbanic
eb44489578 Fixing a link. (#15) 2023-01-09 16:54:57 +06:00
Yerassyl
ecc3afeef3 Fix typos and put sample link under contents (#14) 2023-01-06 01:19:21 +06:00
Yerassyl Zhanymkanov
b73dd9c73b Fix typos and put sample link under contents 2023-01-06 01:17:29 +06:00
Yerassyl
4df0a7c59d Update README.md 2023-01-06 00:23:42 +06:00
Anton Shum
d17d0fecf9 Replace custom field validators with Extra.forbid by @anton-shum 2022-09-17 00:12:26 +06:00
Yerassyl Zhanymkanov
cab4b1ab1a Fix typos 2022-08-29 01:50:48 +06:00
Yerassyl Zhanymkanov
a9372fbe45 Fix some grammarly issues 2022-08-28 22:24:28 +06:00
Yerassyl Zhanymkanov
f3eab50e77 Enhance wording for SQL-first points 2022-08-28 17:49:12 +06:00
Yerassyl Zhanymkanov
5924edcdbb Add CTA to share experience 2022-08-28 17:42:35 +06:00
Yerassyl Zhanymkanov
fef5e2e85c Add bonus section with link to issues 2022-08-28 17:32:24 +06:00
Yerassyl Zhanymkanov
da9e7c502e Fix content urls 2022-08-28 17:16:35 +06:00
Yerassyl Zhanymkanov
3f0a928f64 Add details for FastAPI response models, sync SDKs & linters 2022-08-28 17:12:03 +06:00
Yerassyl Zhanymkanov
feebffe7de Add details for custom ValueError 2022-08-28 15:45:47 +06:00
Yerassyl Zhanymkanov
3068f61440 Add detailed description of SQL-first, URL host validation points 2022-08-28 15:23:13 +06:00
Yerassyl Zhanymkanov
0d12e708d3 Add better explanation for background tasks 2022-08-28 14:05:17 +06:00
Yerassyl Zhanymkanov
4a0e97201b Merge remote-tracking branch 'origin/master' 2022-08-26 19:37:30 +06:00
Yerassyl Zhanymkanov
3989644459 Fix typos 2022-08-26 19:37:22 +06:00