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 Company
cannot be activated afterCorn Field
. This is uncommon because you could get fewer coins.Loan Office
cannot be activated afterForest
orFlower Shop
. This is uncommon because you could get fewer coins.Moving Company
cannot 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 Company
cannot be activated beforeTax Office
. This is uncommon because you could get fewer coins.Exhibit Hall
cannot be activated beforeTech Startup
(e.g. to activateLoan Office
). While this could give you more coins, (i) it is quite rare, and (ii) activatingTech Startup
first 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 install
We recommend using VS Code as your code editor. Some contribution guidelines:
- Run
npm run lint:fix
to run code linting and check for syntax errors. - Run
npm run prettier:fix
to autoformat the code. - Run
npm run version:fix
to update the version in src/version.ts with the version in package.json.
You must first build the app by running,
npm run build
This 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 serve
The 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 dev
The 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 main
This will only work if you are a collaborator.