AOSSIE-Org / AOSSIE-Org/DebateAI

[FEATURE]: Add endpoint to export debate transcript as downloadable PDF

未关闭
#403 5 条评论 0 个 reaction 已指派 1 人 已被 @Prateekiiitg56 认领 在 GitHub 查看
enhancement
主要语言
TypeScript
星标
84
派生
198
平均合并
2 天 19 小时
30 天内合并 PR
30

描述

### Feature and its Use Cases

Right now, once a debate ends, the transcript only exists as JSON data pulled through GET /transcript/:id for the frontend UI to render. There's no way to actually download or save it as a file. I'd like a new endpoint that generates a PDF version of a completed debate transcript.

Use case: a user finishes a debate and wants to download the full transcript (their arguments, opponent's arguments, phase-by-phase breakdown, and result) as a PDF. They can then review it later, share it with a coach/mentor for feedback, or keep it as a practice log outside the platform - without needing to stay logged in or keep the tab open.

Proposed endpoint: GET /transcript/:id/export?format=pdf, reusing the same transcript data already modeled in backend/models/transcript.go and already queried in backend/controllers/transcript_controller.go (GetTranscriptByIDHandler). No new data model needed - this is purely an additive read-only export on top of existing data.

### Additional Context

Relevant files: backend/controllers/transcript_controller.go, backend/routes/transcriptroutes.go, backend/models/transcript.go, backend/services/transcriptservice.go.
Implementation idea: use a Go PDF library like gofpdf or maroto to render the existing transcript struct into a formatted PDF (topic, participants, phase-by-phase speech text, result).
Good first-contribution candidate - self-contained, doesn't touch websocket/matchmaking logic, low risk since it's just a new read path on existing data.
Optional follow-up (could be a separate issue): add a "Download PDF" button next to each transcript in the frontend's transcript history page.

### Code of Conduct

- [x] I have joined the [Discord server](https://discord.gg/hjUhu33uAn) and will post updates there
- [x] I have searched existing issues to avoid duplicates

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。