Skip to content

jtof-dev/meleemajors.gg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

meleemajors.gg

the successor to meleemajors.com

contributing

backend

  • on the backend, we read the tournaments.json, and scrape the majority of the information needed about the tournament using start.gg's api
    • start.gg uses graphql on the backend, and bundle a nice api explorer that makes it very easy to build queries
    • from there, it just took a lot of data parsing and find-and-replacing variables in a templateCard.html

code flowchart

           ┌───────────────┐               ┌─────────────────────┐
           │               │               │                     │
           │ main function ├───► then: ───►│ copy files to site/ │
           │               │               │                     │
           └───────┬───────┘               └─────────────────────┘
                   │
                   │
                   │
                   ▼
       iterate through tournaments

          for each tournament:
                   │
                   │
                   │
                   ▼
        ┌─────────────────────┐
        │                     │
┌──────►│ scrape start.gg api ├───────┐
│       │                     │       │
│       └─────────────────────┘       │
│                                     │
│                                     │
│                                     │
│                                     │
│   ┌────────────────────────────┐    │
│   │                            │    │
└───┤ generate a tournament card │◄───┘
    │                            │
    └──────────────┬─────────────┘
                   │
                   │
                   │
                   ▼
  ┌────────────────────────────────┐
  │                                │
  │ generate calendar subscription │
  │                                │
  └────────────────────────────────┘

flowchart made using asciiflow

running locally

  • in ssg/src, you can just cargo run, but you first need to export your start.gg api key as an environmental variable
  • to simplify this, I normally run the backend using run.sh, which does the following:
export STARTGGAPI=<TOKEN>

cargo run
cargo run -- --generate

hosting

  • we use github pages to do all the work for us, as long as our website stays static
  • to set up, we registered a domain with aws route 53, verified the domain in github settings > pages > verified domains, and added the domain in the pages section of this repo
  • after everything was set up, our domain records looked like this:
type domain name content
A meleemajors.gg 185.199.108.153
A meleemajors.gg 185.199.109.153
A meleemajors.gg 185.199.110.153
A meleemajors.gg 185.199.111.153
AAAA meleemajors.gg 2606:50c0:8000::153
AAAA meleemajors.gg 2606:50c0:8001::153
AAAA meleemajors.gg 2606:50c0:8002::153
AAAA meleemajors.gg 2606:50c0:8003::153
ANAME meleemajors.gg jtof-dev.github.io
TXT challenge subdomain.meleemajors.gg verification code
CNAME www.meleemajors.gg jtof-dev.github.io

analytics

  • we use umami for basic analytics, like daily site views and how visitors interact with the website. while this could be useful improving the website, this is mostly because we want to know how much the website is getting used
  • these analytics are completely anonymous (at least to us), and just let us dig around with how the website actually gets used

meleemajors.com

  • a sample copy of meleemajors.com scraped from the wayback machine can be found here, taken from the wayback machine

todo

  • add automatic mailchimp email generation
  • add emails to mailchimp calendar using their api