Competitive Splatoon Platform
Go to file
Kalle ecd5a2a2f7
TO Tools (#1077)
* Add DB tables

* Toggle TO Tools in new calendar event page

* TO tools page initial

* Add counter pick map pool UI

* Save tie breaker map pool

* Save team name

* Layout initial

* Load users own team

* Make team name input required

* Rename team

* Divide to sections

* Submit team map pool

* New style for counter pick map pool section expand

* Fix tiebreaker map pool not saved when new event made

* Split to many forms

* According for team name

* Small UI consistency tweaks

* Add explanation to tie breaker maps

* Remove redundant prop

* Fix new calendar event todos

* Use required hidden input component in new build page

* Fix to tools page showing even when toToolsEnabled = 0

* Delete team

* Map list generation tests initial

* Add tournament map list generation tests

* First version of map list generation

* Add seeded RNG

* Rearrange files

* Generation with strats initial

* Default map pool + allow one team not to have any maps

* Implement map generation via backtracking

* Make order of stages irrelevant

* Add one more TODO

* Seed

* Fixes

* Tournament map list generator initial

* More functional maplist

* Fix any

* Persist in search params initial

* Add date to calendar seed

* Revert "Persist in search params initial"

This reverts commit f01a9e6982.

* Allow admin to start tournament

* Rate maplist instead of optimal / suboptimal

* Add fallback if map list generation errors out

* Hide TO Tools if not admin

* Submit team roster and delete members

* Teams page

* Give roster s p a c e

* Clear user combobox on sent + layout tweaks

* Gracefully handle updating after tournament has started

* Add title

* Persist map list in search params

* Add i18n
2022-11-13 14:41:13 +02:00
.github Keep translation progress automatically updated inside issue instead 2022-11-07 17:03:06 +01:00
app TO Tools (#1077) 2022-11-13 14:41:13 +02:00
content/articles Add 10 Splatoon tips article 2022-11-03 20:06:29 +02:00
discord-bot Give/remove +2/+3 pings bot command 2022-09-07 17:29:27 +03:00
migrations TO Tools (#1077) 2022-11-13 14:41:13 +02:00
public TO Tools (#1077) 2022-11-13 14:41:13 +02:00
scripts TO Tools (#1077) 2022-11-13 14:41:13 +02:00
types TO Tools (#1077) 2022-11-13 14:41:13 +02:00
.editorconfig Add configs for better support of different development environments (#1092) 2022-11-05 22:45:00 +01:00
.env.example Patreon pledge data parsing endpoint initial 2022-07-10 12:27:02 +03:00
.eslintrc.js Wrap useTranslation to detect missing translations on the route 2022-11-05 14:45:12 +01:00
.gitattributes Add configs for better support of different development environments (#1092) 2022-11-05 22:45:00 +01:00
.gitignore Keep translation progress automatically updated inside issue instead 2022-11-07 17:03:06 +01:00
.nvmrc Upgrade Node.js version 2022-09-14 13:56:19 +03:00
.prettierignore User page initial with SQLite3 (#822) 2022-05-16 17:52:54 +03:00
.prettierrc.js Add configs for better support of different development environments (#1092) 2022-11-05 22:45:00 +01:00
.stylelintrc.json Stylelint allow -webkit-backdrop-filter 2022-03-07 00:39:40 +02:00
CONTRIBUTING.md Add CONTRIBUTING.md 2022-07-16 16:15:19 +03:00
ley.config.js Set DB path from env var 2022-06-07 01:23:33 +03:00
LICENSE User page initial with SQLite3 (#822) 2022-05-16 17:52:54 +03:00
package-lock.json Bump loader-utils from 2.0.2 to 2.0.3 (#1113) 2022-11-08 22:04:16 +02:00
package.json Upgrade deps 2022-10-30 02:19:21 +03:00
README.md Keep translation progress automatically updated inside issue instead 2022-11-07 17:03:06 +01:00
remix.config.js Extract Tags component to a separate file 2022-07-28 21:49:05 +03:00
tsconfig.json Remove Cypress tests 2022-10-30 02:15:15 +03:00

Running locally

sendou.ink

Prerequisites: nvm

There is a sequence of commands you need to run:

  1. nvm use to switch to the correct Node version. If you don't have the correct Node.js version yet it will prompt you to install it via the nvm install command. If you have problems with nvm you can also install the latest LTS version of Node.js from their website.
  2. npm i to install the dependencies.
  3. Make a copy of .env.example that's called .env. Filling additional values is not necessary unless you want to use real Discord auth or develop Lohi bot.
  4. npm run migrate up to set up the database tables.
  5. npm run dev to run the project in development mode.
  6. Navigate to http://localhost:5800/admin. There press the seed button to fill the DB with test data. You can also impersonate any user (Sendou#0043 = admin).

Lohi

TODO: instructions on how to develop Lohi locally

Contributing

Contributions very welcome! See CONTRIBUTING.md for more information.

Translations

Translation Progress

sendou.ink can be translated to any language. All the translations can be found in the locales folder. Here is how you can contribute:

  1. Copy a .json file from /en folder.
  2. Translate lines one by one. For example "country": "Country", could become "country": "Maa",. Keep the "key" on the left side of : unchanged.
  3. Finally send the translated .json to Sendou or make a pull request if you know how.

Things to note:

  • weapons.json and gear.json are auto-generated. Don't touch these.
  • If some language doesn't have a folder it can be added.
  • Some translated .json files can also have some lines in English as new lines get added to the site. Those can then be translated.
  • Some lines have a dynamic part like this one: "articleBy": "by {{author}}" in this case {{author}} should appear in the translated version unchanged. So in other words don't translate the part inside {{}}.
  • There is one more special syntax to keep in mind. When you translate this line "project": "Sendou.ink is a project by <2>Sendou</2> with help from contributors:", the <2></2> should appear in the translated version. The text inside these tags can change.
  • To update a translation file copy the existing file, do any modifications needed and send the updated one.

Any questions please ask Sendou!

API

If you want to use the API then please leave an issue explaing your use case. By default I want to allow open use of the data on the site. It's just not recommended to use the same API's the web pages use as they are not stable at all and can change at any time without warning.

Project structure

sendou.ink/
├── app/
│   ├── components/ -- React components
│   ├── db/ -- Database layer
│   ├── hooks/ -- React hooks
│   ├── modules/ -- "nodu_modules but part of the app" https://twitter.com/ryanflorence/status/1535103735952658432
│   ├── routes/ -- Routes see: https://remix.run/docs/en/v1/guides/routing
│   ├── styles/ -- All .css files of the project for styling
│   ├── utils/ -- Random helper functions used in many places
│   └── permissions.ts / -- What actions are allowed. Separated by frontend and backend as frontend has constraints based on what user sees.writing-and-organizing-tests#Folder-structure
├── discord-bot/ -- Lohi Discord bot that works together with sendou.ink
├── migrations/ -- Database migrations
├── public/ -- Images, built assets etc. static files to be served as is
└── scripts/ -- Stand-alone scripts to be run outside of the app

Commands

Converting gifs (badges) to thumbnail (.png)

sips -s format png ./sundae.gif --out .

Add new badge to the database

npm run add-badge -- sundae "4v4 Sundaes"

Rename display name of a badge

npm run rename-badge -- sundae "New 4v4 Sundaes"

Convert many .png files to .avif

While in the folder with the images:

for i in *.png; do npx @squoosh/cli --avif '{"cqLevel":33,"cqAlphaLevel":-1,"denoiseLevel":0,"tileColsLog2":0,"tileRowsLog2":0,"speed":6,"subsample":1,"chromaDeltaQ":false,"sharpness":0,"tune":0}' $i; done

How to...

Download production database from Render.com

Note: This is only useful if you have access to a production running on Render.com

  1. Access "Shell" tab
  2. cd /var/data
  3. cp db.sqlite3 db-copy.sqlite3
  4. wormhole send db-copy.sqlite3
  5. On the receiver computer use the command shown.

Add a new weapon

  1. Add image in both .png and .avif with the correct weapon ID (replace-img-names.ts can help)
  2. Create new weapon ids json and weapon translation jsons using create-weapon-json.ts script

Add new gear gear

  1. If Salmon Run gear, update constant in create-gear-json.ts
  2. npm run create-gear-json
  3. Copy generated files from output folder to gear-ids.ts file
  4. Get .png from Lean's repository
  5. Generate .avif image

Fix errors from the CI Pipeline

If you change any files and the CI pipeline errors out on certain formatting/linting steps (e.g. the Prettier or Stylelint step), run this command in the repo's root directory:

npm run cf

Before committing, if for some reason you see an abnormally high amount of files changed, simply run git add --renormalize . and it will fix the error.