Skip to content

Lishogi Development Setup

WandererXII edited this page Mar 30, 2025 · 3 revisions

This guide assumes you use linux, so while you can make this work on other platforms, it might take some more tinkering on your part.

First clone lishogi repository:

git clone https://github.com/WandererXII/lishogi.git
cd lishogi

Prerequisites

You should have the following tools installed.

Frontend

  • node
  • pnpm

Specific versions specified in root package.json

Backend

  • java (JDK 17)
  • sbt (^1)

Database

  • mongodb (^4.0)
  • redis (^7.2)

Other

You probably won't need these:

  • python (^3.13) - linting translations, regenerating sbt modules build order

Frontend

First run pnpm install, after that simply run pnpm ui:build. This builds everything. If you also want to watch for changes and rebuild as is necessary you can run pnpm ui:build:watch.

Backend

Start the sbt console with ./lila.sh. After the initial load, type compile, this will take several minutes for the first time. After it's done make sure mongodb and redis is running, then type run into the sbt console. Go to http://localhost:9663/, you will have to wait another minute before you get the first response. if everything went well you should now have lishogi dev version running locally.

Websockets

See that red popup saying reconnecting, you will probably also need websockets. Clone https://github.com/WandererXII/lila-ws, cd lila-ws type sbt, when the console loads type compile. After the compilation is done, type reStart. And that's it.

Development

Before PR

Please make sure your changes are properly formatted. Use scalafmtAll inside sbt console for scala code changes, scalafmtSbt for changes to sbt build. After changes to the frontend code please run pnpm ui:format:fix, then run pnpm ui:lint to list issues found by linters and pnpm ui:lint:fix to fix them, some of the issues might have to be fixed manually, so make sure to run pnpm ui:lint again. Also don't forget to run type-checking: pnpm run ui:type-check.

VScode

I use these .vscode/settings.json for lishogi.

{
  "files.watcherExclude": {
    "target": true,
    "node_modules": true,
    "logs": true,
    "dist": true
  },
  "typescript.preferences.preferTypeOnlyAutoImports": true,
  "typescript.tsdk": "node_modules/typescript/lib",
  "biome.lspBin": "node_modules/@biomejs/biome/bin/biome",
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.codeActionsOnSave": {
    "source.organizeImports.biome": "always"
  },
  "[typescript]": {
    "editor.defaultFormatter": "biomejs.biome",
    "editor.codeActionsOnSave": {
      "source.organizeImports.biome": "explicit"
    }
  }
}
Clone this wiki locally