Architecture of Source Academy
How the parts of Source Academy fit together, and which repository holds each. This page is the overview; the pages for the components are listed at the end.
Written on 28 November 2026 from the code and the READMEs of the repositories. Each page names the files it was checked against, so that a maintainer can tell what to update when the code changes.
The picture
A learner's browser runs the frontend. The frontend knows no language and no tool: it reads three directories (static JSON files on GitHub Pages) to find out which languages, evaluators, plugins and modules exist, and loads what it needs when a program runs. A language evaluator runs in a Web Worker and talks to the frontend through the Conductor protocol. Tools that show a program's execution, such as the Stepper, are plugins that the evaluator asks the frontend to load. The backend keeps the accounts, courses, assessments and submissions, and sends submissions to the grader, which runs the same evaluators on the server.
The parts, and where they live
| Part | What it is | Repository |
|---|---|---|
| Frontend | The web application: workspaces, the editor, the side-content tabs, assessments, grading screens | frontend |
| Backend | Accounts, courses, assessments, submissions, the API; Elixir, Phoenix, PostgreSQL | backend |
| Grader | Runs a submission's test cases in an evaluator, on AWS Lambda | grader |
| Directories | JSON lists of the languages and evaluators, of the plugins, and of the modules | language-directory, plugin-directory, modules |
| Conductor | The protocol between a host and a runner, and the code that implements it | conductor |
| Evaluators | One implementation per language | js-slang, py-slang, scm-slang, java-slang, ocaml-slang |
| Plugins and modules | Tools that show a run, and libraries that a program imports | plugins, modules |
| Deployment | Where the parts run | backend (deployment/), GitHub Pages |
Two paths cross all of these: a run in the workspace, and a submission.
Three ideas that explain most of the design
- The frontend knows no language and no tool. Which languages exist, which evaluator runs each, which tab shows what an evaluator computes: all of it is in the directories, and the frontend reads them at run time. A new language or tool is added to a directory, not to the frontend. (This is the direction the code is moving in; the frontend still contains a few special cases, tracked in frontend#4587.)
- An evaluator is a program that speaks Conductor. It runs in a Web Worker in the browser and in a worker thread in the grader, with the same code in both.
- A tool is a plugin. The evaluator asks the host to load a plugin by its id in the plugin directory, and the plugin contributes a tab. Writing a visualizer plugin describes how.
The four pieces that make the frontend language- and tool-agnostic
Conductor
conductor is the standard interface between a host (an environment from which runners are created: the browser frontend, a command line, the grader) and a runner (the environment where user code runs, with an evaluator in it). Host and runner exchange messages over named, bidirectional channels; the standard ones carry results (__result), errors (__error), standard output (__stdio) and status (__status). A plugin is a program loaded on demand that can listen on and send over channels. An evaluator implements IEvaluator (the base class BasicEvaluator needs only evaluateChunk), and an entry point creates a Conduit and registers the runner plugin. Conductor also defines the module interface: the data types and the functions with which a module (a library such as rune or plotly) reads and builds values of an evaluator without knowing its memory model. More in Conductor.
Plugins
A plugin is how a tool joins a run. The Stepper, the E-Stepper, the Data Visualizer and the CSE machine are plugins: each has a package that the evaluator uses (common-* for the protocol, runner-* for the evaluator's side) and a package that the browser loads (web-*, which contributes a side-content tab). They live in plugins, are built into bundles on GitHub Pages, and are found through the plugin directory. An evaluator asks the host to load one with hostLoadPlugin(id). More in Plugins and modules, and Writing a visualizer plugin.
Language directory
language-directory lists the languages that Source Academy supports. A language definition has an id, a name, the evaluators that can run it, and optional settings: an editor configuration, a textbook (with the chapters written in this language), and links to documentation. An evaluator definition has an id, a name, the URL of the evaluator's entry file, its capabilities, and optionally the id of a plugin whose tab presents what the evaluator computes (an evaluator with that field is hidden from the evaluator dropdown, and chosen when the user opens the plugin's tab). The directory is published as JSON at https://source-academy.github.io/language-directory/directory.json; on 28 November 2026 it lists 13 languages (Python §1 to §4, Python §4 Typed, full Python, Source §1 to §4, Scheme, Java, OCaml). A new language is added to src/languages.ts. More in Directories.
Plugin directory
plugin-directory lists the plugins. A plugin definition has an id, a name, an optional description, an optional tab (its id, label, icon, and whether it hides the host's REPL or keeps the side content from being resized, so that the host can show a placeholder before the plugin loads), and resolutions: for each kind of environment (web, runner, module) the URL of the plugin's entry file. On 28 November 2026 it lists four plugins: stepper, e-stepper, data-visualizer and cse-machine. A new plugin is added to src/plugins.ts. More in Directories.