Ei kuvausta

Codex d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten
.openai d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten
app d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten
components d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten
examples d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten
hooks d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten
lib d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten
public d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten
.gitignore d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten
.oxfmtrc.json d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten
.oxlintrc.json d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten
README.md d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten
components.json d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten
next.config.ts d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten
package-lock.json d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten
package.json d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten
tsconfig.json d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten
vite.config.ts d507c649b4 Build API service curriculum with interactive lessons and runnable FastAPI lab 1 kuukausi sitten

README.md

Agent 开发 · 后端基础补修课

单页课程教材。8 个模块保留独立入口,目前只完成 API 服务开发的 16 节课件。其他模块不包含预先编写的教学内容。

本地查看

项目依赖 Node.js 22.13 或更新版本。第一次运行:

npm install
npm run dev

打开终端显示的地址(通常为 http://localhost:3000)。顶部「授课视图」会收起目录并放大正文和代码,适合录屏;再次点击退出。课时链接使用 ?lesson=01 到 ?lesson=16,可以直接定位,浏览器前进和后退可用。交互图解是浏览器内的状态模拟,真实后端需单独运行配套项目。

修改课件

  • app/lessons.json:16 节结构化课件。每节包括目标、概念、实战步骤、验收、排错、练习和技术文档链接。
  • app/course.tsx:模块目录、课件展示、视频位置、授课视图。
  • app/demos.tsx:HTTP 请求处理、协议消息序列、异步 I/O 时间线三个教学演示。
  • app/globals.css:版式、移动端与录屏样式。
  • app/videos.json:课时编号到视频的映射,默认留空。视频尚未录制。
  • examples/:可运行的 FastAPI 参考项目源代码。完整项目覆盖课程的主线端点,课堂代码包含需自行加入的演进步骤和扩展实验。
  • public/downloads/api-lab.zip:学员下载包。解压后的入口为 api-lab/main.py,按包内 README 启动。

修改课时标题、时长或正文后,目录会从课程数据自动生成。阶段分组目前对应 01–04、05–08、09–10、11–16;如增删课时,需要同时调整 course.tsx 内的 phases。

接入课程视频

录制完成后,编辑 app/videos.json。键为两位课时编号;type: "file" 使用网页内播放器(浏览器支持的 MP4/WebM 文件),type: "link" 打开已有视频平台地址。

{
  "01": { "type": "file", "url": "/videos/01.mp4" },
  "02": {
    "type": "link",
    "url": "https://你的课程平台/实际视频地址",
    "title": "读懂一次 HTTP 请求"
  }
}

本地视频放在 public/videos/;大视频建议使用可直接访问的 HTTPS 媒体地址。示例里的平台地址须换成真实地址。没有配置的课时显示「视频待录制」,不会生成假的播放入口。本页不上传或转码视频,也不绕过视频平台的访问限制。

示例项目和验证

进入 examples,按该目录的 README 创建 Python 虚拟环境、安装依赖并运行 FastAPI。课件网页与 Python API 是独立进程;网页上线不代表 Python 示例接口同时上线。

npm exec tsc -- --noEmit
npm run build

示例项目含 30 项 pytest 测试,版本和真实网络验证结果见 examples/VERIFICATION.md。课件使用 Python 3.11+ / Pydantic 2,下载包锁定已测试版本。课程源码片段用于逐节演进,不应不加区分地全部追加到参考项目中。

更新 examples 后,重新生成 public/downloads/api-lab.zip,只收录示例源码、依赖、说明和客户端,不包含虚拟环境、缓存或本地密钥。ZIP 内保留 api-lab/ 顶层目录。

网站的私有发布信息保存在 .openai/hosting.json。学生访问权限需要在正式发放教材前按实际授课范围设置。