examples/trivia-game-example/README.md
This app is a trivia game based on the Rick & Morty characters. The user has to select the right character based on a single image and four different options. The rules are the following:
In order for the machine to work, we need to define first the context for it. The context has all the variables needed that the machine can access and modify.
A machine is composed of states. Each state defines where the app can be, and also the logic that can be applied. If we need to move to another state, we call a transition. The transitions define the destination and origin state to where the app can go to. For example:
Here we have our initial state: questionStart. To move to another state, we use the transition user.selectAnswer. If the answer is correct we'll go to the correctAnswer state, otherwise we'll end up in the incorrectAnswer state.
You can see the complete machine for this project here
Install all required packages with:
pnpm install
Start the development server on http://localhost:5173
yarn dev