nomadro/apps/ebook/dymini/docs/ARCHITECTURE.md
eric d93a355fd5 Migrate navmini/ebook/nomadweb into apps/ as same-origin portal subpaths.
Shield external portal jumps (keep EXTERNAL_* for later), serve /nav from static build, and proxy /book + /community to vertical Next apps with Caddy notes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-28 03:30:34 -05:00

27 lines
775 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Architecture
## Layers (API)
```
HTTP routers → domains (business rules) → services/infra (SQLite, WeChat)
↑
schemas (Pydantic)
↑
core (auth deps)
```
- **routers**:只做参数校验、调用领域/仓储、返回 JSON
- **domains**:与框架无关的规则(如试读百分比截断)
- **services**:SQLite `store`、微信支付签名、消息推送加解密、PocketBase 适配
- **jobs**:APScheduler 任务(支付对账)
## Frontends
- **miniapp**:`pages` 编排;`modules` 沉淀可复用逻辑;`components` 纯 UI
- **admin**:`api/client` 统一鉴权请求;`types` 与书籍模型对齐
## Data
- 内容源:`data/ebook.md`(可经管理端导入)
- 运行时:`data/*.db`(不入库)