Case study: Mateu in a microservices system
The problem
Section titled “The problem”In a typical microservices architecture, teams often end up with:
- a separate frontend application
- duplicated models between frontend and backend
- custom APIs for every screen
- complex synchronization between layers
This leads to slower development and higher maintenance costs.
The approach
Section titled “The approach”In this project, Mateu is used to define UI directly inside backend services.
Each service:
- owns its domain logic
- exposes its own UI routes
- defines its own screens using Mateu
Example:
@UI("/_users")@Title("Users")public class UsersHome {
@Menu UsersMenu users;}Each service defines its own menus and CRUD flows:
public class UsersMenu {
@Menu UsersCrud users;
@Menu RolesCrud roles;
@Menu PermissionsCrud permissions;}Architecture
Section titled “Architecture”- backend services communicate via gRPC
- each service exposes UI through Mateu
- frontend acts as a renderer, not as an application layer
- UI is composed from multiple services
What changed
Section titled “What changed”Instead of:
- backend + frontend + API
You now have:
- backend + UI definition (in the same place)
Benefits
Section titled “Benefits”Less duplication
Section titled “Less duplication”No need to redefine models in multiple layers.
Clear ownership
Section titled “Clear ownership”Each service owns:
- data
- logic
- UI
Simpler architecture
Section titled “Simpler architecture”No need for:
- custom APIs per screen
- frontend state synchronization
Better fit for microservices
Section titled “Better fit for microservices”UI aligns with service boundaries.
When this works best
Section titled “When this works best”- internal tools
- CRUD-heavy systems
- enterprise apps
- distributed architectures
Summary
Section titled “Summary”Mateu allows you to keep UI definition close to the backend that owns the behavior.
This reduces complexity and makes microservice-based systems easier to build and evolve.
👉 Try the demo: https://vaadin.mateu.io/fluent/use-cases/rra