Skip to content

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

Description

@Prateekiiitg56

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

  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions