The Featurewise UI shell
A web front end for featurewise services. It invokes features through each service's UI back end, shows whatever comes back, and follows the links in it. It knows nothing about any particular service, and that's enough to make one usable.
Here's a traveller's lost reports, in the lost property demo, as the shell shows them on its own:

Each service can then dress its own pages, a feature at a time, with a module of its own. The same result, dressed:

Every link is in the same place either way; only its presentation changed.
A service's module
A module is built from the service's features: an address for each query that wants one, and a renderer for each result, or each result case, worth dressing. Everything else is left to the shell.
npm install @featurewise/ui
import { featurewiseModule } from "@featurewise/ui";
const ui = featurewiseModule("lost-property", { home: "unclaimed-items" });
ui.addQuery("UnclaimedItems").address("unclaimed-items").render(unclaimedItems.result);
ui.addQuery("ItemsFoundAt").address("found-at/{Station}");
ui.addCommand("ClaimItem")
.renderCase("Claimed", claimItem.Claimed)
.renderCase("DoesntMatchReport", claimItem.DoesntMatchReport);
export default ui;
The shell is plain TypeScript with no framework, so a module can use any: the demos' are React. Modules never invoke anything themselves; they follow links, and the shell invokes them.
Getting it
- Code: github.com/ada74m/featurewise-ui, MIT licence, apart from the Featurewise name and logo
- The module builder: @featurewise/ui on npm
- Running live: the demos
- Why it works: chapters 4 and 5 of the book