Skip to content

Setting up the app using a local setup of lichess

Burra Abhishek edited this page Oct 25, 2021 · 3 revisions

This guide helps you to setup lichobile (running entirely on your device) using a local setup of lichess.

Configuration settings

Prerequisites

You'll have to clone this repository (download a copy of this repository onto your device which allows for code changes to be recorded, all in your device) or download it and extract the contents of the downloaded file. To clone this repository, install git if you haven't, and run git clone https://github.com/veloce/lichobile.git.

You'll have to install the required dependencies if you haven't already done so. Otherwise, the app will not run at all.

You'll have to setup lila and lila-ws and get them up and running for this to work.

You'll also need to have rimraf installed, otherwise the app will fail to build.

Recommended Procedure

  1. Create a new file in the root directory called appconfig.local.json. (Here, root directory means root directory of your copy of the repository, not the OS root. For example, if you cloned or downloaded this repository, open that copy in your machine. That is the root directory)

  2. Add the below code to appconfig.local.json and change the port numbers if necessary:

{
  "apiEndPoint": "http://localhost:9663",
  "socketEndPoint": "ws://localhost:9664"
}
  1. Then execute the following command in your terminal or Command Prompt to build lichobile
APP_CONFIG=local npm run build
  1. Follow the instructions for running the app in your browser or the instructions for running the app in your device/emulator to get up and running.

Common issues

CORS Errors:

Error messages include Response to preflight request does not pass access control checks. Redirect is not allowed for a preflight request

Solution: In /appconfig.local.json, set apiEndPoint to http://localhost:9663 (Replace the port number if necessary). Use localhost instead of 127.0.0.1 while opening the website. Note that the apiEndPoint should be set to http://localhost:<port> and not http://127.0.0.1:<port>.

Web socket issues

The socketEndPoint parameter should have ws and not wss.

App does not render properly in Firefox

Open lichobile in an emulator or a Chromium-based browser like Google Chrome.