The POS UI Can Suggest. The Server Has to Decide.
A lesson from Servora: if a rule affects money, permissions or operational state, the browser should never be the final authority.
Key takeaways
Fast client-side feedback is useful, but it is still only a preview.
Authorization and final pricing belong at the API boundary.
A clear ownership split makes every frontend simpler.
A small button is not a small rule
“Add to order” touches more state than the component can see.
The button may know the selected item and the price currently shown on screen. It does not necessarily know that a schedule changed, a modifier became unavailable, a promotion expired or the user lost a permission after the page loaded.
That is why I treat the client as the place where intent is collected, not where the final business result is declared.
The split that worked
Keep the UI quick, then validate again on the server.
The frontend still does useful work. It can calculate a preview, disable obviously invalid actions and explain why something is unavailable. That makes the product feel responsive.
When the request reaches the API, the important parts are checked again using current branch, menu, role and order context. The server then commits the result that every other surface can trust.
- Client: selection, feedback and explanation.
- Shared contracts: request and response shape.
- Server: permission, pricing, availability and state transition.
- Realtime: publish the committed state to the other apps.
Fast client-side feedback is useful, but it is still only a preview.
Permissions
Not rendering a button is not authorization.
I still hide controls that a user cannot use because that is better UX. But I do not treat that as the security boundary.
The API checks the capability as well. That covers direct API calls, stale tabs and cases where a role changes while the user still has an old screen open.
The UI should explain permissions. The API should enforce them.
Fast client-side feedback is useful, but it is still only a preview.
What changed for the frontend
Central authority removed a surprising amount of frontend complexity.
Once pricing, availability and permissions had a clear owner, the different Servora apps stopped needing private copies of critical rules.
The clients still have plenty of product-specific behavior, but they no longer need to pretend they are the source of truth for the parts that can affect money or restaurant operations.
Fast client-side feedback is useful, but it is still only a preview.