Files
InfoGenie/README.md
树萌芽 6b3fcc1791 security: stop tracking env files; admin gate via VITE_SITE_ADMIN_GATE; Redis/cache/docs
Remove InfoGenie-frontend and Go .env from version control; add .env.example templates; ignore .claude local settings. Admin UI reads site gate from env only. Note: rotate secrets if repo history was ever public.

Made-with: Cursor
2026-04-03 16:10:12 +08:00

78 lines
2.9 KiB
Markdown
Executable File
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.
# InfoGenie万象口袋
多模块仓库:**React + Vite 前端**为主界面,**GoGin + GORM** 为当前主力 API另有 **Java Spring Boot** 占位模块。大量 **60s 类接口**通过上游开放 API 提供本站负责聚合导航、认证跳转、AI 应用壳与小游戏嵌入等。
---
## 仓库结构
| 目录 | 说明 |
|------|------|
| [`infogenie-frontend/`](infogenie-frontend/) | 主站 SPAVite 6、React 18、Tailwind v4 |
| [`infogenie-backend-go/`](infogenie-backend-go/) | **万象后端 API**Go站点配置、AI 代理、健康检查、可选 Redis 缓存等 |
| [`infogenie-backend-java/`](infogenie-backend-java/) | Spring Boot 3.5 骨架(当前无业务 API 层) |
| [`InfoGenie-go-backend/`](InfoGenie-go-backend/) | 历史/备用目录,通常仅 README |
详细 API、表结构、Redis 与诊断接口见 **[infogenie-backend-go/后端文档.md](infogenie-backend-go/后端文档.md)**。
前端路由、Vite、管理员「状态监控」、静态页协作见 **[infogenie-frontend/前端文档.md](infogenie-frontend/前端文档.md)**。
开发与 AI 助手指南见根目录 **[CLAUDE.md](CLAUDE.md)**(若存在)。
---
## 快速启动(本地)
### 前端(`infogenie-frontend/`
```bash
cd infogenie-frontend
npm install
npm run dev
```
默认 **http://localhost:3000**。环境变量见 `infogenie-frontend/.env.development``VITE_API_URL` 默认指向本机 Go **5002**)。
### Go 后端(`infogenie-backend-go/`
```bash
cd infogenie-backend-go
# 按需配置 .env.developmentAPP_ENV、DB_*、可选 REDIS_*
go run ./cmd/server
```
默认监听 **http://127.0.0.1:5002**。健康检查:**GET /api/health**。
### Java 后端(可选)
```bash
cd infogenie-backend-java
mvn spring-boot:run
```
---
## 环境变量要点
| 模块 | 说明 |
|------|------|
| 前端 | `VITE_API_URL``VITE_AUTH_URL``VITE_AUTH_API_URL``VITE_DEBUG`(见前端文档) |
| Go | `APP_ENV``APP_PORT``DB_*``INFOGENIE_SITE_ADMIN_TOKEN`、可选 `REDIS_*``AUTH_CENTER_API_URL` 等(见后端文档) |
**不要**将含真实密码的 `.env` 提交到版本库。
---
## 对外能力摘要Go
- **用户**JWT 校验;登录由萌芽认证中心完成;`/api/user/profile` 等。
- **站点**60s / AI 显隐、60s 上游、功能卡片点击统计;管理员 `X-Site-Admin-Token` 写入配置。
- **AI**`/api/aimodelapp/chat``/chat/stream`SSE及多个垂直能力模型白名单在后端维护。
- **可观测性**`/api/health`;管理员 **`/api/admin/site/diagnostics`**(连接摘要,无密码明文)。
---
## 许可证与备注
具体许可证以前端 `package.json` 与各子项目声明为准。若文档与代码不一致,以当前代码与 **`后端文档.md` / `前端文档.md`** 为准。