gw2treasures.com is a Guild Wars 2 database powered by the official API.
You can create a new issue to report a bug or request a new feature.
Pull requests are always welcome .
It's best to to open an issue first to discuss the changes you want to make. You can also always ask on discord if you have any questions.
These are the steps that are required to work on any of the gw2treasures.com components.
npm i
in the root directory. This will install dependencies for all apps and packages.docker compose up -d database
.docker compose up -d worker
in the background.The website uses Next.js and the code is found in apps/web and packages/ui.
npm run dev:web
The workers powering all background tasks of gw2treasures.com are located in apps/worker. You can see the currently queued jobs on the /status/jobs page when running the frontend.
If you have workers running in docker, it is best to stop them first (docker compose stop worker
), because they will not contain your changes.
npm run dev:worker
.You can rebuild and restart your docker workers with docker compose up --build -d worker
.
You can run npm run prisma:studio
to open prisma studio to access the local development database.
If you need to make changes to the database schema, follow these steps:
npm run prisma:migrate-dev <name>
. <name>
should be the migration name in camelCase (for example addItemTable).If you have a local legacy database running, you can import the data with this command.
docker compose -f docker-compose.yml -f docker-compose.importer.yml up legacy-importer
If you need to work on features that required you to be logged in, you need to create a new application on gw2.me. Then add the generated client_id
and client_secret
in apps/web/.env.local
:
GW2ME_CLIENT_ID="<client_id>"
GW2ME_CLIENT_SECRET="<client_secret>"
After this, you can log in with your gw2.me account.
You can also run gw2.me locally (gw2.me repository), then you also need to set GW2ME_URL
to http://localhost:4000/
.
You can also add the Admin
role to your user if required, see Database Access.
The e2e tests are located in e2e.
First make sure you are running the dev server (npm run dev:web
). You can run the tests with npm run e2e
. Follow the onscreen instructions to install all required dependencies.
# start database and web server
docker compose -f docker-compose.yml -f docker-compose.e2e.yml up -d web database database-migration
# run e2e tests
docker compose -f docker-compose.yml -f docker-compose.e2e.yml up e2e
When the database version is upgraded to a new major version, you need to run the following steps to migrate the data from the old version to the new one.
These instructions only work for migrating from the preceeding database version. If you need to migrate multiple versions, checkout old commits and run the steps from the corresponding README for each version.
docker compose stop
).docker compose up -d database
).docker compose -f docker-compose.yml -f docker-compose.database-migration.yml up -d database-old
.docker compose exec database-old bash -c 'pg_dumpall -p 5432 -U gw2treasures | PGPASSWORD=$POSTGRES_PASSWORD psql -U gw2treasures -h database'
to migrate the data to the new database.docker compose -f docker-compose.yml -f docker-compose.database-migration.yml down database-old
.rm -r .docker/database-pg16
.gw2treasures.com is licensed under the MIT License.