Skip to content

(backend): Implement Flashcard Generation with Gemini AI #161

@07CalC

Description

@07CalC

Context

The core feature! Generate flashcards from topic content using AI. The generate.ts router has skeleton endpoints that need implementation.

Goal

  • Fetch user's API key from settings
  • Call Gemini API with topic content
  • Parse response into flashcards
  • Save flashcards to database
  • Return generated flashcards to client

Files to Modify

  • packages/api/src/routers/generate.ts
  • Create packages/api/src/utils/gemini.ts

Deliverables

  • Gemini API utility function
  • Flashcard generation endpoint works end-to-end
  • Proper error handling (no API key, API errors, parse errors)
  • Flashcards saved to database
  • Returns generated flashcards to client

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions