Course dan Lesson Schema
Panduan struktur data untuk membuat course dan lesson di Classroom.
Overview
Classroom menggunakan dua tabel utama di Convex: classroomCourses untuk data course dan classroomLessons untuk isi pelajaran. Field bertanda ? bersifat opsional.
Field slug dipakai langsung di URL, jadi gunakan format lowercase, dash, dan tanpa leading slash. Contoh yang benar: prompt-engineering-101.
Course Schema
Course adalah container utama untuk beberapa lesson. Data ini muncul di halaman listing dan landing course.
| Field | Type | Description |
|---|---|---|
| slug | string | URL slug, lowercase + dashes, tanpa leading slash. Contoh: ship-with-convex |
| title | string | Judul course yang tampil di UI. |
| excerpt | string | Pitch singkat 1–2 kalimat untuk card listing. |
| description? | string | Deskripsi HTML panjang untuk landing page course. |
| cover? | string | Image URL atau Convex storage ID. |
| category? | string | Tag bebas seperti Backend, AI, Design. |
| level | beginner | intermediate | advanced | Level kesulitan course. |
| order | number | Urutan tampil di halaman classroom. Angka kecil tampil lebih dulu. |
| published | boolean | Jika false, course dianggap draft. |
Lesson Schema
Lesson adalah isi pembelajaran di dalam sebuah course. Lesson bisa menggunakan body tunggal atau blocks multi-section.
| Field | Type | Description |
|---|---|---|
| courseId | Id<'classroomCourses'> | Diisi setelah course dibuat. |
| module? | string | Label section, contoh: Module 1 — Setup. |
| slug | string | URL slug lesson di bawah course. |
| title | string | Judul lesson. |
| summary? | string | Ringkasan satu baris di atas body. |
| contentType | richtext | html | copypaste | Dipakai jika blocks kosong. |
| body | string | HTML untuk richtext/html, plain text untuk copypaste. |
| blocks? | array | Multi-section content. Jika tidak kosong, body dan contentType diabaikan saat render. |
| durationMin? | number | Estimasi durasi belajar dalam menit. |
| order | number | Urutan lesson di dalam course. |
| published | boolean | Jika false, lesson dianggap draft. |
Jenis Block yang Didukung
Gunakan richtext untuk konten artikel, penjelasan konsep, atau instruksi yang tampil sebagai HTML ringan.
Gunakan html untuk layout khusus seperti tabel, grid, card, callout, atau struktur visual yang butuh kontrol lebih detail.
Gunakan copypaste untuk prompt, command, snippet, template, atau teks panjang yang perlu disalin user dengan tombol Copy.
Gunakan carousel untuk walkthrough bertahap, slide edukasi, framework, atau step-by-step explanation.
Prompt untuk Generate Banyak Lesson
You are a structured content generator for a Convex-powered Classroom CMS.
Generate a JSON array of lessons that follows this schema exactly:
{
"courseId": "<paste classroomCourses id here>",
"module": "string optional",
"slug": "lowercase-dash-slug-no-leading-slash",
"title": "string",
"summary": "string optional",
"contentType": "richtext | html | copypaste",
"body": "string",
"blocks": [
{
"id": "unique-block-id",
"kind": "richtext | html | copypaste | carousel",
"title": "string optional",
"body": "string optional",
"slides": [
{
"id": "unique-slide-id",
"title": "string optional",
"body": "string",
"kind": "html | richtext"
}
]
}
],
"durationMin": 5,
"order": 0,
"published": true
}
Rules:
- Output only valid JSON array.
- Do not wrap in markdown code fences.
- Use lowercase dash slugs.
- Do not add leading slash to slugs.
- If blocks is non-empty, keep body as an empty string.
- Use richtext for normal explanation.
- Use html for visual tables, cards, or layouts.
- Use copypaste for prompts, commands, snippets, or reusable templates.
- Use carousel for step-by-step walkthroughs.
- Make every block id unique.
- Make every slide id unique.
- Keep lesson order sequential starting from 0.Example Lesson JSON
{
"courseId": "<paste classroomCourses id here>",
"module": "Module 1 — Foundation",
"slug": "system-prompt-template",
"title": "Template system prompt",
"summary": "Prompt dasar untuk membuat asisten yang fokus.",
"contentType": "copypaste",
"body": "You are a senior {role}. Speak in {tone}.\nGoal: {goal}\nConstraints:\n- ...\n- ...\nOutput format:\n- ...",
"blocks": [
{
"id": "b1",
"kind": "richtext",
"title": "Pengantar",
"body": "<p>Kenapa pakai system prompt? Penjelasan singkat di sini.</p>"
},
{
"id": "b2",
"kind": "carousel",
"title": "Walkthrough",
"slides": [
{
"id": "s1",
"title": "Step 1 — Role",
"body": "<p>Tetapkan peran asisten.</p>",
"kind": "richtext"
},
{
"id": "s2",
"title": "Step 2 — Tone",
"body": "<p>Atur gaya bicara.</p>",
"kind": "richtext"
},
{
"id": "s3",
"title": "Step 3 — Goal",
"body": "<p>Definisikan tujuan dan constraint.</p>",
"kind": "richtext"
}
]
},
{
"id": "b3",
"kind": "copypaste",
"title": "Template siap pakai",
"body": "You are a senior {role}.\nGoal: {goal}\n..."
}
],
"durationMin": 3,
"order": 0,
"published": true
}Workflow Admin yang Disarankan
- Buat course terlebih dahulu di admin.
- Copy ID dari data
classroomCourses. - Generate lesson menggunakan prompt di atas.
- Paste
courseIdke setiap lesson. - Pastikan slug lowercase, dash, dan tanpa leading slash.
- Publish lesson jika sudah siap tampil.