How can i use Jhipster to create a project with this structure :
-Spring Java back-end code with Maven
-JavaScript front-end with NodeJS, NPM
Out of the box, JHipster currently only generates Angular frontends (both v1 and v2). Angular 1 is JavaScript so that might fit what you are looking for.
You can also generate a backend only with --skip-client, and then code your own front-end. In that case, how you set the frontend up is up to you.
Related
I am learning stuff which I wrote in title. I need som good point where to start. Old I found is old sheets for it, so I decide ask to help here. Can you tell me how to start project with these technologies? Do exist some artifact for Spring 5 and Angular least in version 4? Pure spring project I should generate from start.spring.io but it's for spring boot, and I read boot is not good for beginners, and still without angular. Can you give me some hints? Thanks.
I will be also glad for some git repository with these technologies for inspiration.
You must to notice to the these notes:
If you want to use AngularJs you can add your angular javascripts to the every html files and use it.
]f you want to use Angular 2+, it is difference than AngularJs because Angular 2+ is written with Typescript and then Transpile to javascript, Angular 2+ has one html file(index.html) and your javascripts after transpile add to this file.
If you want to use both of Spring and Angular 2+, you can use Angular project instead of Client Project and Spring Project instead of Backend Project, and how to these projects communicate each other it's very easy By Spring API.
And the Bad Project is mixing Spring and Angular Project, in these situation you must to try hard to join Angular and Spring.
I am new to angular 2 and js frameworks so this question is probably going to sound a bit stupid, I have a task at work where I am looking to integrate angular 2 with Spring boot application, I went through couple of tutorials online and found that you can configure the proxy setting for paths inside angular to redirect calls to spring boot application for various paths.
For reference: https://dzone.com/articles/angular-2-and-spring-boot-development-environment
The question I want to ask is that since Angular is a js framework and I thought that it could be completely integrated with any application, like plain old javascript, html and css. In a way that only a single port is required to launch the server and jsp based models can be served through it.
But with Angular2 you need a separate port of its own to do anything. Is that true?
If it is then why it is like that?
If not then can you please direct me to a guide which describes how to integrate it in a way that it would be served through the server?
But with Angular2 you need a separate port of its own to do anything. Is that true?
No, not at all. An Angular application, once built, is just a set of satic files that can be served by any web server, including the one running your spring boot app. Those file aren't "run" on the server. They're just downloaded by the browser.
During development, though, it's much more productive to have a separate web server like the one that Angular CLI starts up, and which watches your source files, rebuilds your application on the fly, and serves it immediately. Since this server can also serve as a proxy to your spring server, you can just pretend your spring server hosts the angular files.
An alternative is to use your angular build tool to build the app to some directory, and configure spring to serve static files from that directory.
In production, you'll simply build the production-ready angular app, integrate the generated files inside the spring boot jar file (inside the static folder, typically), and run the spring boot application as usual.
I currently have a web application that runs an Angular 2 frontend, and a Spring Boot backend.
I have followed this tutorial in order to integrate the two components.
http://blog.jdriven.com/2016/12/angular2-spring-boot-getting-started/
My application now has the same structure as this
https://github.com/jbruinink/ng2boot
The frontend and backend can now be built with a single command. However the frontend and backend generate seperate jars, and need to be started seperately.
Is there a way to package my appliacation in a single jar that starts both the frontend and the backend?
That question was actually asked and answered in the comment section:
"The frontend is actually packaged into the backend jar. You can simply start the backend and go to http://localhost:8080. The development server at port 4200 is optional. It just makes it easier to develop the frontend, because all changes are reloaded automatically."
I have an web project which is using angular 2 on front end and java spring 4 on server side. I am somewhat new to angular 2. I wanted to use angular universal for prerendering. How can i able to achieve it?
is there any tutorial which explains it with Java on server side?
Is there any other library that will help me out?
Fortunately their's a library (Angularj-Universal) or a solution for rendering Angular4 applications on the server side (Spring Boot or Java EE) and sending them to the browser as 'already-bootstraped' application.
Angularj-Universal library is a server side rendering for Spring Boot and Angular4 based on the J2V8 library, also you can implement your own render implementation.
On the home page of this project you will find a useful guides step-by-step on how to create angular application from scratch and integrate it with Spring Boot using #angular/cli
Angular 2 Universal works with nodejs/asp.net only.
You could use java server for rest api and separate nodejs server for pre-rendering or play with v8 jni bindings.
https://github.com/angular/universal#getting-started
Unfortunately there are not much support available for now.
Angular Universal was originally built to work with a node.js back-end. There are adapters for most popular node.js server-side frameworks such as Express or Hapi.js. In addition to node.js, however, Angular Universal has ASP.NET Core support. In the near future we hope to add support for Java, PHP and Python.
-Related page-
You can follow this issues (spring boot support & java backend) on github.
Additionally, check out this libraries;
J2V8 A Highly Efficient JS Runtime For Java
Java's Nashorn Javascript engine (link1)
Not sure if you are looking for this but here is something that might help you
Since you want to deploy your angular app within spring-boot app follow these steps
Create a public folder under resources in your spring-boot project
ng-build --prod, type this command on you angular project which will create a dist folder under your angular project directory
copy files from you dist folder and place it in public folder under resources of your spring-boot project.
This will help you run your angular-app under spring-boot.
I have web service based web application with front build in angularjs and web service built on grails. Now I need to add a wiki app to integrate into the existing application. I want to use XWiki as a service. So is it possible to extract out only the API from XWiki with my own user credentials and roles to work with. I can't seem to figure out these issues with current documentation.
Also can you suggest other lightweight alternatives to Xwiki which supports REST ???
Yes you can extract data from XWiki very easily using the REST API, see http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI
Another strategy is to write the AngularJS app directly inside XWiki. There are some examples available here:
AngularJS Demo: http://extensions.xwiki.org/xwiki/bin/view/Extension/AngularJSDemo
AngularJS Todo app: https://github.com/xwiki-contrib/application-angular-todo
Small AngularJS app that does a live rendering of wiki markup: https://github.com/xwiki-contrib/angular-rendering
Hope it helps