{"id":50896191,"url":"https://github.com/zwpro/mindmapvideo","last_synced_at":"2026-06-16T00:02:57.596Z","repository":{"id":357082848,"uuid":"1234722342","full_name":"zwpro/mindmapvideo","owner":"zwpro","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-11T09:11:26.000Z","size":19160,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-11T09:38:28.002Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zwpro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-10T15:00:22.000Z","updated_at":"2026-05-11T09:12:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zwpro/mindmapvideo","commit_stats":null,"previous_names":["zwpro/mindmapvideo"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/zwpro/mindmapvideo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zwpro%2Fmindmapvideo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zwpro%2Fmindmapvideo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zwpro%2Fmindmapvideo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zwpro%2Fmindmapvideo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zwpro","download_url":"https://codeload.github.com/zwpro/mindmapvideo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zwpro%2Fmindmapvideo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34385031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-16T00:02:56.665Z","updated_at":"2026-06-16T00:02:57.586Z","avatar_url":"https://github.com/zwpro.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mindmap · 前端\n\n基于 Vue 3 + TypeScript + Vite 的思维导图视频生成平台前端。后端在 `api/` 目录。\n\n## 前端 · 环境变量与 API 域名\n\nVite 按 `mode` 自动加载对应 `.env` 文件：\n\n| 文件 | 生效时机 | 是否进 git |\n|---|---|---|\n| `.env.example` | 仅作模板参考 | ✅ 进 git |\n| `.env.development` | `npm run dev` | ✅ 进 git |\n| `.env.production` | `npm run build` | ✅ 进 git |\n| `.env.*.local` | 本机覆盖 | ❌ 已在 `.gitignore` |\n\n关键变量：\n\n```bash\nVITE_API_BASE_URL=            # 后端域名；开发留空走 proxy，生产填 https://api.xxx.com\nVITE_API_PREFIX=/api/v1       # 后端统一前缀\nVITE_DEV_PROXY_TARGET=http://localhost:8000   # dev server 反向代理目标（仅 dev）\n```\n\n### 开发环境（推荐：走 Vite proxy）\n\n`.env.development` 里 `VITE_API_BASE_URL` **留空**，前端请求走相对路径 `/api/v1/...`，由 `vite.config.ts` 里的 proxy 转发到 `VITE_DEV_PROXY_TARGET`（默认 `http://localhost:8000`）。\n\n好处：浏览器不会发 CORS 预检，也不用在后端额外维护开发域名白名单。\n\n```bash\n# 1. 启后端（另开一个终端）\ncd api\ndocker compose -f docker-compose.dev.yml up -d   # MySQL + Redis\nuvicorn app.main:app --reload\n\n# 2. 启前端\nnpm install\nnpm run dev    # 打开 http://localhost:5173\n```\n\n### 生产环境\n\n`.env.production` 填真实的后端域名，构建时会被静态替换进 bundle：\n\n```bash\nVITE_API_BASE_URL=https://api.mindmap.example.com\n```\n\n然后：\n\n```bash\nnpm run build       # 产物在 dist/\nnpm run preview     # 本机预览生产构建\n```\n\n\u003e 注意：后端 FastAPI 的 `CORS_ORIGINS` 必须包含前端域名（例如 `https://mindmap.example.com`），否则浏览器会拦截。\n\n### 个人本地覆盖\n\n临时想连别的后端（如同事本机、远程测试环境），建 `.env.development.local`：\n\n```bash\nVITE_API_BASE_URL=http://192.168.1.20:8000\n```\n\n此文件不会进 git，只影响你本机。\n\n## 前端代码结构\n\n```\nsrc/\n  lib/api/          # 统一 HTTP 客户端与业务接口\n    config.ts       # 读取 VITE_* 环境变量，暴露 API_BASE/API_PREFIX\n    client.ts       # fetch 封装 + ApiError + 超时 + token 注入\n    projects.ts     # 项目接口\n    scenes.ts       # 大纲 / 分镜接口\n    videos.ts       # 视频任务接口\n    index.ts        # 桶文件，统一 import\n  pages/            # 路由页\n  components/       # 展示 / 业务组件\n  stores/           # Pinia\n  composables/      # 组合式函数\n  types/            # 全局类型\n```\n\n## 常用脚本\n\n```bash\nnpm run dev       # 本地开发\nnpm run build     # 生产构建（含 vue-tsc 类型检查）\nnpm run preview   # 预览生产构建\nnpm run check     # 仅跑类型检查\nnpm run lint      # ESLint\n```\n\n## 使用示例\n\n```ts\n// 任何组件或 store 里\nimport { projectApi, ApiError } from '@/lib/api'\n\ntry {\n  const projects = await projectApi.list()\n  console.log(projects)\n} catch (err) {\n  if (err instanceof ApiError \u0026\u0026 err.status === 401) {\n    // 未登录\n  } else {\n    console.error(err)\n  }\n}\n```\n\n---\n\n## 原始模板信息\n\nThis template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `\u003cscript setup\u003e` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.\n\nLearn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzwpro%2Fmindmapvideo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzwpro%2Fmindmapvideo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzwpro%2Fmindmapvideo/lists"}