A blueprint is a JSON file that describes how a Moodle Playground instance should look at boot. It is an ordered list of steps — install Moodle, log in, create a course, enrol a user, install a plugin, and so on. When the playground starts with a blueprint, it replays those steps automatically, so you land on a ready-to-use site instead of an empty install. The runtime is fully in-browser via WebAssembly: everything runs in memory, nothing is persisted to a server.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ateeducacion/moodle-playground/llms.txt
Use this file to discover all available pages before exploring further.
A minimal blueprint
The smallest useful blueprint installs Moodle, logs in as admin, and opens the dashboard:minimal.blueprint.json
installMoodle is a marker step — the actual installation runs during the boot sequence using the options you supply. login runs over HTTP so the landing page opens already authenticated.
The default admin credentials are
admin / password. Override them with installMoodle’s options fields (adminUser, adminPass, adminEmail) as shown above.Loading a blueprint
There are four ways to supply a blueprint to the playground.- From a URL
- Inline (highest precedence)
- Import in the shell
- Bundled default
Point the This is the most shareable method: paste the link anywhere and the recipient opens a pre-configured Moodle in their browser.
blueprint-url parameter at any reachable JSON file — a relative path served by the playground host, or an absolute HTTPS URL:blueprint parameter → blueprint-url parameter → saved tab session → project default → built-in minimal. See URL parameters for the complete parameter reference.
Top-level fields
Most blueprints only needsteps. All other top-level fields are optional:
| Field | Type | Required | Description |
|---|---|---|---|
steps | array | yes | Ordered list of step objects. Each object must have a step name. |
constants | object | no | Map of {{KEY}} → string values substituted everywhere before steps run. |
resources | object | no | Named file descriptors (@name) referenced from step fields. |
runtime | object | no | Boot-time config.php settings: debug (0/5/15/32767) and debugdisplay (0/1). |
phpConstants | object | no | PHP constants emitted as guarded define() calls in config.php before lib/setup.php. |
landingPage | string | no | Path to open after boot. Must start with /. |
preferredVersions | object | no | Preferred { "php": "8.3", "moodle": "5.0" } — advisory, see Runtime. |
$schema | string | no | Points at blueprint-schema.json for editor validation and autocomplete. |
Constants ({{KEY}} substitution)
Constants let you write a value once and reuse it across every step. Every {{KEY}} placeholder is replaced — deeply, in every string field — before any step executes.
{{REPO}}, {{OWNER}}, {{BRANCH}}, and {{REF}} are automatically populated from the repo, owner, branch / ref URL parameters. This is how PR-preview blueprints target the current branch without hardcoding it. See URL parameters.
Building a blueprint step by step
The snippets below stack into a single complete blueprint. Add them to thesteps array in this order.
Install Moodle and log in
Every blueprint starts with these two steps.
installMoodle records the admin credentials and site name used during boot. login opens an authenticated browser session so subsequent steps that run over HTTP use the admin cookie.Create a user
Only
username is required. The password defaults to password; email, firstname, and lastname have sensible defaults too.Create a category and course
fullname and shortname are both required for createCourse. The shortname is the stable identifier used by later steps to reference the course.Enrol the user
role defaults to student. Other built-in roles are editingteacher, teacher, manager, and coursecreator.Add a course module
module (the activity type) and course (shortname) are required. label is the simplest activity — it just renders HTML inline in the course page.Install a plugin from GitHub
Use a GitHub archive ZIP URL: the To install a theme instead, use
/archive/refs/heads/<branch>.zip or /archive/refs/tags/<tag>.zip form. Plugin type and name are auto-detected from the moodle-TYPE_NAME repo-name convention.installTheme and then activate it with setTheme.Common errors
- Invalid JSON. A trailing comma or missing closing brace stops the entire blueprint. Validate the file in your editor (most flag JSON errors automatically) before loading it.
- Wrong step name. An unknown
stepvalue fails withUnknown step type. Check spelling against the Reference. - Bad plugin URL.
installMoodlePluginandinstallThemerequire a real GitHub archive ZIP URL. The branch or tag in the URL must already exist on the remote — a branch that has not been pushed returns 404. - Outbound download blocked. Firefox and Safari cannot make outbound network calls from WASM PHP, so plugin and language-pack downloads may fail. Use a CORS proxy (
addonProxyUrl/phpCorsProxyUrlURL parameters) or switch to Chromium. See URL parameters. - Out of memory. Very large plugins, course backups, or
unzipoperations can exhaust WASM memory and crash the runtime. Keep blueprints lean and split large restores across multiple sessions.
Next steps
Reference
Every top-level field, step type, and step option with required/optional markers and JSON examples.
Examples
Eleven ready-to-use blueprints you can open immediately in the hosted playground.
Runtime & Versions
How to pick Moodle and PHP versions, and how to write blueprints portable across browser and Docker.
URL Parameters
Full list of URL parameters for loading, configuring, and overriding blueprints.