mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 16:28:31 +00:00
3.8 KiB
3.8 KiB
VSCode Setup
This guide walks you through a first time VScode setup for Baserow for developers. It will ensure you can run and debug all tests and also enable all the relevant linters and automatic style fixers to make your life as easy as possible.
This guide assumes you have a basic understanding of git, python, virtualenvs, postgres and command line tools.
Prerequisites
Install the following tools:
Setup Steps
- First checkout a fresh copy of Baserow:
git clone git@github.com:baserow/baserow.git(or your personal fork of the project) cd baserow./config/vscode/apply_standard_baserow_vscode_config.sh- Type
Yand hit enter to apply the standard Baserow config
- Type
- Open VSCode and on the "Welcome to VSCode" screen click the "Open" button and open the baserow folder you cloned above.
- Make sure you have installed / enabled the Python VSCode plugin.
- Now we will create a Python virtual environment and configure VSCode to use it to run tests
and linters:
- Initialize the backend (creates venv and installs dependencies):
This creates a virtualenv at
just b init.venv/in the project root. - Then you will most likely need to select it as default interpreter for the project:
- Type: Ctrl + Shift + P or open the command palette
- Type: Python: select interpreter
- Find and select your virtualenvs
bin/pythonexecutable (.venv/bin/python)
- If do not see the python tests in the testing menu:
- Type: Ctrl + Shift + P or open the command palette
- Type: Python: Configure Tests
- Initialize the backend (creates venv and installs dependencies):
- Install and get a postgresql database running locally:
- The easiest way is to use Docker:
just dc-dev up -d db redis - Or install PostgreSQL locally: https://www.postgresql.org/docs/11/tutorial-install.html
- If running PostgreSQL locally, create a baserow user:
CREATE USER baserow WITH ENCRYPTED PASSWORD 'baserow'; ALTER USER baserow CREATEDB;
- The easiest way is to use Docker:
- Now you should be able to run the backend python tests from the testing menu, try
run
backend/tests/baserow/core/test_core_models.pyfor instance. - Now lets set up your frontend dev by changing directory to
baserow/web-frontend - Use nvm or fnm to install the correct version of
node. You need Node.js 24.15 or later in the 24.x line: install it withnvm install 24and enable it withnvm use 24. Older 24.x versions failyarn installwithThe engine "node" is incompatible with this module; runnvm install 24again to get the latest 24.x, thennpm install -g yarnagain (nvm keeps global packages per Node version). Seebaserow/docs/installation/supported.mdfor the supported versions of Node.js. - Install
yarnglobally:npm install -g yarn - Now run
just f installto install dependencies (oryarn installdirectly). - Select "Trust Project" if you see an VSCode popup after running yarn install
- Install the Vitest extension
(
vitest.explorer). It finds the core, premium and enterprise Vitest configs and lists their tests in the testing menu. - Confirm you can run a web-frontend unit test from vscode
Recommended Plugins
You can use the VSC Export & Import to install what is inside config/vscode/vsc-extensions.txt.
Otherwise, you can manually install:
- Python
- Volar
- Eslint
- Gitlab Workflow
- Gitlens
- Vitest
- SCSS Formatter
- Stylelint
- Mypy
- Docker
- Coverage Gutters