Moon Miners
An idle mining game: own moons, drill their wells, claim resources, sell or refine them.
server/: Go server: the JSON API (server/api.md) and the admin pages (/utils).client/: Defold client, for desktop and the browser (WebAssembly).
Server
Needs Go 1.25+ and Podman or Docker. Put a .env in the repo root (variables in
server/README.md).
podman-compose up -d db # or: docker compose up -d db
cd server
make migrate
make dev # http://localhost:3000: the game (once built, below); /utils: the admin
After pulling changes or editing server/config/game.json, run make migrate again before
starting the server: it applies new migrations and syncs the tools and prices with the
config (the server alone doesn't).
Defold client
Needs the Defold editor (https://defold.com/download/) or Java 21+. The Makefile downloads
Defold's command-line builder (bob.jar) and runs it with the Java the editor ships, found
in the usual places on Linux, macOS and Windows (make DEFOLD=<folder holding its packages>
for another place, JAVA=<path> for your own Java); without an editor, java from PATH.
cd client
make run # desktop build, plays against http://localhost:3000
make web # browser build into dist/web/MoonMiners/
The server serves the browser build at http://localhost:3000 (from
client/dist/web/MoonMiners, or MM_WEB_DIR). It looks for the build when it starts:
after the first make web, restart the server; later builds only need a page reload.
Without a build, / goes to the admin. The desktop and browser games keep separate saved
players.
Deploy
Dokploy, Docker Compose with docker-compose.prod.yml. Details in server/README.md.