Technical document

Domain Boundaries of Laravel API and React Frontend

We will organize a design that does not mix UI concerns and domain logic in business applications combining Laravel API and React frontend.
Architecture / Laravel~10 minPublication Date September 22, 2026Update date September 22, 2026
Domain Boundaries of Laravel API and React Frontend

Summary

Key points of this document

  • Where are the design challenges?
  • How to define boundaries
  • Details that matter in implementation

Overview

In a Laravel and React combination, even if you intend to separate the backend and frontend, UI concerns tend to creep into API design. To make it robust against changes, an API design aware of domain boundaries is necessary. The essence of separating Laravel and React is not the division of labor between backend and frontend, but deciding where business rules should reside.

Where are the design challenges?

Continuously adding items required by the screen directly to the API response results in a huge endpoint dedicated to a specific screen. Conversely, if you only provide CRUD operations per DB table, the frontend will end up assembling business rules.

React can flexibly assemble states and displays, but business state transitions and permissions cannot be entrusted to the client. If Laravel exposes Eloquent models as is, internal structure changes will lead to API breakage.

In a Laravel API and React frontend configuration, there are more processes that are easy to implement on either side. If input validation, permission display, status changes, and list filters are pushed too much to the screen side, rules will become scattered when API usage paths increase.

How to define boundaries

APIs are divided into roles such as list reference, detail reference, business operations, and auxiliary master data acquisition. The React side receives screen-specific DTOs, and update operations only accept necessary inputs as commands. State transitions are aggregated in Laravel's service layer or actions.

Boundaries become easier to organize if you consider confirmed business states on the Laravel side and unconfirmed operational states on the React side. React handles values being input, sorting, filtering, and optimistic display, while Laravel is responsible for validation on save, permissions, state transitions, and audit logs.

Details that matter in implementation

In Laravel, input validation is done with Request classes, and responses are formatted with Resources or DTOs. On the React side, API response types are converted to screen states, and temporary form states are separated from saved states. Errors are categorized into field errors, permission errors, and state conflicts.

In Laravel, separate input and use cases with Form Request or Action classes, and avoid directly JSONifying Eloquent models. On the React side, convert API DTOs to screen models and map form schemas to server errors.

  • Implement state transitions as permission rules on the API side, not as frontend button displays.
  • List APIs should explicitly define search conditions, sorting, and paging, avoiding implicit filters on the screen side.
  • API errors are "field""errors" and "global""errors" should be separated, and React should control their display position.

Observing how things break

During validation, we check not only normal operations from the screen but also whether invalid state transitions are prevented when calling the API directly. Combining API contract tests with E2E tests for main screens makes it easier to find boundary breaches.

In validation, we separate React form tests and Laravel API Feature tests. We confirm not only that buttons are hidden on the screen, but also that permissions and state transitions are rejected even when the API is called directly.

Discarded options and tradeoffs

Separating DTOs increases code volume. For small administration screens, responses close to Eloquent might be sufficient. However, if there are multiple screens or external integrations, separating contracts early makes changes easier.

Returning all display conditions from the API simplifies the screen, but the API contract tends to change with every UI modification. Conversely, if the screen side makes too many decisions, business rules may leak. It is safer to delegate only decisions related to business correctness to the API side.

Decision criteria to leave for the team

Separating Laravel and React is not enough by just separating the technology stacks. By deciding where to place business rules and where to absorb UI concerns, you can create an API that can be maintained for a long time.

The separation of Laravel and React is not a separation of technology stacks, but a separation of responsibilities. By separating the place that guarantees the correct state after saving from the place that allows comfortable operation before saving, you get a configuration that is easy to maintain for a long time.

Technical documents

We will continue to increase technical documentation.

We will continue to organize our thoughts on AI, cloud, business app development, requirements definition, and operational design into documents.

Go to technical documentation list