github.com/ErlisK/teachrepo-template
The official starting point for every TeachRepo course. Clone it, write your lessons, and ship.
# Clone the template git clone https://github.com/ErlisK/teachrepo-template my-course cd my-course # Install the CLI npm install -g @teachrepo/cli # Scaffold (alternative to cloning) teachrepo new "My Course Title" teachrepo new "My Course Title" --template=quiz # with quizzes teachrepo new "My Course Title" --template=sandbox # with sandboxes
teachrepo-template/ βββ course.yml β course metadata, pricing, lesson order βββ lessons/ β βββ 01-introduction.md β free preview lesson β βββ 02-core-concepts.md β paid lesson with quiz β βββ 03-advanced.md β paid lesson with sandbox β βββ 04-conclusion.md β paid lesson βββ .github/ β βββ workflows/ β βββ deploy.yml β auto-import on git push βββ .env.example β environment variable reference βββ .gitignore βββ README.md
The canonical configuration for your course. All metadata, pricing, and lesson order lives here.
title: "Your Course Title"
slug: "your-course-slug" # URL: teachrepo.com/courses/<slug>
price_cents: 2900 # $29.00 USD | 0 = free
currency: usd
version: "1.0.0"
description: |
Multi-line description. Markdown supported.
repo_url: "https://github.com/you/your-course"
tags: [tag1, tag2]
lessons:
- filename: lessons/01-introduction.md
title: "Introduction"
access: free # β free preview
- filename: lessons/02-core-concepts.md
title: "Core Concepts"
access: paid # β unlocks on purchaseLessons are Markdown files. Add a YAML frontmatter block for metadata, quizzes, and sandboxes.
--- title: "Lesson Title" access: free | paid --- # Lesson Title Lesson content. Full Markdown: code blocks, images, tables.
---
title: "Core Concepts"
access: paid
quiz:
- q: "Which answer is correct?"
options: ["A", "B (correct)", "C", "D"]
answer: "B (correct)"
explanation: "B is correct because..."
------ title: "Advanced Patterns" access: paid sandbox: provider: stackblitz # or codesandbox repo: "you/your-course" branch: "lesson-03-starter" file: "src/index.ts" height: 550 ---
The template includes .github/workflows/deploy.yml. On every push to main, it validates your YAML and auto-imports the course to TeachRepo.
Add one GitHub Actions secret to your repo: TEACHREPO_TOKEN(get it from Dashboard β Settings).