In this tutorial, we will look at how we can design the game flow for a rock-paper-scissors game using Serialized APIs for Event Sourcing and CQRS.

Our favorite runtime environment for applications is usually Dropwizard but since many out there prefer Spring Boot I decided to use it instead for this article. Serialized Java client works with any runtime environment or platform you use on the JVM.

Configure the Serialized project

To develop our game we will use Serialized aggregates and projections. The aggregates will store the events for each game and the projections will provide a view of each game as well as a high score list of the top winners (in the case of multiple games being run).

If you have not yet signed up to Serialized you will need to sign up for a free developer account. Once you’ve signed up and created your first project you will have an empty view of Aggregates, like this:

Empty View of Aggregates

We now need to find out API keys that are available under Settings.

Finding API Keys

Copy the access key and secret access key to a safe location. We will need these to access Serialized APIs from our backend application.

Great job! We now have an empty Serialized project. We’re now ready to start developing our game!

#java #spring boot #event sourcing #cqrs #implementing a rock-paper-scissors game using event sourcing #rock-paper-scissors game

Implementing a Rock-Paper-Scissors Game Using Event Sourcing
1.70 GEEK