I joined a new team at work, and figured it’d be fun to build something that uses their tech stack (java jersey/react), and thus DarkChess was born.
I love Chess, I used to play on the chess team in high school and I was president of the Chess club back in college. It’s a fun game, but it’s a perfect information game meaning everyone has the exact same amount of information. Which is good, but it’d be fun if part of the game was to learn information.
And that’s what DarkChess is. In Darkchess you can only “see” pieces if they are in your capture zone.
This brings a fun element to the game where you have to use pieces to scout where the enemy is located. It also allows you to be sneaky with assassinations, and leverage high visibility pieces and open lanes much more.
I built a little story mode with a series of challenges, give it a try:
I haven’t built a Java app in awhile, but it was fun to build one from scratch (using vscode too, no eclipse magic).
My personal opinions on the matter:
- Maven was a real life saver for managing dependencies and the build chain
- JUnit was simple enough for testing, I would of liked to learn more about cucumber, maybe next project
- No surprise, but the chess engine I built had some interesting gotchas that were thankfully caught by unit tests
- Morphia for MongoDB was interesting, (not sure if I’m using it correctly) GameDatastore.java
- Unfortunately there was some issues with serializing a 2-dimension array. Had to write some pre-post serialization code that was a tiny bit frustrating
- Jersey is very cool. I love using decorators for tagging function routes. Keeping the route/method/function in one spot is very nifty instead of having to declare the route<->function binding in a routes.js or something similar.
- The react documentation is amazing! https://reactjs.org/docs/hello-world.html
- It’s so simple, and a fun read. After reading the 12 different steps I felt like I knew react decently well (I have a background in angularjs)
- react-router-v4 was very confusing and frustrating for me (specially with typescript). Not being able to say “go to this state” everywhere unless it was specifically defined within the <HashRouter>. I def missed angular’s dependency injection and $state.
- But again, I was probably just using it wrong
- ‘create-react-app’ was pretty nify for building production ready minimized builds. no more messing around with gulp files or googles minimizer.
- I went full into AWS for my CI/CD pipeline
- Dependencies suck, so I build fat jars (maven shader), which means they just include the dependencies.
- DNS entry through route53 to an ALIAS ALB infront of the ec2’s. (stateless thanks to MongoDB, so easy to scale).
- Logs are sent to Cloudwatch using the aws cloudlog agent. It was a little weird to setup, but it works
- The service is run in an init.d/ script with nohup
- I’ve had 0 outages so far! (knock on wood)
Overall it was a very fun project. Learned a lot about fully setting up a java project.
Questions/comments/conseling/concerns? Always feel free to reach out 🙂 firstname.lastname@example.org