Create a New React Enactor Application
Overview
This tutorial will guide you how to create a React Application using the Enactor Application Wizard.
What you will learn
-
How to generate a React Application through the Enactor Application Wizard.
-
How to run the generated react app.
Pre-requisites
An Eclipse installation with Enactor Tools plugin and npm (Node Package Manager) should be set up on the machine. Should be connected to the Enactor VPN and should set the NPM registry to https://npm.enactor.co.uk.
Exercises
Generating the Swing Application
Open the Select a Wizard by navigating to New -> Other and then search for Enactor Application Wizard and open it.
.
In the first page of the Enactor Application fill the basic information like Application Name, Project Name, Application Home and the RunTimeContext Name. The desired JRE should also be set in this page. Refer InitialPage for more details.
.
Click next and navigate to the next page which is the Maven Configuration page. In here the default values are supplied for the Maven like Group ID, Artifact ID and the version. Keep the default values as it is (you can change the values if you want a different artifact or group id).
Click next and navigate to the next page which is Prompt Type Configuration page. Select React from the selection. Keep the browser type and the version default values. Change the type to JavaFX if you prefer.
Click next and navigate to Version Configuration page and fill the Enactor Platform Version with your desired version. Fill the enactor react version as well. We will proceed with the default values in this tutorial
Then click next button and navigate to the Database Configuration. You can add the details if you want to add database support. In this tutorial lets proceed without database support.
Click finish to generate the application.
Run the generated application
To run the generated application first you have to build the project. You can either right click on the project and run as maven install or you can build the project externally and refresh the project from eclipse.
Then right click on the project and click on Maven -> Update Project.
navigate to the folder where the package.json is present. (Projectname -> src-js -> packages -> projectName) and open a terminal and run npm install.
After the node modules been installed enter npm run build command and it will build the resources.
After updating the project go to the run configuration and find the config with the application name and run it.
Then the application will launch like this. Enter the name in the text box and it will give a greeting message.