Quickstart: YAML only
A Mateu app whose UI is data: a few YAML files under src/main/resources/specs/ui/. You write
no code — the only Java is the Spring Boot main class the generator gives you, and the static
flavour has none at all.
You need Java 21 and Maven 3.9+.
1. Create the project
Section titled “1. Create the project”Pick one front door (all of them generate the same project):
-
IntelliJ IDEA: File › New › Project… › Mateu, authoring YAML only, served by a backend.
-
VS Code: command palette › Mateu: New Project… › YAML only, served by a backend.
-
Maven:
Terminal window mvn archetype:generate -DarchetypeGroupId=io.mateu -DarchetypeArtifactId=mateu-archetype \-DarchetypeVersion=3.0-beta.57 -DgroupId=com.acme -DartifactId=my-app -Dauthoring=yaml
It is the starters/yaml
project of the repository, which CI builds and boots on every change.
2. Run it
Section titled “2. Run it”cd my-appmvn spring-boot:runOpen http://localhost:8080: an app shell with a menu (Home, Products) opening on a home page, whose Browse products button leads to a listing — search, a status filter, sorting and paging — over sample data.
What you got
Section titled “What you got”my-app/├── pom.xml Spring Boot + mateu-mvc + the renderer├── AGENTS.md, CLAUDE.md guidance for AI assistants└── src/main/ ├── java/…/Application.java boots the server — nothing else └── resources/specs/ui/ ├── app.ui.yaml the mount: this app at "/", its routes, its home (`home: home`) ├── routes.yaml each route bound to a definition ├── app.yaml the app shell: title and menu ├── home.yaml a page: the home, with a call to action to the products ├── products.yaml a page: the listing ├── sources.yaml the REST endpoints, named once, with sample data └── project.yaml project settings (the renderer)The home page is a hero whose button navigates — its actionable is a RouteLink, so there is
nothing behind it to run:
pageType: landingtype: VerticalLayoutfullWidth: truehorizontalAlignment: STRETCHcontent: - type: HeroSection title: My app subtitle: Every screen here is declared as data, in src/main/resources/specs/ui. centered: true content: - type: Button label: Browse products buttonStyle: primary actionable: type: RouteLink route: productsThe listing reads its rows from a named source:
pageType: collectiontype: Listingtitle: Productssearchable: truerowsSource: ref: productscolumns: - {type: GridColumn, id: id, label: Id, identifier: true} - {type: GridColumn, id: name, label: Name} - {type: GridColumn, id: status, label: Status, dataType: status}sources: - name: products source: url: /api/products sample: - {id: P-001, name: Espresso machine, price: 249.0, status: AVAILABLE}Until your API exists the source answers with its sample: — the generated main class turns
sample mode on.
Point url at your API and run with -Dmateu.sources.mock=false to go live.
3. Add a screen
Section titled “3. Add a screen”A screen is a definition file plus a route and, if it belongs in the menu, a menu entry:
-
Create
specs/ui/orders.yaml— in IntelliJ New › Mateu › Page… or in VS Code Mateu: New File… start it from a page template, then edit it in the visual editor. -
Add the route in
routes.yaml(Add Route… in both IDEs):- route: orderslayout: orders.yaml -
Add it to the menu in
app.yaml:- type: RouteLinklabel: Ordersroute: orders
Every file carries a $schema line, so both IDEs validate and complete it.
4. Open a record and create one
Section titled “4. Open a record and create one”The listing becomes a CRUD with two more pages and three more lines: a row route opens a record page that loads the row by its id, and a New button leads to a form whose save is a REST call.
-
In
products.yaml, make the rows open their record and add the button:rowRoute: products/${row.id}toolbar:- {type: Button, label: New, buttonStyle: primary, actionable: {type: RouteLink, route: products/new}} -
In
routes.yaml, the two pages. The record route’s:idseeds the page state, so theproductsource below reads it as${state.id};data:names the source the page loads on entry:- route: products/newlayout: product-new.yaml- route: products/:idlayout: product.yamldata: product -
In
sources.yaml, the two endpoints (with sample answers until the API exists):- name: productsource:url: /api/products/${state.id}sample: {id: P-001, name: Espresso machine, price: 249.0, status: AVAILABLE}- name: product-createsource:url: /api/productsmethod: POSTbody: '{"id": "${state.id}", "name": "${state.name}", "price": ${state.price}}'sample: {ok: true} -
product.yaml, the record — read-only fields named like the response’s keys. A REST value arrives raw, so the page says what it is, as the listing’s columns do:stereotype: moneyformats the price, anddataType: statuswith itsoptionsshowsAVAILABLEas an “Available” chip:type: Formtitle: ${state.name}subtitle: Producttoolbar:- {type: Button, actionId: backToList, label: Back to products, actionable: {type: RouteLink, route: products}}content:- type: FormLayoutcontent:- {type: FormField, id: id, label: Id, readOnly: true}- {type: FormField, id: name, label: Name, readOnly: true}- {type: FormField, id: price, label: Price, stereotype: money, readOnly: true}- type: FormFieldid: statuslabel: StatusdataType: statusreadOnly: trueoptions:- {value: AVAILABLE, label: Available}- {value: OUT_OF_STOCK, label: Out of stock} -
product-new.yaml, the form. Its Save runs thecreateaction, which the page declares underactions:— a REST call, then a message and back to the listing:type: Formtitle: New productconfirmOnNavigationIfDirty: truetoolbar:- {type: Button, label: Cancel, actionable: {type: RouteLink, route: products}}- {type: Button, label: Save, buttonStyle: primary, actionId: create}content:- type: FormLayoutcontent:- {type: FormField, id: id, label: Id, dataType: string, required: true}- {type: FormField, id: name, label: Name, dataType: string, required: true}- {type: FormField, id: price, label: Price, dataType: number}actions:- id: createvalidationRequired: truerestAction:source: {ref: product-create}successMessage: Product createdsuccessRoute: products
Restart (or rebuild) and click a row, then New. In sample mode two things are expected: every
record shows the same sample (a sample: is one fixed response, whatever ${state.id} is), and
a save shows Product created without storing anything. Point the sources at your API to see real
records. Editing and deleting are more actions of the same kind (method: PUT / DELETE on a
source) — see Writing from YAML.
No backend at all: the static flavour
Section titled “No backend at all: the static flavour”Choose YAML only, static (no backend) instead (-Dauthoring=static) and the same specs/ui
is bundled at build time into plain files:
mvn mateu-bundle:dev # http://localhost:3000, rebuilt and reloaded on every savemvn package # → target/mateu-bundle/: index.html, manifest.json, assets/npx serve -s target/mateu-bundle # preview the finished bundle at http://localhost:3000mateu-bundle:dev keeps serving the last good bundle when a save breaks the build, and
-Dmateu.dev.liveReload=false turns the page reload off (the rebuilds go on). See
Develop with live reload.
Deploy target/mateu-bundle/ to any static host with an SPA fallback. The browser calls the APIs
named in sources.yaml itself, so they must allow your site’s origin (CORS); .mvn/maven.config
ships the sample data (-Dmateu.bundle.mock=true) until they exist. The build fails if a screen
still needs a server. See A 100 % static UI.
- Route registry — routes, parameters, nested routes.
- REST source catalogue — endpoints, field mapping, writes, sample data.
- The YAML app shell — menus, home route, header actions.
- Need behaviour on the server for a screen? Bind a Java view model to its route
(
viewModel:inroutes.yaml) — the Code + YAML flavour starts that way.