بنقرة واحدة
convex
Convex database schema, queries, mutations, actions, and real-time subscriptions for LessonPlay
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Convex database schema, queries, mutations, actions, and real-time subscriptions for LessonPlay
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | convex |
| description | Convex database schema, queries, mutations, actions, and real-time subscriptions for LessonPlay |
Convex is the backend for LessonPlay — database, serverless functions, real-time sync, and file storage in one platform.
convex/schema.ts using defineSchema / defineTable from "convex/server" and v validators from "convex/values"internalMutation / internalQuery for server-only functionsgenerateUploadUrl(), read via ctx.storage.getUrl() or ctx.storage.get()Schema lives in convex/schema.ts. All tables are typed. Use v validators for field types. Convex auto-adds _id and _creationTime to all documents.
| Type | Use For | Can Call External APIs? | DB Access |
|---|---|---|---|
query | Reading data, real-time | No | ctx.db (read) |
mutation | Writing data | No | ctx.db (read/write) |
action | External APIs, file processing | Yes | Via ctx.runQuery / ctx.runMutation only |
query, mutation, action): Callable from clients via api.xxx.yyyinternalQuery, internalMutation): Only callable server-side via internal.xxx.yyyReact components use useQuery() hook — returns undefined while loading, then auto-updates when underlying data changes. No manual polling needed.
Three-step upload: (1) call generateUploadUrl() mutation, (2) POST file to URL, (3) store returned storageId. Read files with ctx.storage.getUrl(id) in queries or ctx.storage.get(id) in actions.
Wrap app in ConvexProvider from "convex/react" with a ConvexReactClient instance. Must be a "use client" component in Next.js App Router.
convex/schema.ts — Table definitionsconvex/games.ts — Game queries/mutationsconvex/players.ts — Player queries/mutationsconvex/answers.ts — Answer submissionsconvex/generate.ts — AI generation actionconvex/files.ts — File upload/parsingapp/ConvexClientProvider.tsx — React providerFile upload, parsing (PDF, PPTX, DOCX, ODT, HTML, MD), and Convex storage for lesson materials
Game state machine, lobby system, question flow, scoring, and real-time game coordination
Gemini API integration for generating pedagogically-grounded game questions from lesson content
shadcn/ui patterns, game UI components, responsive layouts for classroom use