-
Make sure Node.js 22 or later is installed:
node -v
-
Make sure Go 1.23 or later is installed:
go version
-
Set up a local PostgreSQL database, i.e. using a container:
docker run --name postgres \ -v postgres:/var/lib/postgresql/data \ -e POSTGRES_PASSWORD=root \ -p 5432:5432 \ -d \ postgres:16-alpine
-
Create databases named
seatsurfing(for running the application) andseatsurfing_test(for running the tests) in your PostgreSQL database:CREATE DATABASE seatsurfing; CREATE DATABASE seatsurfing_test;
-
Check out Seatsurfing's code:
git clone https://github.com/seatsurfing/seatsurfing.git cd seatsurfing -
UI: Install dependencies and start the web interface. Use a dedicated terminal for that:
cd ui npm ci npm run dev -
Server: Install dependencies and run the server. Use a dedicated terminal for that:
cd server go get . ./run.sh
Optionally: Add a custom
.envfile in the folder./serverto set additional environment variables.
You should now be able to access the UI at http://localhost:3000/ui/. To login, use the default admin login (user admin@seatsurfing.local and password 12345678). To check notification e-mails sent by the system open the MailHog interface at http://localhost:8025/.
The frontend translations are located in: ./ui/i18n.
To add a new language, copy the ./i18n/translations.en-GB.json file and name it according to the two-letter or four-letter localization code. Do not change the keys of the file, but only translate the values. Then, add the new language to the ./i18n/index.js and the ./src/components/RuntimeConfig.ts files.
To modify translations in an existing language, just open the corresponding ./i18n/translations.[...].json files and update the values.
To add new keys to the translation files in order to use them in new frontend functionalities, add the corresponding keys to the ./i18n/translations.[...].json files. To make work easier, you can add the translations to the English ./i18n/translations.en-GB.json (master) file only and then run the ./ui/add-missing-translations.sh scripts which add the keys and untranslated values to the other language files.
If you add functionality (database queries, RESTful endpoints, utility functions etc.), please create corresponding unit tests - both positive and negative test cases.
If you modify existing backend functionality, please modify/add corresponding test cases.
If you add/modify major frontend functionality, please add/modify the e2e tests.
-
To run the backend/server unit tests:
cd server ./test.sh -
To run the e2e Playwright tests:
-
Install the dependencies:
cd e2e npm ci npx playwright install --with-deps -
Build UI:
cd ui npm ci && npm run build
-
Run the tests:
npx playwright test
-
Before submitting a pull request, please make sure the unit and e2e (written in Playwright) tests pass.
We use conventional commits and squash merges, so the PR title should follow the conventional commit conventions.
Please provide a comprehensible description about the added/changed functionality. If frontend functionality is modified, screenshots are a welcome addition.