Architecture
Stratastax consists of a small number of services and an app. Each of them has one clear responsibility, and they talk to each other through well-defined APIs.
| Part | Responsibility |
|---|---|
| Engine | Owns the core data of Stratastax: users, players, games, matches, playsets, groups, communities and privacy. Every other part reads and writes that data through the engine. |
| Game catalog | Brings game data from BoardGameGeek into the engine. It imports the ranking, enriches every game, lets a person review it and then publishes it. |
| App | The Flutter app that players use, at app.stratastax.dev. It talks to the engine. |
The engine and its contract
Section titled “The engine and its contract”The engine is described by a Rialto contract, from which its code is generated (see Built on Rialto and Fabrio). The contract is split by domain, and every domain has the same files:
| File | What it describes |
|---|---|
types |
The data of the domain, such as a match and its participants. |
storage |
How that data is stored in the database. |
operations |
What clients can do, such as recording a match or finalising it. |
views |
What clients can read, shaped for the screens that show it. |
mappings |
How the types relate to the API and to the database. |
The domains are users, players, games, matches, playsets, groups, communities and privacy, plus a
shared folder with the types they have in common. Authentication and the error model are described once for the
whole contract.
The contract has two sources that it is checked against: the OpenAPI description of the platform API and the database migrations.
The APIs
Section titled “The APIs”Each service describes its API in OpenAPI. The descriptions live in
stratastax-contract, split into a file per path and component, and
every build of this site bundles them from the contract’s main branch into a single file per API:
| API | What it is for | Description |
|---|---|---|
| Platform | The engine: matches, players, games and everything around them. This is the API the app uses. | stratastax.platform.api-v1.yaml |
| Game catalog | The pipeline of the game catalog: importing, reviewing and publishing games. | stratastax.catalog.api-v1.yaml |
| I18n | The translations of the Stratastax applications. The service behind it has not been built yet. | stratastax.i18n.api-v1.yaml |
An API reference generated from the contract will take the place of these files later.
How the domain fits in
Section titled “How the domain fits in”The domain model under Design describes the same aggregates from the point of view of the product: what they mean and which rules they follow. The contract is where those rules become precise enough to generate code from.