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>
27 lines
775 B
Markdown
27 lines
775 B
Markdown
# 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`(不入库)
|