There are three projects in this repository:
- Backend: Provides a REST API and accumulates results of a simulation.
- Simulation Service: Simulates games and emits goal events.
- Frontend: The user interface that interacts with the backend.
To start the docker demo, run the following command in the root directory:
yarn demo
Then navigate to http://localhost:3000.
To run docker tests for the backend and simulation service, run:
yarn test
To start the demo locally without Docker:
-
Install packages for all three projects
yarn setup
-
Start the projects
yarn dev
-
Navigate to http://localhost:3000.
At first, I misunderstood the task and implemented simulating games independently. I guessed that real simulations can be heavy processes and that all three simulations can be run on different machines. When writing this readme I realized the mistake and fixed the behavior to emit one goal per 10 seconds for all three games but lost possible parallelism.