Giter VIP home page Giter VIP logo

server's Introduction

Server

Libraries.io dependency status for GitHub repo CI status Checks status Uptime Robot status

This is RD2L's backend and website.

Installation

First, install the project's dependencies.

npm install

Next, get an api key from https://steamcommunity.com/dev/apikey. Either set this as an environment variable or a variable in a .env file - name must be STEAM_API_KEY.

Here's a template with example values for a complete .env file:

POSTGRES_USER='postgres'
POSTGRES_PASSWORD='postgres'
POSTGRES_DB='seal'
POSTGRES_HOST='localhost'
POSTGRES_PORT='5432'
PORT='80'
HTTPS_PORT='443'
SECRET='random characters'
STEAM_API_KEY='get from https://steamcommunity.com/dev/apikey'

For HTTPS configuration, include the following entries:

SSL_KEY='path/to/key.pem'
SSL_CERT='path/to/cert.pem'
SSL_CA='path/to/ca.pem'

Steam bot support can be activated by providing the following:

STEAM_BOT_USERNAME='steam_username'
STEAM_BOT_PASSWORD='steam_password'

Auth requests can be forwarded by providing:

WEBSITE_URL='http://return-to-website.com'

Full database configuration can be configured using:

POSTGRES_USER='postgres'
POSTGRES_PASSWORD='postgres'
POSTGRES_DB='seal'
POSTGRES_HOST='localhost'
POSTGRES_PORT='5432'
POSTGRES_POOL_MAX='10'
POSTGRES_TIMEOUT='30000'

Running

To run locally:

npm start

To run in docker:

make build
make run

Running in docker requires environment variables, not .env variables. Additionally, and unsurprisingly, it requires docker to be installed and running.

Project structure

├── src
│   ├── api
│   │   └── *.js       # API-oriented controllers
│   ├── assets
│   │   └── **/*       # Static files (including images, markdown, etc.)
│   ├── lib
│   │   └── *.js       # Common utilities/shared libraries
│   ├── migrations
│   │   └── *.sql      # Database migration files run at startup in order starting from 001.sql
│   ├── pages
│   │   ├── masters
│   │   │   ├── *.js   # Masters-specific controllers
│   │   └── *.js       # Page content controllers
│   ├── repos
│   │   └── *.js       # Database model repositories
│   ├── templates
│   │   └── **/*.pug   # Template files structure as a hierarchical tree
├── Dockerfile
├── docker-compose.yml # Development-oriented quickstart compose file
├── Makefile           # Command wrapper
├── package.json
└── package-lock.json

server's People

Contributors

aeosynth avatar bl00dninjar avatar dambrisco avatar dependabot[bot] avatar kabobrocks avatar kstigs avatar ocket8888 avatar philkjacobs avatar tristan-gill avatar vuvuzelavirtuoso avatar whoophee avatar yungbuck81 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

server's Issues

Duplicate IP Finding

It would be nice to have a way to see all accounts / signups from the same IP address. It helps find smurfs, alts, and banned players! 💯

Change default division page

With the new navigation, the default division page is mostly redundant, and we could make a different page such as standings the default. The 'useful information' could be in a separate page, folded into another page, or embedded into each page.

Look into fixing draft sheet for this season and next season

Currently the issue is the rules for standins state that you use draft rank for standin (which is important for people who were drafted, for instance), however this also means that it does not matter if someone ganks ranks after draft. However the website currently auto-updates ranks, which can lead to confusion on whether someone is a viable standin. Also, there is a draft sheet supplied, but it includes the updated ranks only, and not the "official" draft sheet that was used to draft players.

Solutions:

  1. Do not update ranks on website. Instead, once the draft happens or ranks are solidified for the draft, lock all ranks for players. This would need to be manually adjusted for this season since everything has already been auto-updated.

  2. Add an option for people to be able to reach the "official" draft sheet on each division page. There can still be the generated sheet but it should be clear that it is "unofficial" or otherwise stated that it does not portray correct draft ranks. Ideally just have a button that says "Official Draft Sheet" and links to the draft doc the division used. This of course would have to be manually set to each division's individual sheet.

Mark Winners

In the player profile page under "teams played on" put winner and playoff maker in brackets next to relevant teams. For the sake of scouting next season.

show teams' cumulative record on the team page

Right now if you go to a team's page the only way of knowing their record is by tallying up their wins and losses from the displayed series. It'd be a nice QoL addition to be able to see their cumulative record at the top of the page or above the list of series played.

Matchup/standing navigation

Badger - Today at 5:20 PM
also at what point will it be possible to click through the website for a given weeks matchups?
currently you either have to go through the discord announcements or manually change the url

Add scrim week support

@kabobrocks so I just realized we've actually got no way to generate a set of random matchups. We'll need to special case "Week 0" or something and use a deterministically generated seed similar to what's used in swiss-pairings to generate team seeds or something.

Maybe we can just sort the team ids? Need to look at how random those are.

List opponents under one column in series table on individual team pages

On the individual team pages (example) in the series table put all the opponents a team has played under one column instead of separating them by home and away team.

The home/away distinction is unnecessary and just makes it harder to read the table and see all the opponents because you have to go back and forth between two columns. Likewise, the home/away team points should just be own points vs opponent points so you can easily see the outcomes by looking at a single column and you can just sum the column to get total wins or losses.

More stuff

[3:09 PM] Diaspora: Oh yeah gofu raise good point
[3:09 PM] Diaspora: How come captain page no display rank
[3:10 PM] Diaspora: Is there also a reason why EST-SUN statement column is not wrapped
[3:10 PM] Diaspora: But EST-MON is

Consider changing division extras

Currently we have things like start time, draft sheet, discord url on the division table. We can possibly make a "Division Extras" or whatever we want to call it that has:

  • Division ID
  • Extra Name
  • Extra Display Text
  • Extra URL (optional)

This way, different divisions can have different things they want to display. It would also make displaying them on the division page a lot easier. Instead of looking for specific extras, we just grab all of their extras and throw it on. We could go a more fancy route and have "Extra Categories" that would have:

  • ID
  • Category Name

which would make the "Division Extras" look like:

  • Division ID
  • Extra Category
  • Extra Display Text
  • Extra URL

something about playoffs

would be nice to have all playoff teams on a single page, and a tally of how many teams each division still has alive. currently there's only the liquipedia page not linked to anywhere on the site.

edit: nvm playoffs are linked in footer. rest of post stands.

look into rule wording for website

"Captains are required to submit results from their matches to the Captain section of rd2l.com within 24 hours if the match was not ticketed. If matches cannot not ticketed due to an unforeseen issue, a screenshot of the score screen will suffice."

Needs to be reworded

Rd2l.com still mentioned in rules

"Captains are required to submit results from their matches to the Captain section of rd2l.com within 24 hours if the match was not ticketed. If matches cannot not ticketed due to an unforeseen issue, a screenshot of the score screen will suffice."

This seems to be old section of rules still in from when rd2l.com was in use. It should be reworded to state that results should be submitted to the discord if needed or whatever the admins believe is best course of action (another option is to dm match result to division admin for instance).

Implement smurf/ban list

Some sort of system to automatically exclude certain known accounts, saves the trouble of having to reidentify and remove them later.

look into making draftsheet.csv filename dynamic

Sasquatch - Today at 7:58 PM
suggestion: when you download a draft sheet it's named based on where you downloaded from (monday captains, sunday players)

I think it would be good and easy to add, not high effort either

Random things I think of

Can probbably get rid of number column in seasons or just name. Idk how the code works.

Then clicking on season or number column (whichever one you keep) brings you to list of divisions for that season.

Under divisions maybe just make the division clickable instead of the [view] column.

make json endpoint for league

{
"PST-SUN" : [
{
"teamName" : "TEAM NAME",
"teamId" : 1234567890, //IDK if you save this info
"wins" : 1,
"losses" : 1,
"forfeits" : 1,
"captain" : {
"name" : "NAME"
"steamId" : id64 or id3 or whatever
},
"players" : [
{
"name" : "NAME"
"steamId" : id64 or id3 or whatever
},
...rest of players...
]
},
...rest of teams...
]
..rest of divisions...
}

given by Will for Kaede

gzip static resources

Configure the server to automatically gzip all static sources (JS, CSS, images) to improve loading times

add more navigation

players/captains/standins don't have the new navigation, is this intentional? also team page should link to the team's division. maybe the top navigation bare should be rethought? the seasons page only has one link to s14 registration.

Improve signup page form layout

The signup input description notes are too small. They should also be moved from after the input to before the input under the header.

For example "Please be sure to mention other leagues/divisions you'll be participating in." should be directly under "Statement/Availability:"

"1 being least comfortable 5 being most comfortable" should be bigger and under "Comfort/preference"
image

Also for the role preference section, add the labels "least" and "most" next to each end of the 1-5 radio button groups.

add a check on registration

check to see that the steam openID = the person of the one registering (or an admin) before finishing signup

Stand-in Counter

A counter for admins (preferably on team pages) to tick up so we can keep track of stand-in use

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.