Generate angular + Java code using yeoman & Jhipster
Generate angular + Java code using yeoman & Jhipster
Ensure you have installed yeoman (yo when dealing with npm and yarn) and jhipster (generator-jhipster when dealing with npm and yarn).
If not installed, have a quick look at,
Table of Contents
Step 1: Run yo jhipster
It will ask around 10 to 15 questions, you can provide the sample values as per the above screenshot and proceed to step 2:
Step 2: Angular 5 & Java Codes are generated
Yeoman generating the java source code:
yeoman generating the angular source code:
Both client (angular 5 – as on march 1st ) and server applications are successfully generated.
Step 3: Run mvnw to run the server application
I ran mvnw (in windows 10) to download the dependencies, compile and run the spring boot generated stuffs.
I got the exception due to the access issue of mysql database:
I resolved it, by giving the proper user id and password in the application.properties file:
Change the proper user id and password in the application-dev.yml and application-rpod.ym files under
yeoman-jhipster\src\main\resources\config\application-dev.yml
yeoman-jhipster\src\main\resources\config\application-prod.yml
And also in pom.xml file:
Again run mvnw, probably this time it runs faster, because all the maven dependencies are already downloaded during our first run.
Step 4: Ensure you have the database, else just create it
As I did not have the contacts database I got this exception, the same I will create and run again,
That’s great, it is running without any issue this time,
Now open http://localhost:8080
You know, I can perform register, sign in as user and sign as admin and more…..
Let’s continue with angular 5 too:
Open an another command prompt window and navigate to the same project and try
npm start
Project is successfully running at:
You can also see this window once the build is success:
Now open http://localhost:9060
Hope you learnt the basic angular 5 & java source code generation and successful run using yeoman and jhipster.
Just for a understanding, I captured the tables created under the database we created by jhipster is:
I will continue with the simple custom form with CRUD operation in the next post.
Feel free to write your comments in the below comments section.