Competitive Splatoon Platform
Go to file
Kalle 085ef8abe5
Run checks on PR made (#1063)
* Run checks on PR made

* Prettify

* Refine criteria

* Bruh
2022-10-29 10:44:35 +03:00
.github Run checks on PR made (#1063) 2022-10-29 10:44:35 +03:00
app Run checks on PR made (#1063) 2022-10-29 10:44:35 +03:00
content/articles Add inktv return article 2022-10-25 17:44:17 +03:00
cypress Custom URL url redirects and replacements 2022-10-02 00:25:13 +03:00
discord-bot Give/remove +2/+3 pings bot command 2022-09-07 17:29:27 +03:00
migrations Add database table for user result highlights 2022-10-18 23:40:57 +02:00
public Disable double torpedos in analyzer (#1058) 2022-10-29 10:17:27 +03:00
scripts Add check of valid translations jsons to GA 2022-10-29 00:33:07 +03:00
types Maps page initial 2022-10-06 20:54:14 +03:00
.env.example Patreon pledge data parsing endpoint initial 2022-07-10 12:27:02 +03:00
.eslintrc.js Fix errors not getting logged 2022-10-23 12:49:05 +03:00
.gitignore Create analyzer json with InkConsume values 2022-09-07 23:52:03 +03: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
.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
cypress.config.ts Patreon pledge data parsing endpoint initial 2022-07-10 12:27:02 +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 Revert "Upgrade i18next major" 2022-10-19 23:18:34 +03:00
package.json Add check of valid translations jsons to GA 2022-10-29 00:33:07 +03:00
README.md Remove note about WIP from README 2022-10-29 10:14:26 +03:00
remix.config.js Extract Tags component to a separate file 2022-07-28 21:49:05 +03:00
translation-progress.md Fix problems with translations jsons 2022-10-29 00:26:50 +03:00
tsconfig.json Article feature initial 2022-08-20 16:15:03 +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).

And if you want to run the E2E tests:

  1. Make a copy of the db.sqlite3 file created by migration and name it db-cypress.sqlite3.
  2. npm run dev:cypress and npm run cy:open can be used to run the E2E tests.

Lohi

TODO: instructions on how to develop Lohi locally

Contributing

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

Translations

View 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.
  • Don't update translation-progress.md file directly. There is a script for this npm run check-translation-jsons. If you don't know how to run it then Sendou will run it for you.

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.
├── cypress/ -- see: https://docs.cypress.io/guides/core-concepts/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