Overview

There can be a number of reasons for hosting your own copy of Math Minion. Perhaps you simply want to be able to access it when the Internet is not available or perhaps you want to play with the code.

Since Math Minion only requires a web server to serve static files, setting this up can be pretty easy, particularly if it is just on your personal machine.

Getting the Files

Regardless of how you host Math Minion you will need a copy of the code. If you are familiar with git, you can clone the repository with the terminal command:

git clone https://github.com/CraigGMorris/mmjs.git

but you can also download a zip archive from github by going to the GitHub repository and clicking on the Code button. This will produce a menu with a Download ZIP option. Put the mmjs folder from the expanded version where wanted.

A Simple Local Server

Probably the easiest way to host Math Minion or your personal computer is with the http.server module of python, especially as you may well already have python installed.

If you don't already have python installed, you can download python3 from the python.org download page.

With python3 or python installed, open a terminal window and change into the folder (mmjs) containing the source files and enter the command:

python3 -m http.server 8000

for python version 3 or

python -m SimpleHTTPServer 8000

if you have a python 2 version.

This will start serving the files from that folder and if you go to your browser and enter the address:

http://localhost:8000

you should see the Math Minion home page. Click on the Run link to launch the program.

Other options include running a full featured web server like Apache, Nginx or running a static server with nodejs.

Running Without Internet

The standard version of Math Minion uses run.html, which loads the libraries for the React and the i18next frameworks from the Internet. Thus it won't work without Internet access.

However this is just an efficiency thing and the necessary files are actually included with the Math Minion code and are used with the rund.html file. So simply run Math Minion with an address like the following:

http://localhost:8000/rund.html

from your local server and Math Minion should work even if the Internet is not available.

Hosting MM on your LAN

If you run a local server as above and are connected to your home network, you can probably access Math Minion from other devices on the network. You will need to figure out the IP address your router assigns to the server machine and then browse to something like http://192.168.0.12:8000, where 192.168.0.12 is the assigned address.

I believe most routers will let you lock an IP address to a device's MAC (ethernet) address so it doesn't change on reboots etc. If you are running a firewall on the host machine, you may also have to adjust its settings.

It doesn't require much of a computer to host a static web server, so instead of your personal machine, you could also host the files on an older computer or even something like a RaspberryPi.

Hosting MM on the Internet

Running a site accessible from the Internet introduces more complications, such as acquiring a domain name and a TLS certificate as well as having a server that can be accessed from the Internet. Low traffic cloud servers are cheap and you can get free TLS certificates from Let's Encrypt, but the details of setting things up is beyond the scope of this article.

If you do decide to try this and need help, feel free to contact me. I am hardly an expert, so there is no guarentee I will be able to help, but I will if I can.