read this first
Mastermind is early. it works, it saves real files, and it is not perfect yet. here is what it can and can't do, and where your files go.
starting a new site
you don't need a folder or a repo to start. on the first screen, give the site a name and pick one:
- start in this browser works in any browser. the site is kept in this browser's storage until you press download, which gives you a zip with one folder inside: your pages,
mastermind.json, photos, fonts and the files that draw the pages. unzip it and that folder is your site. put it on any host, push it to GitHub, or open it again later with open a folder. - make it in a new folder needs Chrome or Edge. the folder picker has a new folder button. make one, pick it, and Mastermind saves straight into it from then on.
- a site kept in this browser stays through quitting and restarting. it's gone if you clear this browser's cookies and site data, or if you only used a private window. Safari also clears it if you don't open Mastermind for 7 days.
- Mastermind asks the browser to keep the site even when your disk fills up. Chrome and Edge usually agree on their own, Firefox asks you. if the browser says no, the continue button tells you.
- the toolbar and the continue button show when you last downloaded, and turn yellow when you have changes that aren't in a download yet.
- this browser holds one site at a time. starting another one throws the first away, so download it first.
- double-clicking
index.htmlin the downloaded folder shows the desktop version. the phone layout, language switching and galleries need the folder served from a host, or opened in Mastermind.
browsers
- open a folder only works in Chrome and Edge (and other browsers built on Chrome, like Brave, Arc and Opera). Safari and Firefox don't let websites open a folder on your computer.
- connect a GitHub repo and start in this browser work in any up to date browser.
- every keyboard shortcut works on Windows too: ctrl instead of ⌘, alt instead of option. the ? button in the editor lists them.
- Mastermind is built for a laptop or desktop. it opens on a tablet but it's cramped. on a phone it won't open at all, and shows its address so you can open it on a computer instead. to see your site on a phone while you design, use phone preview.
- a hard reload (⌘⇧R or ctrl+shift+R) turns off the part of Mastermind that loads photos and fonts. Mastermind reloads once by itself to turn it back on, and loads photos another way if that's not enough.
where your files go
nowhere but your own folder, your own repo, or this browser's own storage. there is no Mastermind account and nothing is uploaded to a Mastermind server.
- folder: files are read and written straight to the folder you picked.
- GitHub: this browser talks to GitHub directly with your token. make a fine-grained token that can only see the one repo, give it
contents: read and write, and set it to expire. - remember on this computer keeps the token in this browser. don't tick it on a shared or school computer. forget the token on the connect screen clears it.
- changes you haven't saved stay in this browser, so a closed tab can come back. they are not backed up anywhere else.
saving and overwriting
saving writes these files into your site:
mastermind.json, which holds every page you made in Mastermind. this is how Mastermind knows a site is its own and reopens it exactly, with nothing to interpret. sites saved by an older Mastermind have asite.jsoninstead. Mastermind still opens those and renames the file tomastermind.jsonon the next save. asite.jsonthat Mastermind didn't make is left alone.- one
index.htmlper page, plus404.html render.js,site.jsandpage.css, which draw the pages. they are replaced with the newest version on every save, which is how your site picks up Mastermind updates.fonts.cssand a favicon, only if your site doesn't have them yet
what gets overwritten
- the pages Mastermind makes are rebuilt from
mastermind.jsonevery time you save. if you edit one of those html files by hand, the next save replaces your edit. make changes in Mastermind, or keep hand-written pages separate. - if saving would replace a file Mastermind didn't make, like your own
index.html, it lists the files and asks first. say no and nothing is written. say yes and it keeps a copy of each one first (see backups below). - on GitHub, if someone else pushed since you connected, Mastermind stops instead of overwriting their work. reconnect to pick up their changes, then save again.
- on most hosts (GitHub Pages, Cloudflare Pages, Netlify) a push to the main branch goes live a minute later. saving to GitHub is publishing.
- keep your site in git, so any save can be rolled back.
backups
before Mastermind saves over a file it didn't make, it keeps a copy next to it: index.html becomes index-backup.html, about/index.html becomes about/index-backup.html. if that name is taken, it uses index-backup-2.html and so on, so an older backup is never replaced.
- every backup is listed in
mastermind-backup.json, with what it's a copy of and when. Mastermind never edits or deletes a backup. - a backup still works as a page. open
yoursite.com/index-backup.htmlto see your old homepage, with its own css and scripts. - to go back, delete the Mastermind version and rename the backup to its old name.
- your other files, like
style.cssorscript.js, are never touched. Mastermind only writes the files listed above, plus the photos you add.
grid or freeform
every page has a layout, set in the page tab. new pages start with the same layout as the page you're on.
- grid: things snap to columns and rows, and the phone version is built from desktop for you.
- freeform: place anything anywhere, nothing snaps. switching a page to freeform keeps everything where it is.
- every page, grid or freeform, is laid out at its design width (1200 pixels for desktop, 390 for phones, both changeable in the dev tab) and then scales as one piece to fit the screen. text, photos, crops and gaps shrink and grow together, so nothing gets cropped differently or rearranged on a smaller screen. the editor shows the canvas the same way.
- phones get their own layout, stacked top to bottom from the desktop page. move things in phone view to change only the phone. rebuild the phone layout from desktop starts the phone over.
- switching a freeform page back to grid snaps everything to the nearest columns and rows, and the phone layout is rebuilt from desktop.
- blocks shared across every page stay on the grid, and so does a background set to the whole page.
sites you coded yourself coming
Mastermind will be able to read a page you wrote by hand and make an editable copy of it, one page at a time. pick the page in the page menu and press interpret. pages you don't interpret are never touched, so hand-written and Mastermind pages can live in one site.
it's a best guess, not a perfect copy:
- javascript gets flattened. Mastermind reads what the page looks like once it has loaded, not what your scripts do. menus that open, sliders, toggles, things that move or react to clicks come across as still pictures of themselves, or not at all. your
.jsfiles stay in your site, but the Mastermind copy of the page doesn't use them. - hover effects and animations are dropped.
- Mastermind has two layouts, desktop and phone. a page that changes at several screen widths gets the closest match at each end, and the widths in between are approximated.
- forms and deeply nested layouts come out roughly right, not exact.
- on a grid page things snap to columns and rows. on a freeform page Mastermind will keep the exact positions from your code instead.
until then you can still add new Mastermind pages next to your hand-written ones. Mastermind will ask before it touches your files.
using your own css and js
Mastermind pages can load your site's own files, so your styles, sliders and menus keep working on them.
- the code editor (dev tab → open the code editor) lists your site's own css, js and html files. edit them, or make new ones. files Mastermind makes, like each page's
index.html, are listed separately under made by Mastermind. you can read them to see exactly what saving writes, but not edit them, since they're rebuilt from your design on every save. yourfonts.cssis listed with your files, and every page already loads it. - tick use on every Mastermind page on a css or js file, or pick files for one page under extra scripts and styles in the page tab.
- your css loads with the page. your scripts load after Mastermind has drawn the page, so they find what they're looking for. scripts that wait for the page to load still run.
- Mastermind redraws the page when someone switches language or a screen crosses the phone size. a script that sets things up once can listen for
mastermind-drawnondocumentto set them up again. - to put your own html on a page, use an embed block. it sits right on the page, so your css and js reach it.
- your files show in preview and on the live site, not inside the editor itself, so your css can't break the editor.
calendar
the events block shows upcoming events as a list or a month. under events come from, pick one:
- written here: add each event in the panel with a title, a date like
2026-12-05, and times like18:00. leave the start time empty for an all-day event. times show exactly as you type them. - Google Calendar: the page reads your calendar every time someone opens it, so anything you add in Google Calendar shows up on the site, with no saving or pushing.
connecting Google Calendar
it works with no server, but the calendar has to be public, and you need two things from Google:
- make the calendar public. in Google Calendar, open the calendar's settings, and under access permissions, tick make available to public. everyone can then see its events, so use a calendar that's only for the site.
- copy the calendar ID. in the same settings, under integrate calendar. it looks like
abc123@group.calendar.google.com. - make an API key. on Google Cloud console, make a project, turn on the Google Calendar API, then go to credentials → create credentials → API key. it's free for a site's worth of visits.
- lock the key down. edit the key: under application restrictions pick websites and add your site's address, like
yoursite.com/*, and under API restrictions pick only the Google Calendar API. - paste the calendar ID and the key into the events block's settings. the panel says how many events it found.
- the key sits in your page where anyone can see it. that's how Google expects this kind of key to be used, which is why step 4 matters: locked to your site and the Calendar API, it's no use to anyone else.
- times show in the calendar's own time zone, set in Google Calendar.
- it shows events from the last 90 days onward, up to 250 of them.
phone preview
see your site on a real phone while you design it. the phone shows the page you're on and updates every time you change something, before you save.
what it needs
- Node, a free program that runs Mastermind's little server on your computer. check if you have it by typing
node -vin a terminal. if that prints a number, you're set. if not, download it from nodejs.org and install it once. - Mastermind's files on your computer: either installed inside your site (see putting Mastermind inside your site) or downloaded anywhere.
- the phone and the computer on the same Wi-Fi. no cable needed, for iPhone or Android.
start it
open a terminal in your site's folder and run:
node mastermind/serve.js
if you downloaded Mastermind somewhere else, run that copy's serve.js while you're in your site's folder, for example node ~/Downloads/mobile-unit-mastermind/serve.js.
- Mastermind opens in your browser, already connected to the folder. no folder picking and no token, and it works in any browser.
- in the dev tab, under phone preview, you'll see an address like
http://192.168.1.20:8000/mastermind/phone.html. open it on your phone. - design on the computer and watch the phone. tap links on the phone to look at other pages.
- press ctrl+c in the terminal when you're done.
good to know
- only the computer running the server can save. phones and anything else on the Wi-Fi can only look, at your site and the live preview. don't run it on a network you don't trust, like café Wi-Fi.
- if port 8000 is taken, pick another:
node mastermind/serve.js 8001. - each start makes a new private link for the editor. if you restart the server, use the link it prints.
- Android over a cable also works: run
adb reverse tcp:8000 tcp:8000, then openlocalhost:8000/mastermind/phone.htmlon the phone. - why Node isn't included: it's a large program made separately for each kind of computer, and it needs its own security updates. bundling it would add a big file to every site's repo. installing it once from nodejs.org keeps it up to date.
using it in a codespace
the open a folder button opens a folder on your own computer, not inside a codespace. in a codespace, connect with GitHub instead:
- open Mastermind and connect the repo your codespace is working on.
- design and save. Mastermind pushes a commit.
- in the codespace terminal, pull it in:
git pull
you can also run Mastermind inside the codespace itself. download it into the codespace:
git clone https://github.com/ncbourget/mobile-unit-mastermind.git
cd mobile-unit-mastermind && python3 -m http.server 8000
open port 8000 from the ports tab, then connect with GitHub as above.
a Mastermind command coming
a mum command you install once. run it inside any site's folder and Mastermind opens with that folder, in any browser, with no token needed. mum update gets the newest version. nothing is added to your site's repo.
putting Mastermind inside your site
you can keep Mastermind at an address on your own site, like yoursite.com/mastermind/. visit it, sign in, and start editing, with nothing to pick or reconnect. it's the best setup if you edit often, or with a group where everyone opens the same editor.
what it needs: your site in a git repo, the site hosted on Cloudflare (see below), and a GitHub token for each person who edits. no server, no secrets to set up.
install
in a terminal, at the top of your site's repo:
git subtree add --prefix mastermind https://github.com/ncbourget/mobile-unit-mastermind main --squash
git push
that copies Mastermind into a mastermind folder as one commit. when your site is live, open yoursite.com/mastermind/ and connect the repo with GitHub.
update
when a new Mastermind comes out, run this in the same place, then push:
git subtree pull --prefix mastermind https://github.com/ncbourget/mobile-unit-mastermind main --squash
no git? download the zip from Mastermind's GitHub page (code → download zip), put every file in a mastermind folder at the top of your site, and do the same again to update.
- each person connects with their own token, so each person needs write access to the repo.
- Mastermind won't make a page named
mastermind, and it never saves into that folder, so it can't save over itself. - the editor files hold no passwords or tokens. tokens stay in each person's browser. still, you probably don't want the whole internet opening your editor, so make it private:
making that page private on Cloudflare
this works when your site runs on Cloudflare Pages, or when its domain goes through Cloudflare (the orange cloud is on in dns). a plain username.github.io address can't be protected this way.
- in the Cloudflare dashboard, open Zero Trust. the first time, pick a team name and the free plan.
- go to access → applications → add an application and choose self-hosted.
- set the domain to your site and the path to
mastermind. - add a policy: action allow, include emails, and list the people who can edit.
- save. anyone opening
/mastermind/now gets a sign-in code by email, and only the listed people get in.
the free plan covers up to 50 people. this hides the editor only. the rest of your site stays public, and it can't stop someone with write access to the repo. Cloudflare moves its menus around now and then, so the names above may shift a little.
other limits
- the mailing list block is hidden for now. it needs a server to collect sign-ups, and Mastermind doesn't run one.
- photos are shrunk to 2400 pixels on the longest side when you add them.
- if preflight (the dot next to ?) says a photo is missing, press relink next to it and pick or upload another photo. every place that used the missing one switches to it.
- on GitHub, new photos wait in this browser until you save. close the tab first and they're gone.
- very large repos (tens of thousands of files) are too big to open from the browser.
- fonts come from your site's
fonts.css. add@font-facerules there and Mastermind lists them under "this site". only use fonts your license lets you put on the web. - screens narrower than 700 pixels get the phone layout. change it in the dev tab.
- because the whole page scales, text gets smaller on small laptop screens and bigger on large monitors, the same way a printed page would.
- if your site lives in a folder of its address, like a GitHub Pages project site at
username.github.io/repo-name/, set site lives at in the dev tab to/repo-name/. - preview needs browser storage. if your browser blocks it, preview won't open.
license
Mastermind is © 2026 Nate C. Bourget, under the PolyForm Noncommercial license.
- free for personal and non-commercial sites: your own site, a friend's portfolio, a school, a club, a charity. you can install it in your site and change it for yourself.
- not free for business use, or to sell, rebrand or build a product from. ask first.
- the pages you make with Mastermind are yours. the license covers Mastermind's own code, including
render.js,site.jsandpage.css, which saving copies into your site. - keep the copyright notice at the top of
LICENSE.mdif you pass Mastermind on.