I came upon this while making a 2048 clone as a learning project and realized that I wanted some form of leaderboard for the game. I’ve since released the game:
During game development I had planned on using an existing web service called dreamlo, but as I was testing everything I realized that dreamlo requires a donation to enable HTTPS. HTTPS is critical, since I’m hosting the web based game on an HTTPS site, and making non secure REST calls while on an HTTPS site is a CORS violation and is blocked by default on all browsers.
While I was happy with the idea of donating, I realized that I already have a Linode instance that could handle a small service like this, I had some time to try to put something together myself, and I liked the idea of doing a simple project with SQL as I had not done very much with SQL and it seemed like a good learning opportunity.
I have already made the bulk of the service (made about a week and a half ago), and while making it I committed some fake usernames I was using (I usually use my own git server, not GitHub, so I wasn’t terribly worried about that). In the interest of not making even fake usernames available to the public, I created a new repo with the code and committed it to GitHub for everyone to see:
The service currently utilizes REST for all queries, and stores data in a MySQL based database. It is a Java application, and uses JDBC to connect to the database. I used the JavaSpark framework to implement REST functionality as it is extremely easy to use.
I built this project so that it could support any number of leaderboards, not just what I needed for this project. My goal for the rest of Devember then is to expand on this project, document what I have a little better, and make a web front end that developers could use to create a leaderboard and build this functionality into their own games.