This is an implementation of the Machi Koro board game. This app was developed using the React framework and the boardgame.io game engine.
Disclaimer: We do not own a license to the game.
The app is online and free to play at playmachikoro.herokuapp.com.
- Total: All establishments are available for purchase. This is the official supply variant of Machi Koro.
- Variable: 10 establishments are available for purchase. This is the official supply variant of the expansions.
- Hybrid: 5 establishments with rolls 1-6, 5 establishments with rolls 7+, and 2 major establishments are available for purchase. This is the official supply variant of Machi Koro 2.
In the Millionaire's Row expansion, there are certain uncommon plays that are not possible:
Demolition Companycannot be activated afterCorn Field. This is uncommon because you could get fewer coins.Loan Officecannot be activated afterForestorFlower Shop. This is uncommon because you could get fewer coins.Moving Companycannot be activated beforeMine,Winery, orApple Orchard. This is done because (i) you could get fewer coins, and (ii) it is ambiguous whether establishments you give away should be activated, so this keeps things simple.Renovation Companycannot be activated beforeTax Office. This is uncommon because you could get fewer coins.Exhibit Hallcannot be activated beforeTech Startup(e.g. to activateLoan Office). While this could give you more coins, (i) it is quite rare, and (ii) activatingTech Startupfirst makes it more clean how many coins you have which can help with picking the establishment to activate.
First, install Node.js (recommend version >= 18). Then, clone this repo and install the project dependencies.
git clone [email protected]:kevinddchen/machikoro.git
cd machikoro
npm installWe recommend using VS Code as your code editor. Some contribution guidelines:
- Run
npm run lint:fixto run code linting and check for syntax errors. - Run
npm run prettier:fixto autoformat the code. - Run
npm run version:fixto update the version in src/version.ts with the version in package.json.
You must first build the app by running,
npm run buildThis does two things:
- Transpile source code into Javascript in the build/ directory.
This is what is run on the server using
node. - Bundle static assets in the dist/ directory. This is what the browser loads.
Once the app has been built, you start the game server by running,
npm run serveThe app will be hosted at localhost:80.
If you open multiple browsers and go to the link (e.g. incognito mode) you can play with yourself.
Note that any changes in the code will not be reflected in the app until it is rebuilt.
In a terminal window, run the following command:
npm run devThe app will be hosted at localhost:80.
There are some debugging tools which are unavailable in the production version of the app.
Additionally, any changes made in the source code will be automatically updated in the browser, which is very convenient.
To change the debug game settings, edit debugSetupData in src/game/machikoro.ts.
First, install the Heroku CLI and log in by running heroku login.
From the project root directory, run heroku git:remote -a playmachikoro to add the Heroku remote to Git.
To deploy your local app, run
git push heroku mainThis will only work if you are a collaborator.