* 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
|
||
|---|---|---|
| .github | ||
| app | ||
| content/articles | ||
| discord-bot | ||
| migrations | ||
| public | ||
| scripts | ||
| types | ||
| .editorconfig | ||
| .env.example | ||
| .eslintrc.js | ||
| .gitattributes | ||
| .gitignore | ||
| .nvmrc | ||
| .prettierignore | ||
| .prettierrc.js | ||
| .stylelintrc.json | ||
| CONTRIBUTING.md | ||
| ley.config.js | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| remix.config.js | ||
| tsconfig.json | ||
Running locally
sendou.ink
Prerequisites: nvm
There is a sequence of commands you need to run:
nvm useto 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 thenvm installcommand. If you have problems with nvm you can also install the latest LTS version of Node.js from their website.npm ito install the dependencies.- Make a copy of
.env.examplethat's called.env. Filling additional values is not necessary unless you want to use real Discord auth or develop Lohi bot. npm run migrate upto set up the database tables.npm run devto run the project in development mode.- 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
sendou.ink can be translated to any language. All the translations can be found in the locales folder. Here is how you can contribute:
- Copy a
.jsonfile from/enfolder. - Translate lines one by one. For example
"country": "Country",could become"country": "Maa",. Keep the "key" on the left side of : unchanged. - Finally send the translated .json to Sendou or make a pull request if you know how.
Things to note:
weapons.jsonandgear.jsonare auto-generated. Don't touch these.- If some language doesn't have a folder it can be added.
- Some translated
.jsonfiles 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
- Access "Shell" tab
cd /var/datacp db.sqlite3 db-copy.sqlite3wormhole send db-copy.sqlite3- On the receiver computer use the command shown.
Add a new weapon
- Add image in both .png and .avif with the correct weapon ID (
replace-img-names.tscan help) - Create new weapon ids json and weapon translation jsons using
create-weapon-json.tsscript
Add new gear gear
- If Salmon Run gear, update constant in create-gear-json.ts
npm run create-gear-json- Copy generated files from output folder to gear-ids.ts file
- Get .png from Lean's repository
- 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.
- Background info: this is caused by the line endings on your local repo not matching those with the remote repo's, which should remove the vast majority of unstaged files that appears to have no changes at all.
- Reference: https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings