Skip to content

anttiranta/liferay7-react-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Liferay 7 portlet with React and Webpack

This portlet aims to demo how React and Liferay MVC resource commands can be used to create single page portlets.

Portlet just shows the current time, and a button to refresh the time.

The demonstrator consists of two parts:

  1. A Liferay Resouce Command backend that handles all requests as resource requests. It leverages the GSON for JSON encoding, so JSON response can be returned to the frontend.
  2. An React frontend that can also be run without Liferay (thanks to a fake server), which can greatly accelerate the development.

Requirements

Needs Liferay 7.1+ (tested with Liferay 7.1)

Might not work with very old browsers (tested with IE 11 tho).

Development (without Liferay)

Run npm install in reactapp folder.

Start the dev server and run the app with npm start

Deployment

Run blade gw clean deploy (or from IDE)

Then add portlet to whatever page you want in Liferay.

Testing

Run npm test in reactapp folder

To collect coverage report: npm run coverage

About

Liferay 7 portlet with React and Webpack

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published