This is an online service for managing the SpyParty Competitive League (SCL). This repo is the backend REST service for a frontend (not written by me) to interact with: upload completed games, retrieve lists of games, and get player standings. There is also an endpoint for the draft tool (the SpyPartyDraft repo) to interact with and post draft information so this code can link up map drafts to matches.
This project is built in Scala on the Scalatra web framework. jOOQ is used for database access, HikariCP is used for connection pooling (which is admitedly overkill for a small-scale project like this), Typesafe Config is used for configuration file reading (with an AWS Key Management Service layer I built on top for storing secure data).
I used my previous work in reverse engineering the SpyParty replay format (with an assist by Chris Hecker, the SpyParty dev) to build this system. By design, there is no authentication here. Player names are stored in the SpyParty replay themselves, so we can use that information to look up match data in the database. All of the code for parsing is located in the com.lthummus.sclmanager.parsing
package, the main entry point for parsing an indivdual file is the fromInputStream
function in the file Replay.scala
. Note that this code makes extensive use of scalaz disjunctions (the \/
class).
While SclManager has been battle-tested in Season 3 of the SpyParty Competitive League, there are some things I would like to do better.
- Add a stats page for interesting statistics gathered throughout the tournament.
- Automatic creation of playoff/demotion matches. Right now their creation is manual.
- Cleanup API and database calls. There's definitely some optimizations that can be made (especially on the db), but since the tournament is small (for now), they weren't high priority.
- Build an admin UI for the tournament administrators. Right now, everything is mostly done by hand.
- Clean up some mismatched terminology. This is mostly caused because I did the db design first, forgetting that
match
is a reserved word in Scala. You'll see things referred to as a "match" in some places, and a "bout" in others. Same thing happened withtype
Everything in here was made for either initializing the database for the season, for modifying a large number of matches (one player in a league dropped out and we almost completely re-arranged the schedule), or some other one-time purpose.
- aforgottentune -- Author of the front-end
- krazycaley, catnip -- SCL Administrators
- Chris Hecker -- small assist with the SpyParty replay format, making the game SpyParty