-
Make sure Node.js 22 or later is installed:
node -v
-
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 -
Typescript commons: Build the common typescript files:
cd commons/ts && npm install && npm run build
-
Admin UI: Install dependencies and start the admin interface. Use a dedicated terminal for that:
cd admin-ui npm install && npm run install-commons npm run dev
-
Booking UI: Install dependencies and start the booking interface. Use a dedicated terminal for that:
cd booking-ui npm install && npm run install-commons npm run dev
-
Server: Install dependencies and run the server. Use a dedicated terminal for that:
cd server go get . ./run.sh
You should now be able to access the Admin UI at http://localhost:3000/admin/ and the Booking UI at http://localhost:3001/ui/. To login, use the default admin login (user admin@seatsurfing.local and password 12345678).
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 Admin UI:
cd admin-ui npm install && npm run install-commons && npm run build
-
Build Booking UI:
cd booking-ui npm install && npm run install-commons && 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.