marklogic-community / marklogic-samplestack

A sample implementation of the MarkLogic Reference Architecture
Apache License 2.0
82 stars 56 forks source link

Run samplestack as 3-tier app #713

Open rvirdiz opened 6 years ago

rvirdiz commented 6 years ago

Hi, I was deploying the samplestack app as a 3-tier web application (as it is developed as a 3-tier app), in which middle tier was Java-Springs and browser side as AngularJS.

I followed the below approach to deploy the app: First VM: Installed MarkLogic 8 using AWS AMI.

Second VM:

  1. Cloned the SampleStack code on the Second VM.
  2. Now, configuring the gradle.properties file to change the MarkLogic DB Host, username and password.
  3. Then, under appserver/java-spring folder, run ./gradlew appserver
  4. Gradle builds the code and perform various tests, thus making the middle-tier up at port 8090. http://localhost:8090/
  5. This terminal is open with bootRun.

So, now open a new terminal on the second VM where middle-tier is running, I installed the prerequisites, then under browser folder, I run the gulp run --middle-tier=external. It makes the gulp build for angularjs and makes the app running on the same VM on port 3000 at: http://localhost:3000/

Now, as a 3-tier app, I want to setup db on different VM, middle-tier on different VM and Front-end also on different VM, but in this case middle-tier and browser are running on same VM on ports 8090 and 3000. Is it possible to run Angular JS browser on New VM, such that it makes RESTAPI calls to middle-tier on different VM instead running on the same VM with different terminals. Like, if there is any configuration file for this, like in case of MarkLogic on different host.

I hope, you got the question, in case you want more information please reply.

Thanks.

aditya- commented 6 years ago

@laquereric @grechaw @team Can you kindly look into this. Thanks :-)

aditya- commented 6 years ago

Just want to understand how to make the connection between Front end node and Middle tier java spring server node when both are hosted separately, kindly please let us know where to make this configuration (for establishing the connection between frontend and Middle tier). Thanks