Submit bugs or request changes to the Decks of KeyForge website. See below to suggest changes to the SAS system or card ratings
- Do No Harm It is more important to prevent falsely overrated decks and cards than to accurately capture all value. Your idea should improve scores for almost all decks it touches, and very rarely cause a card to be overrated in value in decks.
- Legacy Cards are lower priority If a card has not been included in the last two sets, it is considered a "legacy" card in terms of changes to SAS. Changes to legacy cards will only be considered if it is obviously inconsistent with other cards with similar scores, or there is an egregious problem.
- Avoid suggesting minor tweaks to scores Make sure your change request is relevant. If you think a card is only off by 0.25 AERC most of the time, it probably isn't worth updating.
- Read the About Page This page details the basic details of how decks and cards are scored in SAS.
- Read the AERC Rating guidelines Find the relevant sections in the AERC rating guidelines This google doc contains detailed information about how cards are rated, and what expectations and rules are used to maintain consistency.
- Compare with existing cards using the card search tool to ensure your change request is consistent with existing cards.
- Don't make duplicates Search the card change issues or sas feature change issues to make sure your request isn't a duplicate or hasn't already been rejected
DoK runs on version 13. Higher is probably fine. For working with Postgres I use a combination of my IDE's built in tools, PGAdmin and the command line.
DoK uses amazon corretto version 17. I'd recommend installing that version specifically.
https://docs.aws.amazon.com/corretto/latest/corretto-17-ug/what-is-corretto-17.html
I use Intellij as that's what I'm accustomed to and it works with Kotlin as well as TypeScript. If you don't install Intellij you'll also need to install Kotlin.
git clone https://github.com/CorayThan/decks-of-keyforge.git decks-of-keyforge
DoK needs a working database to run. However, you can download a working copy of the database from Amazon S3. First download the database dump:
https://dok-db-dumps.s3.us-west-2.amazonaws.com/dok-db.dump
Then make a folder at: /decks-of-keyforge/scripts/local-db-dump
and put the dump file there.
Then run the following commands from the project directory:
createdb -h localhost -U postgres -W keyswap
pg_restore -h localhost -U postgres --clean --if-exists --no-tablespaces --no-privileges --no-owner -d keyswap ./scripts/local-db-dump/dok-db.dump
Create a file /decks-of-keyforge/src/main/resources/appliaction-nocommit.yml
with the following contents:
jwt-secret: ${JWT_SECRET:7f310842a0b446a99eb3da6b8b99efa57f310842a0b446a99eb3da6b8b99efa5}
aws-secret-key: ${AWS_SECRET_KEY:fake}
patreon-secret-key: ${PATREON_SECRET:fake}
patreon-client-id: ${PATREON_CLIENT_ID:fake}
secret-api-key: fake
Certain features will not work when you develop locally, for example emails, patreon refreshing, and uploading deck verification pictures.
One time run:
Before you run the first time, and after you make changes to kotlin classes annotated with @GenerateTs
you need to
run:
./gradlew genSrc
To run the backend server run:
./gradlew bootRun
Install the dependencies for the frontend with:
cd ui
npm install
To run the frontend run:
cd ui
npm run start
When you try to login locally, remember that all passwords for all users will be 'password'.
The above should be all you need to get started to code and test a simple change to the Decks of KeyForge codebase.
Ensure you've revved the version in build.gradle.kts
then run:
./scripts/build-and-push.ps1
Login to AWS Elastic Beanstalk. Go to Upload and deploy. For file choose:
/docker/Dockerrun.aws.json
Would be nice to automate this so the service uploads newly found card images to S3.
Delete *.png
in /card-imgs/
. Uncomment line in RunOnStart. Run app. In /card-imgs/
run:
.\pngquant.exe --ext=.png --force 256 *.png
upload to S3 public with headers: Cache-Control: max-age=31536000
The remainder of this readme are notes I've taken over time about how to manage the project. These may be confusing and/or out of date.
making the db in RDS:
RDS create database
postgres
only enable free tier
20GB
name: keyswap-{env}
master username: coraythan
publicly accessible yes
choose default VPC-security group
db name: keyswap
3 day backups
connecting with pgadmin
maintenance db keyswap coraythan
This is out of date. It needs to be revised and then run again.
cd 'C:\Program Files\PostgreSQL\12\scripts\'
.\runpsql.bat
// server click enter
// database enter: keyswap
SET CLIENT_ENCODING TO 'utf8';
\COPY (select keyforge_id, name, expansion, house_names_string, sas_rating, synergy_rating, antisynergy_rating, aerc_score, amber_control, expected_amber, artifact_control, creature_control, efficiency, recursion, disruption, creature_protection, other, effective_power, raw_amber, action_count, upgrade_count, creature_count, power_level, chains, wins, losses, card_names from deck) to 'C:\Users\Coray\Downloads\dok-decks.csv' DELIMITER ',' CSV HEADER;
Find it in downloads
This is a useful postgresql query that will kill long running queries if DoK has deck searches going that will never end.
SELECT pg_cancel_backend(pg_stat_activity.pid)
from pg_stat_activity
WHERE (now() - pg_stat_activity.query_start) > interval '5 minutes' and state = 'active';
SELECT
pid,
now() - pg_stat_activity.query_start AS duration,
query,
state
FROM pg_stat_activity
WHERE (now() - pg_stat_activity.query_start) > interval '5 minutes'
LIMIT 10;
Go to profile for coraythan
Unlink and relink with buttons.
Go to: https://www.patreon.com/portal/registration/register-clients
Copy Creator's Access Token into the auth header
To update passwords run:
UPDATE key_user
SET password = '$2a$10$N3UlNyYNgndwUQgYos1hq.jwIL.K4utk14pYtZki2Otc3Ii7WdvuW';
The password for all users will be "password".