Skip to main content

Setup

Requirements

warning

On Windows use a shell such as Git Bash, it will not work with cmd.exe!

Node.js

tip

The required Node.js version is available in the .node-version file.

Installation instructions are here.

Python 3

warning

Required only on Windows because of native dependencies!

winget install -e --id Python.Python.3.9

Or manually with the installer.

Microsoft Visual C++ (MSVC)

warning

Required only on Windows because of native dependencies!

Install Visual Studio 2022 and make sure to select/install the component Desktop development with C++ during the installation.

PostgreSQL

The default database's name is csdm but it's recommended to create a development database, for example csdm_dev.
Using a development database allows you to work on the application and play CS without worring about breaking your main database schema and data.

You can setup the database using Docker or the classic PostgreSQL installation.

Database in Docker

warning

While the PostgreSQL process can be run in a Docker container, the psql CLI must be installed on the host machine!

Installing psql

To install only psql:

Follow the installation documentation and install only the Command Line Tools component during the process.

Starting the container

From the root project folder:

  1. [Optional] cp .env.example .env and edit configuration variables
  2. ./docker/start.sh
tip

If you are on Windows with WSL 2, you might notice a RAM usage increase by the process vmmem.
It's a WSL known issue that haven't been fixed yet, you can use this workaround in the meantime.

Stopping the container

From the root project folder:

  1. ./docker/stop.sh

Start developing

  1. cp .env.example .env and edit variables if needed
  2. npm install
  3. npm run dev

Troubleshooting

Cannot find module 'winregistry.node'

[ERROR] [plugin native-node-modules] Cannot find module '../build/Release/winregistry.node'

This error occurs when Python 3 or the Desktop development with C++ Visual Studio component are not installed.
Please make sure to install all required dependencies.

chrome-sandbox error (Linux)

On Ubuntu >= 20.04, you might encounter the following error:

You need to make sure that /electron/dist/chrome-sandbox is owned by root and has mode 4755.

The quick fix is to run the following command to disable the sandbox:

sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0