Code Monkey home page Code Monkey logo

sendou.ink's Introduction

sendou.ink

Competitive Splatoon Hub with over 20k registered users.

Selected Features

  • Map planner that lets you draw on maps and insert weapons
  • Map list generation tool
  • Win badges from tournaments, management tools for TOs
  • Calendar to find out upcoming events to play in
  • Event result reporting
  • Plus Server for top players "looking for group purposes" voting and suggestion tools.
  • User pages
  • User search
  • Form teams (featuring uploading profile and banner pictures)
  • Object Damage Calculator (how much does each weapon deal vs. different objects)
  • Build Analyzer (exact stats of your builds)
  • Add and search for videos by weapon, stage, player and more
  • Auth via Discord
  • Light and dark mode
  • Localization

Tech stack

  • React
  • Remix
  • Sqlite3
  • CSS (plain)
  • E2E tests via Playwright
  • Unit/integration tests via uvu

Screenshots


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 authentication or develop the 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:5173/admin. There press the seed button to fill the DB with test data. You can also impersonate any user (Sendou#0043 = admin).

Contributing

See CONTRIBUTING.md for more information.

Tests

db-test.sqlite3

Empty DB with the latest migration run. When creating new migrations they should also be applied+committed to this file (add it in .env and then run the migration command as normal).

Translations

Translation Progress

sendou.ink can be translated into 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!

Articles

  1. Take an existing article as a base: https://raw.githubusercontent.com/Sendouc/sendou.ink/rewrite/content/articles/in-the-zone-26-winners.md
  2. Copy and paste the contents to a text file
  3. First, edit the info section at the top:
  • "title" = title of the page
  • "date" = date when this article was written (format YYYY-MM-DD)
  • "author" = your name as you want it shown on the website
  1. Write the actual article below the second ---
  2. You can use Markdown for more advanced formatting (read https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax for more info)
  3. Name the file as you want the URL to be. For example in-the-zone-26-winners.md becomes https://sendou.ink/a/in-the-zone-26-winners
  4. Send the file to Sendou (or open a pull request if you know how)
  5. Optional: also send an image as .png if you want to show a link preview. The preferred dimensions are 1200 × 630.

API

If you want to use the API then please leave an issue explaining 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 APIs 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.
├── 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

NOTE: public/static-assets should only have files that don't change as it is cached for 1 month.

Feature folders

Feature folders contain all the code needed to make that feature happen. Some common folders include:

  • routes (same principle as Remix file system routing)
  • queries
  • components
  • core (all core logic, separated from any React details)

Some common files:

  • styles.css
  • feature-hooks.ts
  • feature-utils.ts
  • feature-constants.ts
  • feature-schemas.server.ts

Note: Currently the project is in progress to migrating this style so that's why not everything is using it yet.

Commands

Update friend code

npx tsx scripts/update-fc.ts 79237403620945920 1234-1234-1234

Add new badge to the database

npx tsx scripts/add-badge.ts fire_green "Octofin Eliteboard"

Rename display name of a badge

npx tsx scripts/rename-badge.ts 10 "New 4v4 Sundaes"

Add many badge owners

npx tsx scripts/add-badge-winners.ts 10 "750705955909664791,79237403620945920"

Converting gifs (badges) to thumbnail (.png)

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

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

Note: it only works with Node 16.

How to...

Download the production database from Render.com

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

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

Doing monthly update

  1. Fill /scripts/dicts with new data from leanny repository:
    • weapon = contents of weapon folder
    • langs = contents of language folder
    • Couple of others at the root: GearInfoClothes.json, GearInfoHead.json, GearInfoShoes.json, spl__DamageRateInfoConfig.pp__CombinationDataTableData.json, SplPlayer.game__GameParameterTable.json, WeaponInfoMain.json, WeaponInfoSpecial.json and WeaponInfoSub.json
  2. Update AVAILABLE_SR_GEAR with new SR gear & new gear bought with scales
  3. Update all CURRENT_SEASON constants
  4. Update CURRENT_PATCH constants
  5. Update PATCHES constant with the late patch + remove the oldest
  6. Update the stage list in stage-ids.ts and create-misc-json.ts. Add images from Lean's repository and avify them.
  7. npx tsx scripts/create-misc-json.ts
  8. npx tsx scripts/create-gear-json.ts
  9. npx tsx scripts/create-analyzer-json.ts 8a. Double check that no hard-coded special damages changed
  10. npx tsx scripts/create-object-dmg-json.ts
  11. Fill new weapon IDs by category to weapon-ids.ts (easy to take from the diff of English weapons.json)
  12. Get gear IDs for each slot from /output folder and update gear-ids.ts.
  13. Replace object-dmg.json with the object-dmg.json in /output folder
  14. Replace weapon-params.ts with the params.json in /output folder
  15. Delete all images inside main-weapons, main-weapons-outlined, main-weapons-outlined-2 and gear folders.
  16. Replace with images from Lean's repository.
  17. Run the npx tsx scripts/replace-img-names.ts command
  18. Run the npx tsx scripts/replace-weapon-names.ts command
  19. Run the .avif generating command in each image folder.
  20. Update manually any languages that use English gear.json and weapons.json files

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.

sendou.ink's People

Contributors

aisuzuki avatar ant-spl avatar ashbinary avatar cesaregarza avatar charakiga avatar chenyenru avatar curtgrimes avatar cyuza avatar dependabot[bot] avatar doublecookies avatar filuz avatar frederikfrajylland avatar gellneko avatar guigas7 avatar halp-pat avatar hfcred avatar inkfarer avatar katt avatar lolametro avatar nilpotential avatar remmycat avatar rmpurp avatar rofreg avatar sendouc avatar shachar700 avatar shanglinmo avatar taqm avatar telgniw avatar walavouchey avatar zenpk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sendou.ink's Issues

Social media preview

Social media preview images + texts (not even showing a picture when linked on Discord/Twitter rn)

Teams page

index.tsx

  • Create new team
  • Order teams by Team XP
  • Show countries and allow filtering by them
  • Toggle to show teams that are recruiting

join.tsx

  • If code and name correct in search params auto join team
  • Can't join if team has 10 members already
  • Can't join if already in a team
  • Show error on the page if can't join

user.tsx

  • Show team

[team].tsx

  • Captain's modal
  • Kick members
  • Transfer captain
  • Delete team
  • Edit team (bio, recruiting post, Twitter, reset invite code, name)

  • Show invite URL (captain only)
  • Avatar from Twitter
  • Bio
  • Recruiting post
  • Player cards (avatar, name, country, weapons)

  • Leave team (user only)
  • If in team fetch team data from API? (problem once joining team and redirected and page not regenerated yet)

HP hardcoded

image
I used another abbreviation for HP, it's used at points that include more than just that, but it appears as HP in spaces where only the abbreviation (with numbers) is used

Katselmointi

Katselmointi

Sivuston käytettävyys

Mitä tein

  • 28.7.2019 klo ~15:05

  • Käytin sovellusta kirjautumatta

    • Tein planin, tallensin sen png + json. Latasin planin jsonista.
    • Katsoin muiden buildeja ja rankingejä.
  • Kirjauduin

    • Lisäsin buildin, editoin sitä. Poistin sen.

Kokemus

  • README voisi sisältää enemmän kuvausta mikä palvelu on.

  • Planin teko hajoaa jos piirrät kuvaa jonka jälkeen menet muulle sivulle ja palaat plans sivulle.

  • Esimerkillinen palvelu. Löysin koko läpikäynnillä vain yhden ongelman.

Koodi

  • Tiedostot hyvin nimettyjä.

  • Frontin komponentit ehkä hieman kummallisesti kansioitu. Esimerkiksi components kansion alikansiot voisi nimetä paremmin.

  • Kaikki kolme tiedostoa BuildCollection.js, Build.js ja AbilityButtons.js alkavat samalla import matolla. Kaikki ikonit / nimet / etc voinee yhdistää toisessa tiedostossa ja hakea sen yhden tiedoston komponentteja varten.

  • Tiedoston AbilityButtons.js return näyttää myös siltä että voisit säästää rivejä käymällä listaa läpi.

  • Paikoitellen returniin on laitettu paljon logiikkaa. Esimerkiksi https://github.com/Sendouc/sendou-ink/blob/b2070fce5ccbf8df2169443ae7420a0246eaf76e/react-ui/src/components/SoloLadder/BuildTab.js on hieman ensisilmäyksellä monimutkainen loitsu "!user || user.discord_id !== userViewed.discord_id || data.searchForBuilds.length >= 100" jonka kaverina on "data.searchForBuilds.length >= 100 && user && user.discord_id === userViewed.discord_id".

  • Toisaalta taas samassa tiedostossa seuraavalla rivillä showForm on selkeä.

  • https://github.com/Sendouc/sendou-ink/blob/b2070fce5ccbf8df2169443ae7420a0246eaf76e/index.js#L17 portti kannattaa laittaa riippumaan samassa tiedostossa sijaitsevasta PORTista.

Kokonaisuus

  • Ongelmia piti hakemalla hakea, jatka samaan malliin!

  • Työstä huomaa aiheen olevan lähellä tekijää ja laatu on myös sen mukaista.

🦑 / 🚸

Ancho-V Games

Is Ancho-V Games missing from the map pool in the planner?

Chakra UI 1.0.

When it releases for real or at least wait till rc4 since rc3 seems broken for color mode.

Monorepo

Npm 7? Yarn Workspaces? Lerna?

Goal is to have one common code base for the Discord bot (Lohi), Next.JS and upcoming React Native app.

Code sharing should be effortless. E.g. with hooks I should just be able to change the UI between web and native and still be using the same data fetching and other logic.

New calendar page

Implement the new calendar page look (this already exists somewhere)

Issue when refreshing the Map Planner

If the map/mode is kept unchanged from Reef SZ and the map is drawn on, in the event the page is refreshed then the image fails to load. However it is still possible to draw on it:

image

Ability buttons allow dragging

Currently can only click. Would be intuitive to also drag abilities to slots. Check how it works on https://loadout.ink/en-us/

Builds can be made on user page and build analyzer so this should work on both.

Bonus: Maybe hold Shift to duplicate? So while hold switch and drag from ability already selected it stays in that slot but multiplies and you can drag it to another slot.

Plus Page: FAQ

FAQ for people to explain the whole thing. Needed when it goes public.

Update maplist queries to take the name of the maplist as an argument

As of right now, the maplist queries send more data than nessecary.

Change the maplist query to take an optional name: argument to return the specific maplist.
image

Additionally, add an optional index: argument to return a maplist at a specific index.

For backwards compatibility, you can also just add a new query called maplist (vs maplists) to return a specific maplist.

some minor stats for analyzer

like how much damage does a weapon do, how much endlag does it have or similar, as example if I'd like to know how much damage the Tenta Brella shield does upon collision, or what the base HP for the regular brella is, the endlag on blasters or sloshers and stuff like that, maybe not even the endlag things but I was mainly concerned about weapontraits like brella HP or brella damage right now
it's mainly invariable constants, but I think it'd be a good addition if you don't want to rely on wikis so much

More freedom for posters in calendar

https://twitter.com/TobyBaratta/status/1278954990317367297
Mainly referring to this, since it's uneditable after you posted it you can't include a registration link before opening registration
My idea is to give post rights to a permitted group (people who ask for it) so you can monitor it easily while still leaving the original posters freedom to edit the messages

Not sure how feasible it is to implement this (especially with the discord-posts), but the Calendar is the imo most underappreciated feature of sendou.ink

Next.js

Could consider moving to Next.js when the localization update comes. In the meanwhile doing some things that would make it easier.

Wording inconsistency issue

On the FA page, notice how the phrase Filter by ... is used three times. The first two filters show FA's who fit that criteria, implying Filter by includes the criteria and excludes those not matching criteria. Conversely, the Filter by weapon dropdown (which is beautiful btw) works the opposite.

Intuitively, one would suspect that this filter would work in the same way as the first two - I did as I was searching for a Bamboo main and thought it was odd that they all disappeared. I'd argue this type of behaviour is more intuitive and useful, since inclusivity is more important when looking for a teammate - you'd need to really hate a weapon to purposefully exclude it.

I'd also argue that the matching feature should be more obvious - if I get a like I should be able to see who it is. Paginating through ~296 FA's can be such a teasing guessing game. The reason it works with dating apps is because you're presented the matches in a gamified format.

And finally, your code quality is very good! I wish my coworkers kept their code this clean. :shipit:

From a fellow software engineer who focuses on UX :) if you'd like to dm to discuss, you can find me at drew#6949.

[REQ] FA search functionality

Just a quality-of-life thing that would be nice to have. LUTI divs, timezones, XP, etc. are all hard to filter by, and it’s hard to search up someone’s username if you want to see their FA post.

[Request] Was this build helpful? Hebrew translation and Clash.

Was this build helpful? (QoL improvement)
Something to make builds have a bit of a feedback would be to add counter of how many players that build helped them. (Like in articles or answers for technical support that ask in the end if the answer was helpful or not. could be anonymus, could be yes or no question, could be just counter or could be just how many people saw your build. Not something crucial but suggestion nonetheless.

Hebrew translation
I can help with trasnlating sendou.ink to Hebrew. I see the site has been translated to languages that Splatoon 2 does not support in translations to them so I'm offering my help with translating to another language. Just let me know what I need to do and I'll gladly help with the translations.

Clash Blaster
Something really minor. The clash blaster in the search bar and in map planner appears after Rapid pro deco. I assume you took it from Inkipedia which I put it there by accident. The order that appears in the game that is sorted by main is an order that usually shows from short to long range and then unique mechanic (like the blasters, burst fire, sloshers for example). The correct order of clash is actually after the Grim Blaster.
https://splatoon2.ink/data/locale/en.json

Kind regards,
Shahar

Free agents page: New system / style

Take new system (don't show old FA's and ask people to refresh their FA'ness) and some UI changes from the UI rework branch

Some ideas:

  • If FA post is 2 weeks old hide it automatically and have a modal show "still FA yes/no"?

- [ ] Allow adding endorsements and deleted by the endorser or FA

  • Direct link FA post - via query string allow focusing on one fa post -> if found show on the top highlighted. Also could be useful when clicking matched FA

  • FA card redesign (table?)

- [ ] More visual filter options (pie charts for roles e.g.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.