An imaginary pizza tax service showcasing how to build a frontend microservice using play-fsm.
If you are interested in starting a brand-new microservice you can generate it quickly from template-play-frontend-fsm.g8.
- 00 start with an empty repository
- 01 create an initial journey model
- 02 further elaborate the model
- 03 explore alternative model designs
- 04 add state persistence layer
- 05 start building a controller and views
The aim of the workshop is to build step-by-step a frontend microservice implementing the user flow presented on the chart:
┌─────────┐
│ Start │
└────┬────┘
│
▼
HaveYouBeenHungryRecently
│
┌────no────┴────yes───┐
│ ▼
│ WhatYouDidToAddressHunger
│ │
│ ┌──other────────────┴───┐
│ │ │
▼ ▼ HungerSolution
DidYouOrderPizzaAnyway == OrderPizza
│ │
├───yes─────────────────┐ │
│ ▼ ▼
│ HowManyPizzasDidYouOrder
│ │
no ┌───L───┴───H────┐
│ │ ▼
│ │ AreYouEligibleForSpecialAllowance
│ │ │
│ │ ┌──other──┴─ITWorker──┐
│ │ │ ▼
│ │ │ WhatIsYourITRole
│ │ │ │
│ │ │ ┌──────────────┘
│ │ │ │
│ ▼ ▼ ▼
│ QuestionnaireSummary
│ │ ┌─────────────┐
│ ├──calculate───►│ Backend API │
│ │ └─────────────┘
┌─────────────▼────────┐ ┌──────────▼─────────────┐
│NotEligibleForPizzaTax│ │TaxStatementConfirmation│
└──────────────────────┘ └────────────────────────┘
.
├── project
│ ├── build.properties
│ └── plugins.sbt
├── LICENSE
├── README.md
├── build.sbt
└── repository.yaml
sbt test it:test
sbt clean coverageOn test it:test coverageReport
sm --start AWESOME_STUBS AWESOME_STUBS_FRONTEND ASSETS_FRONTEND
sbt run
It should then be listening on port 12345
browse http://localhost:12345/pay-as-you-eat
This code is open source software licensed under the Apache 2.0 License