Generator-jhipster: Separate UI and Server apps

Created on 15 Feb 2016  Â·  15Comments  Â·  Source: jhipster/generator-jhipster

I don't know if this is the right place to ask for improvements so please let me know and I'll move it.

Currently, jhipster applications are shipped as a bundle. I think it could be interesting if in the project creation we could the have the option to separate the UI and the server into two different applications.

I'm aware that this might not have been your architectural choice but for modularized applications it could be interesting to have the UI deployed isolatedly while being able to reach different infrastructures (services within modules in different servers, cloud services, third-party APIs, etc).

Is this something worth considering, or is it already achievable somehow?

Most helpful comment

No, this is a JHipster 3.0 feature, we are currently working on it.

All 15 comments

This is what we are currently working on :-)
So you need to wait for JHipster 3.0 and that will be done!

We already generate a distinct angular js client app and spring boot server
app. We even have sub generator to generate both separately but i guess
your requirement is to have them packaged seperateley for deployment, which
we do not support currently. The packaging is still monolithic but you can
easily split them by hand as all the clinet code is in the webapp folder
just move that along with bower.json, package.json and the gulpfile and
package them as you like.

For having this as an option during generation may not be on the cards now

Cc @jdubois
On 15 Feb 2016 21:17, "psantosvox" [email protected] wrote:

I don't know if this is the right place to ask for improvements so please
let me know and I'll move it.

Currently, jhipster applications are shipped as a bundle. I think it could
be interesting if in the project creation we could the have the option to
separate the UI and the server into two different applications.

I'm aware that this might not have been your architectural choice but for
modularized applications it could be interesting to have the UI deployed
isolatedly while being able to reach different infrastructures (services
within modules in different servers, cloud services, third-party APIs, etc).

Is this something worth considering, or is it already achievable somehow?

—
Reply to this email directly or view it on GitHub
https://github.com/jhipster/generator-jhipster/issues/2890.

@jdubois our skipClient option gives a deployable server app but our
skipServer option will just generate client app with gulpfile. Do we have
to include some form of packaging to deploy this?
On 15 Feb 2016 21:24, "Deepu K Sasidharan" [email protected] wrote:

We already generate a distinct angular js client app and spring boot
server app. We even have sub generator to generate both separately but i
guess your requirement is to have them packaged seperateley for deployment,
which we do not support currently. The packaging is still monolithic but
you can easily split them by hand as all the clinet code is in the webapp
folder just move that along with bower.json, package.json and the gulpfile
and package them as you like.

For having this as an option during generation may not be on the cards now

Cc @jdubois
On 15 Feb 2016 21:17, "psantosvox" [email protected] wrote:

I don't know if this is the right place to ask for improvements so please
let me know and I'll move it.

Currently, jhipster applications are shipped as a bundle. I think it
could be interesting if in the project creation we could the have the
option to separate the UI and the server into two different applications.

I'm aware that this might not have been your architectural choice but for
modularized applications it could be interesting to have the UI deployed
isolatedly while being able to reach different infrastructures (services
within modules in different servers, cloud services, third-party APIs, etc).

Is this something worth considering, or is it already achievable somehow?

—
Reply to this email directly or view it on GitHub
https://github.com/jhipster/generator-jhipster/issues/2890.

@deepu105 for the skipServer I think the gulpfile is enough, as long as you can generate a minimized version. Then people need to move this around: as they didn't want to have the server part generated, it's up to them to put those files correctly on their own server

@psantosvox Thanks for starting this thread!!

@deepu105 I have the latest JHipster version (v2.27.0) installed but there's no skipServer option listed down, please let me know if that option is already available with the latest release.

$ yo jhipster -h
Usage:
  yo jhipster:app [options] 

Options:
  -h,   --help          # Print the generator's options and usage
        --skip-cache    # Do not remember prompt answers                                                                      Default: false
        --skip-install  # Do not automatically install dependencies                                                           Default: false
        --skip-client   # Skips the client side app generation                                                                Default: false
        --client-build  # Specify the client side build to use when skipping client side generation, has no effect otherwise  Default: none
        --i18n          # disable or enable i18n when skipping client side generation, has no effect otherwise                Default: true

No, this is a JHipster 3.0 feature, we are currently working on it.

@jdubois Thanks!! Looking forward for this release :+1:

@jdubois I have generated the project with JHipster (both Client & Server) and I moved the webapp folder contents to a separate maven module folder (ui-maven-module) and included the ui-maven-module as a pom dependency to the spring-boot-starter-parent pom.xml. I was able to create the war file with the UI module contents by running the mvn -Pprod clean package command. And I'm able to launch the application with the below command,

java -jar target/*.war --spring.profiles.active=dev

But I have a problem while starting the server with mvn spring-boot:run command since the server by default looks for the UI resources under src/main/webapp, but I would like to serve the UI files from a different folder, is there an option to change the default webapp location for the spring-boot maven plugin.

@karthilxg once you get it resolved would you consider contributing the steps to our documentation site as a tip?

@deepu105 Sure I can do that once I find the solution. But I thought you guys could help me finding the solution for this :)

I have been working on decoupling the angular app and spring java app into two separate projects, as a first step I tried to split the angular app into a separate maven module and added the ui module as a dependency to the parent spring module in the pom.xml file, and I have added a maven profile as build-ui to make the UI module as an optional while building the package. Everything works as expected except the above mentioned issue.

Im not very familiar with maven as I have used it rarely so I dont have an
answer for you

Thanks & Regards,
Deepu

On Thu, Feb 18, 2016 at 3:42 PM, Karthi [email protected] wrote:

@deepu105 https://github.com/deepu105 Sure I can do that once I find
the solution. But I thought you guys could help me finding the solution for
this :)

I have been working on decoupling the angular app and spring java app
into two separate projects, as a first step I tried to split the angular
app into a separate maven module and added the ui module as a dependency to
the parent spring module in the pom.xml file, and I have added a maven
profile as build-ui to make the UI module as an optional while building
the package. Everything works as expected except the above mentioned issue.

—
Reply to this email directly or view it on GitHub
https://github.com/jhipster/generator-jhipster/issues/2890#issuecomment-185582662
.

Most of the time you don't need maven war overlays to split UI, just look at how spring-cloud does for Eureka server, you just add a jar and @EnableEurekaServer to your spring boot application and you get both additional controllers and a web dashboard.

Hi I hope this functionality for seperate UI and Server apps are present now in JHipster as the current version seems to be 3.5 . But can you give some reference on how to implement it. And any releated pull requests made for this feature.?

@nanospeck http://jhipster.github.io/creating-an-app/ documents the available options, you are looking for yo jhipster:server to generate a server and yo jhipster:client to generate the client (--skip-server and --skip-client do the same). I think that's pretty straight-forward, you can then set up the hosting for your client and server separately. Please take questions to http://stackoverflow.com/questions/tagged/jhipster

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ahmedeldeeb25 picture ahmedeldeeb25  Â·  3Comments

edvjacek picture edvjacek  Â·  3Comments

DanielFran picture DanielFran  Â·  3Comments

chegola picture chegola  Â·  4Comments

tomj0101 picture tomj0101  Â·  3Comments