Skip to main content

Teachstack Json

What is the teachstack.json?

The teachstack.json file is a core configuration file for every Teachstack course. It acts as the “blueprint” that describes the essential metadata, structure, and settings. It allows Teachstack to correctly interpret, display, and manage your content. If you are new to Teachstack, understanding and correctly configuring this file is one of the most important steps to getting your course up and running.

Why is this file important?

  • Defines Course Structure: It tells Teachstack how your course is organized—what languages are supported, what modules and exercises exist, and how they are grouped.
  • Enables Automation: The platform and its tools use this file to automate course deployment, validation, and student experience.
  • Ensures Compatibility: By conforming to the schema, your course will work seamlessly with Teachstack’s features, including analytics, workspace provisioning, and grading.

Sample Structure

The Teachstack.json file contains two primary sections. The languages object and the modules object.

The languages object is an array of three variables that allows you to define the runtime language for your course, its version, and the framework you will use to evaluate

The modules object outlines the structure of your course, telling Teachstack where to find the course files, what order they should be presented in, which exercise files should open automatically at load out, and where to

{
"version": 1,
"languages": [
{ "language": "python", "version": "3.12" }
],
"modules": [
{
"name": "Introduction",
"dir": "intro",
"exercises": [
{
"name": "Hello World",
"dir": "hello-world",
"initialFiles": ["main.py"],
"tests": [
{ "name": "Output Test", "test": "assert_output('Hello, world!')" }
]
}
]
}
]
}

Field-by-Field Breakdown

languages

  • Type: Array of objects
  • Required: Yes
  • Purpose: Lists the programming languages and versions used in the course.
  • Example:
  [
{ "language": "python", "version": "3.12" },
]

Defaults for these values will already be populated for you when you clone a course template to initialise a course repository. Read our Supported Languages and Versions article to see a full list of valid language, version and testrunner values.

Modules Section:

The modules section