Files
jiang13-forum/.cursor/rules/rebuild-gitea-ssr.mdc
freefire 3f50316ad0 fix: 完成 Gitea 目录改组收尾(import、构建与 LICENSE)
同步包路径与路由,去掉 SPA 构建步骤,对齐 Gitea 式 LICENSE,并更新规格/规则与占位 SSR。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-29 04:01:20 +08:00

38 lines
1.4 KiB
Plaintext
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.
---
description: Gitea 式 SSR 重构总则rebuild/gitea-ssr 分支)
alwaysApply: true
---
# Gitea 式 SSR 重构
## 分支
- 功能开发在 **`rebuild/gitea-ssr`****不要**把破坏性 SSR 替换推到 `main`。
- `main` 保留 React SPA用作对照checkout / worktree
## 渲染
- 公开页(首页、板块、帖详情、用户页等)必须用 **Go `html/template` 服务端渲染完整 HTML**。
- 禁止为已迁移公开页恢复 React SPA 空壳;禁止「用户 SPA + 爬虫专用 HTML」双轨作为长期方案。
- JSON `/api` 仅用于交互增强与管理后台,**不得**作为公开页首屏唯一数据来源。
## 架构参照
对齐 [Gitea](https://github.com/go-gitea/gitea) 职责划分:
- `routers/web` — HTML 页面路由
- `routers/api` — JSON API原 `handler/`
- `routers/setup.go` — 路由总装
- `templates/` — 模板
- `web_src/` → `public/assets/` — 渐进增强 CSS/JS
- `models/`、`services/` — 数据与业务
- `modules/auth`、`modules/webrender`、`modules/seo` — 横切
本分支**已删除** `frontend/` 与 `embed_static/`;勿再恢复 SPA 生产回落。
细节见 [`docs/rebuild-spec/08-gitea-ssr-architecture.md`](docs/rebuild-spec/08-gitea-ssr-architecture.md)。
## 产品规格
实现功能前按 [`docs/rebuild-spec/README.md`](docs/rebuild-spec/README.md) 阅读顺序核对;业务规则以 `05-business-rules.md` 为准。