Competitive Splatoon Platform
Go to file
2021-05-09 22:24:44 +03:00
.github Re-enable GitHub Actions (#369) 2021-04-08 01:04:37 +03:00
components Hide build reset button if build empty 2021-05-05 21:59:31 +03:00
cypress Fix Plus Server test 2021-04-23 11:54:16 +03:00
hooks Disable edit vote button when mutation loading 2021-04-23 09:43:36 +03:00
locale edit about 2021-04-06 13:41:11 +03:00
pages Trim custom url before saving to DB 2021-05-08 17:59:01 +03:00
prisma Include wpn json script from the old branch 2021-05-09 22:24:44 +03:00
public Readd links SR guide and Overfishing Discord links 2021-05-05 21:34:22 +03:00
routers Ladder initial with FAQ (#443) 2021-04-26 15:18:27 +03:00
services Order weapons by XP if same count in X Trends 2021-05-09 20:48:05 +03:00
utils Add link to Kunder guide 2021-05-04 00:41:10 +03:00
.babelrc lingui initial 2020-11-04 03:09:57 +02:00
.env update readme! 2020-12-02 19:57:54 +02:00
.gitignore Include wpn json script from the old branch 2021-05-09 22:24:44 +03:00
.prettierignore Re-enable GitHub Actions (#369) 2021-04-08 01:04:37 +03:00
cypress.json cypress mock login 2021-02-25 13:28:58 +02:00
lingui.config.js ex clean patrons + plus 2021-03-09 15:08:15 +02:00
next-env.d.ts fix type errors 2020-11-18 13:57:41 +02:00
next.config.js switch to webpack5 2021-04-02 11:51:11 +03:00
package-lock.json ColorPicker use react-color's CirclePicker 2021-05-05 21:11:28 +03:00
package.json ColorPicker use react-color's CirclePicker 2021-05-05 21:11:28 +03:00
README.md run prettier:format in the project 2021-04-02 00:35:58 +03:00
theme.ts borderColor fix (#355) 2021-04-03 23:55:58 +03:00
tsconfig.json crash fixes 2021-01-30 13:36:39 +02:00

Discord Server

Goal of sendou.ink is to provide useful tools and resources for the Splatoon community.

Live version: https://sendou.ink/

Technologies used

  • React (via Next.JS)
  • TypeScript
  • Node.js
  • PostgreSQL (via Prisma 2)

A few of the features

🐙 Choose between light and dark mode

🦑 Planner tool where you can draw on any map in the game to conveniently make up game plans

🐙 Calendar that collects together all the events happening in the community

🦑 Users can make an account and submit their builds and browse builds made by others

🐙 It is possible to submit yourself as "free agent". If two FA's like each other they are notified and a new team can be founded

🦑 X Rank Top 500 results can be browsed through far more conveniently than on the official app

🐙 X Rank Top 500 leaderboards to compare yourself against other players

🦑 Form your own team, recruit players and make a profile

🐙 Build analyzer that reveals way more detailed information about builds than the game does

🦑 Salmon Run leaderboards featuring some of the best records

🐙 The most comprehensive link collection in the community

Setting up the project locally

Access pages that don't need database access

With the following steps you can access a few pages that don't need a database. For example: home page (/), build analyzer (/analyzer) and map planner (/plans)

  1. Clone the project
  2. Run npm i to install dependencies
  3. Run npm run compile to compile translation files.
  4. Run npm run dev to start the development server at http://localhost:3000/. (To stop the server at any time, type Ctrl+C.)

If you do not intend to perform any additional setup steps, you will also need to create an empty list of patrons in utils/data/patrons.json:

[]

Access rest of the pages

In addition to the steps above the steps below enable access to rest of the pages.

  1. Create a file called .env in the prisma folder. In it you need an environmental variable called DATABASE_URL that contains the URL to a running PostgreSQL database. For example mine looks like this while developing:
DATABASE_URL=postgresql://sendou@localhost:5432

You can see Prisma's guide on how to set up a PostgreSQL database running locally for more info.

  1. Use npm run migrate to get the database formatted with the right tables.
  2. Run npm run prebuild to generate a few necessary JSON configuration files.
  3. Seed some example data in the database by running npm run seed. (This seed data is incomplete see issue #197 if you would like to improve the seed data!)

Enable logging in

In addition to the steps above the steps below enable logging in.

  1. Create a file called .env.local in the root folder. In it you need following variables:
DISCORD_CLIENT_ID="<your Discord client ID>"
DISCORD_CLIENT_SECRET="<your Discord client secret>"
JWT_SECRET="<a long, cryptographically random string>"

a) Go to https://discord.com/developers/applications
b) Select "New Application"
c) Go to your newly generated application
d) On the "General Information" tab both "CLIENT ID" and "CLIENT SECRET" can be found.
e) On the "OAuth2" tab add http://localhost:3000/api/auth/callback/discord in the list of redirects.

For JWT_SECRET, use a long, cryptographically random string. You can use node to generate such a string as follows:

node -e "require('crypto').randomBytes(64, function(ex, buf) { console.log(buf.toString('base64')) })"

Make sure to restart your server after setting these new values (Ctrl+C + npm run dev).

Using API

If you wish to use the sendou.ink API for your own project like a Discord bot you can use the API endpoints under https://sendou.ink/api/bot (https://github.com/Sendouc/sendou.ink/tree/main/pages/api/bot) as long as you keep the load on my backend reasonable.

Using other endpoints isn't advised as I change those as I feel to suit the needs of the website. If the endpoints under /bot don't meet your use case feel free to leave an issue.

Contributing

Any kind of contributions are most welcome! If you notice a problem with the website or have a feature request then you can submit an issue for it if one doesn't already exist.

I label issues that should be the most approachable to contribute towards with the help wanted label. That doesn't mean you couldn't work on other issues just ask if you need extra help with them. If you want to work on something that isn't an issue yet then just make one first so we can discuss it before you start.

If you have any questions you can either make an issue with the label question or ask it on the Discord server (there is a channel called #💻-development for this purpose).