All posts
Liferay · 12 min read · Apr 5, 2026

Using Liferay Objects as a Backend for Modern React Applications

React application backed by Liferay Objects APIs

Teams building a React application on top of Liferay usually assume they need a backend module: service builder entities, a REST Builder application, deployment, versioning. For a large class of applications that assumption is now wrong. Defining an object produces a persisted entity, a documented REST API, a GraphQL schema, a permissions model, optional workflow, and an admin interface - all from configuration.

The interesting question is not whether this works. It is where the boundary sits between what you get for free and what you still have to design. Get that boundary wrong and you either write a backend you did not need, or discover three months in that the thing you need is the one thing objects do not do.

What a definition actually buys you

  • A database table and a full CRUD API, published and documented automatically.
  • The same data exposed through both REST and GraphQL, from one definition.
  • Filtering, sorting, pagination and keyword search as query parameters, not custom endpoints.
  • Relationships to other objects and to built-in entities such as users and accounts.
  • Role-based permissions on the object and on its individual actions.
  • Optional workflow, validations, and server-side actions triggered by data events.

For a React front end, the practical effect is that most of your sprint-one backend work disappears. What remains is API design - and because the API is generated from the object model, designing the object model is designing the API. That is the single most important consequence to internalise.

Design the model for the screens you need

A data model drawn purely from the domain will produce an API that is correct and inconvenient. A model drawn with the React screens in mind produces one the front end can consume in a single request. Neither extreme is right, but the second failure is much cheaper to correct than the first.

The practical guidance is to check every planned screen against the model and ask how many round trips it needs. A list view that requires a separate call per row to resolve a label is a sign the label should be a relationship the API can include, or a denormalised field maintained by an object action. A detail view that needs five calls is usually a missing relationship rather than a missing endpoint.

http
# One request, filtered, sorted, paginated, with related data included
GET /o/c/applications
    ?filter=status eq 'SUBMITTED'
    &sort=createDate:desc
    &page=1&pageSize=20
    &nestedFields=documents

# The same object, reachable by keyword search
GET /o/c/applications?search=solar
Filtering, sorting, paging and related records are query parameters, not custom endpoints.

Picklists belong to the backend, not the bundle

Every application has status values, categories, and document types. The reflex is to hardcode them as constants in the React code, which works until a business user asks for a new category and the change requires a front-end release.

Picklists solve this properly: the values live in the platform, they are editable by administrators, they are translatable, and the front end fetches them at runtime to build its dropdowns. The cost is one extra request at load time, usually cacheable. The benefit is that the set of valid values is defined in exactly one place, which is also the place that validates incoming data.

Authentication is the first real decision

How the React application authenticates depends on where it runs, and this is worth settling before any code is written.

DeploymentAuth approachTrade-off
Embedded in a portal pageThe existing portal sessionSimplest; the app is tied to the portal shell
Standalone applicationOAuth2 with an authorisation flowFull control; more setup and token handling
Server-to-server integrationOAuth2 client credentialsNo user context, so permissions must be handled deliberately

The mistake to avoid is a shared service account used for everything. It is quick, it works in the demo, and it destroys the permission model - because every request arrives as the same powerful user, your React code becomes the only thing enforcing who can see what. That is a security boundary in the wrong place.

Permissions are server-side, and you should let them be

Object permissions are enforced by the platform on every request regardless of which API style you use. A user without read access on an object gets nothing back, whether they call the API from your application or from a terminal.

The temptation for a front-end team is to duplicate these rules in React - hiding buttons, filtering lists client side - and then treat the client checks as the real ones. Hiding controls is good user experience and worthless as security. Keep the client checks purely cosmetic, drive them from permission information the server returns, and let the server refuse what should be refused.

Where objects stop being the right answer

Objects are a data platform, not an application platform. There is a recognisable point where a custom service becomes the better choice, and recognising it early is worth more than any optimisation.

RequirementObjectsCustom service
CRUD with validation and workflowExcellent fitUnnecessary work
Relationships and filtered listsBuilt inReimplementing what exists
Multi-entity transactional operationsAwkwardThe right tool
Heavy aggregation and reportingLimitedViews or a reporting store
Bulk processing of large datasetsBatch APIs help, but have limitsPurpose-built job
Non-CRUD domain operationsObject actions cover simple casesClearer as a real endpoint
The boundary is transactional complexity and aggregation, not data volume alone.

Reporting deserves a specific warning. Objects give you a clean transactional model, but dashboards that aggregate across several objects will still want purpose-built views, exactly as they did when the data lived in custom fields and legacy tables. Moving to objects improves the write model; it does not remove the need to design the read model.

Practical pitfalls

  • Deeply nested related data in one request looks elegant and gets expensive quickly; fetch the second level only where a screen needs it.
  • Page size limits are real, so build pagination into the front end from the first screen rather than retrofitting it.
  • Renaming a field changes the API contract; treat object definitions with the same care as any published interface.
  • Adding a field is cheap, backfilling it is not - plan the data migration alongside the schema change.
  • Object actions run server side and can fail silently from the client's perspective; surface their outcome deliberately.

Conclusion

Liferay Objects make a strong headless backend for React when the application is fundamentally about structured records, relationships, approvals, and permissions - which describes most enterprise applications. They save the entire backend scaffolding layer and leave you with the work that actually needed judgement: the model, the auth strategy, and the read side. Choose the API style per screen rather than per project, which is a decision worth making with the Liferay-specific REST and GraphQL trade-offs in front of you.

Contact

Let’s connect

Have a Liferay or Backend project you’d like to talk through? Fill in the form and I’ll get back to you.

Book Calendar