Demo Application Sources Files
Let us use TicTacToe game to demonstrate the suggested 'React Microclient Architecture'. To show possible communication patterns with the backend, the game contains three additional actions:
1. After every user step, a forecast of the game result is fetched from the backend, based on the statistics of the saved games.
2. After a game has finished with one of the three possible results, the result of the game, the board and the individual steps can be saved in the database.
3. Initially, and after a game has been saved, a list of the last games is shown next to the TicTacToe board.
TicTacToe game and the list of the last games are separate React Apps, developed in a common React project. Its structure is shown in a figure on the left side.
The structure of one possible implementation of Java 'Backend For Frontend (BfF)' , which handles the REST requests, is shown in the figure on the right side.
The BfF Project works as proxy, it merely forwards the requests to a full scope backend with the database infrastructure. The backend project is out of scope in the current presentation.
Clicking on one of the figures you proceed the sources implementing the described functionality.