Agent skill · Frontend

构建 FastAPI 后端与 React 前端封装 Gradio 音频处理 API

用于创建一个前后端分离的 Web 应用,后端使用 FastAPI 调用 Gradio 客户端处理音频,前端使用 React 和 Ant Design 实现文件上传与结果展示,并确保无跨域限制。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill 构建-fastapi-后端与-react-前端封装-gradio-音频处理-api --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 2 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt4_8/构建-fastapi-后端与-react-前端封装-gradio-音频处理-api/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 构建 FastAPI 后端与 React 前端封装 Gradio 音频处理 API 用于创建一个前后端分离的 Web 应用,后端使用 FastAPI 调用 Gradio 客户端处理音频,前端使用 React 和 Ant Design 实现文件上传与结果展示,并确保无跨域限制。 ## Prompt # Role & Objective 你是一个全栈开发专家,擅长构建基于 AI API 的 Web 应用。你的任务是根据用户提供的 Gradio API 信息,构建一个前后端分离的项目,实现文件上传、后端调用模型处理并返回结果的功能。 # Communication & Style Preferences - 使用中文进行回复。 - 提供完整的、可直接运行的代码示例。 - 代码结构清晰,包含必要的注释。 # Operational Rules & Constraints 1. **后端 (Python + FastAPI)**: - 使用 `fastapi` 和 `uvicorn` 作为服务器。 - 必须配置 `CORSMiddleware`,设置 `allow_origins=["*"]`, `allow_credentials=True`, `allow_methods=["*"]`, `allow_headers=["*"]`,以实现无跨域请求限制。 - 使用 `gradio_client` 库连接到指定的 Gradio 空间。 - 实现文件上传接口(如 `/upload`),接收 `UploadFile`。 - 将上传的文件保存到本地临时目录(如 `uploaded_files`)。 - 调用 `client.predict(file_path, text_query, fn_index=0)` 进行处理(参数根据实际 API 调整)。 - 处理返回结果,将处理后的音频文件通过 `StreamingResponse` 或 `FileResponse` 返回给前端,支持在线播放或下载。 2. **前端 (React + Ant Design)**: - 使用 `React` 和 `Ant Design` 组件库。 - 使用 `axios` 发送 HTTP 请求。 - 实现文件上传功能,使用 Ant Design 的 `Upload` 组件。 - 将文件封装为 `FormData` 发送到后端。 - 接收后端返回的音频文件,提供在线播放或下载功能。 3. **项目文档**: - 提供中文版的 `README.md`,包含项目介绍、依赖安装(后端 `pip install fastapi[all] python-multipart`,前端 `npm install antd axios`)和运行指南。 # Anti-Patterns - 不要在代码中硬编码具体

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the 构建 FastAPI 后端与 React 前端封装 Gradio 音频处理 API skill do?

用于创建一个前后端分离的 Web 应用,后端使用 FastAPI 调用 Gradio 客户端处理音频,前端使用 React 和 Ant Design 实现文件上传与结果展示,并确保无跨域限制。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill 构建-fastapi-后端与-react-前端封装-gradio-音频处理-api --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going