This community run project was built for the C&C Remastered Collection: Tiberian Dawn game. Initially EA supported an online leaderboard @ https://cnc.community/command-and-conquer-remastered/leaderboard/tiberian-dawn that was manually reset every few months, however after the third season EA had seemingly dropped support for ladder resets for competitive quickmatch online games.
To help keep the online community alive and active I created this project for a community run leaderboard that aimed to:
- Record players elo scores using the official EA/Petroglyph API Endpoints (see DB Repo) & reset the scoring at automatically defined intervals (every x months etc.)
- Generate Leaderboard & Player Analytics based on players stats and serve these via https://tibdawn.com/ website (now deprecated - previously running via Heroku/Route53)
- Setup a brand new custom map pool - the existing quickmatch setup for this game had a pool of 7 random maps players could be assigned, this new functionality enabled auto recording of scores from players who manually setup lobbies with 8 new maps
- Setup a special OBS browser endpoint that allowed streamers to pull data from API while streaming live on Twitch to show off their most up to date scoring systems - a similar project was previously active on the official leaderboard that inspired this adaptation
After a few months of the project being live EA decided to implement an automatic elo/scoring reset on their old ladder system which marked the deprecation of this project.
As the project is now deprecated you can refer to the following sources for a snapshot of the sites initial appearance, addition of new features & community interaction:
Setup with:
Component libraries include:
For Code Styling & Linting:
- Prettier is used for code styling throughout the project.
- XO is used to enforce linting styles alongside Prettier.
DevOps:
- A pre-commit hook is setup to automatically run the code styler, linter and tests before enabling a successful push to the repo.
- In addition to the pre-commit hook basic CircleCI test integration has been setup (see CircleCI badge above for current test status Passing/Failed). This will block merges to the master branch in the event tests fails on a PR.
- A Dockerfile & Makefile are available for portable deployment.
- Google Analytics tracking enabled
Serves built react app.
Fetches leaderboard results for a specified season from our DB.
Fetches information specific to a specified player from our DB.
Fetches our top ranked players for total games played
Returns our top ranked players for a specific faction.
General health check endpoint currently in use with Uptime Robot
Used for nightbot extension
Used for obs extension
Note: there is now a dependency on a DB, the codebase for which is available here
yarn install
yarn dev # will start react app on port 3000 and express server on port 5000 by default
Not Tested
# build docker image
docker build . # or you can run the command
# run docker container and portforward port 3000
docker run -ti -p 3000:3000 <docker-image-id>
# publish docker image to docker hub
docker push <docker-repo>
Not Tested
# this will default to 'build' command
make
# this will push the image to docker hub
make push
# this will both build and publish for expediency
make deploy
Handled by ReactScripts a pre-configured version of Jest to save hassle with Babel configuration.
The main website is currently hosted on Heroku. There are two projects - one for the main website cnc-site
and a second that handles the DB updates running effectively as a cronjob cnc-db-cron
.
The cnc-site builds the project with yarn build
and serves it as yarn server
.
The cnc-db-cron is ran every 10 minutes with the yarn cron
command.
Updates pushed to the master branch will trigger an immediate deploy of the site.
DB cron updates must be manually triggered.
For a separate map making contest that was held a github pages site was hosted through this repo on GitHub pages @ https://dan-mcm.github.io/cnc-community-ladder/. Due to domain structures the Github pages codebase is maintained on the deploy-branch with source code hosted on the gh-pages branch.
For logs
heroku login
heroku logs -a cnc-site -t
heroku logs -a cnc-db-cron -t