From acdf1474a229fc09b5fe965e131d34909d1feb3b Mon Sep 17 00:00:00 2001 From: Patrick LaRocque Date: Sat, 13 May 2023 09:53:48 -0400 Subject: [PATCH 1/4] Add end to end setup guide for use without docker. --- EndToEndSetupGuide.md | 198 ++++++++++++++++++++++++++++++++++++++++++ README.md | 10 ++- mongo-init.js | 11 ++- 3 files changed, 217 insertions(+), 2 deletions(-) create mode 100644 EndToEndSetupGuide.md diff --git a/EndToEndSetupGuide.md b/EndToEndSetupGuide.md new file mode 100644 index 00000000..35bf7ee5 --- /dev/null +++ b/EndToEndSetupGuide.md @@ -0,0 +1,198 @@ +# End to End Setup Guide - No Docker +Follow this guide if you would like to start each application without using Docker. Each must be launched separately (in a separate terminal window). + +###Other Guides: +[Simple Set Up](SimpleSetupGuide.md) - This guide will get you up and running quickly with a demo environment for using the prototype locally. If you want to make changes or contribute to the codebase, see the detailed developer guide below. + +[Developer Environment Set Up](DeveloperSetupGuide.md) - Follow this guide if you are a developer and intend on making code changes to the DRLS REMS project. This guide follows a much more technical set up process and is fully featured. + + +## Prerequisites +- Java, gradle + - test-ehr +- node + - REMS, pims, dtr, rems-smart-on-fhir, crd-request-generator + +## Installation Order +1. Clone each Repo +- Start Utility Applications +- Start Test and Core Applications + +## Clone Repos +``` +git clone git@github.com:mcode/test-ehr.git +git clone git@github.com:mcode/crd-request-generator.git +git clone git@github.com:mcode/REMS.git +git clone git@github.com:mcode/pims.git +git clone git@github.com:mcode/dtr.git +git clone git@github.com:mcode/rems-smart-on-fhir.git +``` + +## Test Applications + +### test-ehr + +- Navigate into directory already cloned from GitHub [www.github.com/mcode/test-ehr](https://www.github.com/mcode/test-ehr) + + `cd test-ehr` + +- Run + + `gradle bootRun` + +- Load Data (in separate window, also in repo folder) + + `gradle loadData` + +### crd-request-generator + +- Navigate into directory already cloned from GitHub [www.github.com/mcode/crd-request-generator](https://www.github.com/mcode/crd-request-generator) + + `cd crd-request-generator` + +- Setup + + `npm install` + +- Run + + `npm start` + +## Core Applications + +### REMS +- Navigate into directory already cloned from GitHub [www.github.com/mcode/REMS](https://www.github.com/mcode/REMS) + + `cd REMS` + +- Submodule Initialization + + `git submodule update --init` + +- Update env.json + - Add your VSAC key to env.json as the default value for `VSAC_API_KEY` + +- Setup + + `npm install` + +- Run + + `npm start` + +### pims +- Navigate into directory already cloned from GitHub [www.github.com/mcode/pims](https://www.github.com/mcode/pims) + + `cd pims` + +- Setup + + `npm install` + +- Run + + `npm start` + +### dtr +- Navigate into directory already cloned from GitHub [www.github.com/mcode/dtr](https://www.github.com/mcode/dtr) + + `cd dtr` + +- Setup + + `npm install` + +- Run + + `npm start` + +### rems-smart-on-fhir +- Navigate into directory already cloned from GitHub [www.github.com/mcode/rems-smart-on-fhir](https://www.github.com/mcode/rems-smart-on-fhir) + + `cd rems-smart-on-fhir` + +- Submodule Initialization + + `git submodule update --init` + +- Setup + + `npm install` + +- Run + + `npm start` + + +## Utilities + +### keycloak +- Setup and run KeyCloak + - Download KeyCloak 16.1.1 from [www.github.com/keycloak/keycloak/releases/tag/16.1.1](https://github.com/keycloak/keycloak/releases/tag/16.1.1) + - Extract the downloaded file + + `tar -xvf keycloak-16.1.1.tar.gz` + - Navigate into directory + + `cd keycloak-16.1.1/bin` + - Start Keycloak + + `./standalone.sh -Djboss.socket.binding.port-offset=100` + - Create admin user and log in + - Launch the admin page in a web browser [localhost:8180/auth/](http://localhost:8180/auth/) + - Create a username and password for the admin user + - Select link for [Administration Console](http://localhost:8180/auth/admin/) + - Log in as user that was just created + - Import realm + - Select `Master` on top left and choose `Add realm` + - Select `Select file` in the middle + - In the file selection box choose `/src/main/resources/ClientFhirServerRealm.json` + - Select `Create` + - Note: newer versions of Keycloak work as well. + - Running 17, 18 or 19 with the legacy package (WildFly server) is setup the same as above. + - Running a different version with the newer Quarkus server + - Update test-ehr and crd-request-generator configuration to point to the correct auth end points + - Remove `/auth` from the URLs + - Launch Keycloak + + `KEYCLOAK_ADMIN=admin KEYCLOAK_ADMIN_PASSWORD=admin ./bin/kc.sh start-dev --http-port=8180` + - Configuration address for importing realm: [localhost:8180/admin/](http://localhost:8180/admin/) + +### mongodb +- Setup and Run MongoDB + - Download the latest version for your OS from [www.mongodb.com/try/download/community](https://www.mongodb.com/try/download/community) + - Extract the downloaded package + - Linux and Mac + + `tar -xvf ` + - Windows + + `unzip ` + - Create folder for database + + `mkdir db` + - Run mongo + + `./bin/mongod --dbpath db` +- Setup Mongo Shell `mongosh` to initialize the database + - Download latest version for your OS from [www.mongodb.com/try/download/shell](https://www.mongodb.com/try/download/shell) + - Extract the package + + `unzip ` + - Navigate into directory + + `cd ` + - Initialize the database + - (Database must already be running) + + `./bin/mongosh mongodb://localhost:27017 /mongo-init.js` + - Alternate Install Instructions: [www.mongodb.com/docs/mongodb-shell/install/#std-label-mdb-shell-install](https://www.mongodb.com/docs/mongodb-shell/install/#std-label-mdb-shell-install) + +- Restart mongo + - Stop the application + - Start as above + `./bin/mongod --dbpath db` + - Applications should now be able to connect \ No newline at end of file diff --git a/README.md b/README.md index 3b925808..80a63b3f 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ You can find complete end-to-end full-stack set up guides for DRLS REMS at the f [Developer Environment Set Up](DeveloperSetupGuide.md) - Follow this guide if you are a developer and intend on making code changes to the DRLS REMS project. This guide follows a much more technical set up process and is fully featured. +[Developer Environment Set Up (No Docker)](EndToEndSetupGuide.md) - Follow this guide if you are intend on starting every application separately without using docker. + ## Running only the REMS server project locally 1. Clone the REMS repositories from Github: ```bash @@ -42,6 +44,12 @@ NOTE: The REMS Administrator is a work in progress. ## Running the REMS Adminstrator +#### Initialization +After cloning the repsistory, the submodules must be initialized. To do this you can run: + +``` +git submodule update --init +``` #### Setup ``` npm install @@ -60,4 +68,4 @@ To reach the CDS Services discovery information: ``` http://localhost:8090/cds-services -``` \ No newline at end of file +``` diff --git a/mongo-init.js b/mongo-init.js index 7e4006d0..d80aab92 100644 --- a/mongo-init.js +++ b/mongo-init.js @@ -11,6 +11,15 @@ dbRemsAdmin.createUser({ user: "rems-user", dbPims.createCollection('pims-tmp'); dbRemsAdmin.createCollection('remsadmin-tmp'); +// add the administrator user +const dbAdmin = db.getSiblingDB('admin'); +dbAdmin.createUser({ user: "rems-admin-pims-root", + pwd: "rems-admin-pims-password", + roles: [ + { role: "userAdminAnyDatabase", db: "admin" } + ] +}) + // // Insert document to ensure db/collection is created // dbPims.pimscollection.insertOne({name: 'Hello World!'}) -// dbRemsAdmin.remsadmincollection.insertOne({name: 'Hello World Again!'}) \ No newline at end of file +// dbRemsAdmin.remsadmincollection.insertOne({name: 'Hello World Again!'}) From 76830300b9af32ad3e39f52f591479ebb5e31885 Mon Sep 17 00:00:00 2001 From: Patrick LaRocque Date: Mon, 15 May 2023 11:03:08 -0400 Subject: [PATCH 2/4] Fix numbering --- EndToEndSetupGuide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EndToEndSetupGuide.md b/EndToEndSetupGuide.md index 35bf7ee5..2ee55d42 100644 --- a/EndToEndSetupGuide.md +++ b/EndToEndSetupGuide.md @@ -15,8 +15,8 @@ Follow this guide if you would like to start each application without using Dock ## Installation Order 1. Clone each Repo -- Start Utility Applications -- Start Test and Core Applications +2. Start Utility Applications +3. Start Test and Core Applications ## Clone Repos ``` From 2d08b7ccfdeaf19f321362f24fef0773deee4025 Mon Sep 17 00:00:00 2001 From: Patrick LaRocque Date: Mon, 15 May 2023 11:20:10 -0400 Subject: [PATCH 3/4] Fix Other Guides heading --- EndToEndSetupGuide.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EndToEndSetupGuide.md b/EndToEndSetupGuide.md index 2ee55d42..df81e0a3 100644 --- a/EndToEndSetupGuide.md +++ b/EndToEndSetupGuide.md @@ -1,7 +1,8 @@ # End to End Setup Guide - No Docker Follow this guide if you would like to start each application without using Docker. Each must be launched separately (in a separate terminal window). -###Other Guides: +### Other Guides: + [Simple Set Up](SimpleSetupGuide.md) - This guide will get you up and running quickly with a demo environment for using the prototype locally. If you want to make changes or contribute to the codebase, see the detailed developer guide below. [Developer Environment Set Up](DeveloperSetupGuide.md) - Follow this guide if you are a developer and intend on making code changes to the DRLS REMS project. This guide follows a much more technical set up process and is fully featured. From 99dded43a31da7eb866e82325f243e76cdb4fe51 Mon Sep 17 00:00:00 2001 From: Patrick LaRocque Date: Mon, 15 May 2023 13:40:07 -0400 Subject: [PATCH 4/4] Move Utilities above the Core and Test applications in the guide. --- EndToEndSetupGuide.md | 145 +++++++++++++++++++++--------------------- 1 file changed, 73 insertions(+), 72 deletions(-) diff --git a/EndToEndSetupGuide.md b/EndToEndSetupGuide.md index df81e0a3..5184c104 100644 --- a/EndToEndSetupGuide.md +++ b/EndToEndSetupGuide.md @@ -29,6 +29,79 @@ git clone git@github.com:mcode/dtr.git git clone git@github.com:mcode/rems-smart-on-fhir.git ``` +## Utilities + +### keycloak +- Setup and run KeyCloak + - Download KeyCloak 16.1.1 from [www.github.com/keycloak/keycloak/releases/tag/16.1.1](https://github.com/keycloak/keycloak/releases/tag/16.1.1) + - Extract the downloaded file + + `tar -xvf keycloak-16.1.1.tar.gz` + - Navigate into directory + + `cd keycloak-16.1.1/bin` + - Start Keycloak + + `./standalone.sh -Djboss.socket.binding.port-offset=100` + - Create admin user and log in + - Launch the admin page in a web browser [localhost:8180/auth/](http://localhost:8180/auth/) + - Create a username and password for the admin user + - Select link for [Administration Console](http://localhost:8180/auth/admin/) + - Log in as user that was just created + - Import realm + - Select `Master` on top left and choose `Add realm` + - Select `Select file` in the middle + - In the file selection box choose `/src/main/resources/ClientFhirServerRealm.json` + - Select `Create` + - Note: newer versions of Keycloak work as well. + - Running 17, 18 or 19 with the legacy package (WildFly server) is setup the same as above. + - Running a different version with the newer Quarkus server + - Update test-ehr and crd-request-generator configuration to point to the correct auth end points + - Remove `/auth` from the URLs + - Launch Keycloak + + `KEYCLOAK_ADMIN=admin KEYCLOAK_ADMIN_PASSWORD=admin ./bin/kc.sh start-dev --http-port=8180` + - Configuration address for importing realm: [localhost:8180/admin/](http://localhost:8180/admin/) + +### mongodb +- Setup and Run MongoDB + - Download the latest version for your OS from [www.mongodb.com/try/download/community](https://www.mongodb.com/try/download/community) + - Extract the downloaded package + - Linux and Mac + + `tar -xvf ` + - Windows + + `unzip ` + - Create folder for database + + `mkdir db` + - Run mongo + + `./bin/mongod --dbpath db` +- Setup Mongo Shell `mongosh` to initialize the database + - Download latest version for your OS from [www.mongodb.com/try/download/shell](https://www.mongodb.com/try/download/shell) + - Extract the package + + `unzip ` + - Navigate into directory + + `cd ` + - Initialize the database + - (Database must already be running) + + `./bin/mongosh mongodb://localhost:27017 /mongo-init.js` + - Alternate Install Instructions: [www.mongodb.com/docs/mongodb-shell/install/#std-label-mdb-shell-install](https://www.mongodb.com/docs/mongodb-shell/install/#std-label-mdb-shell-install) + +- Restart mongo + - Stop the application + - Start as above + `./bin/mongod --dbpath db` + - Applications should now be able to connect + ## Test Applications ### test-ehr @@ -125,75 +198,3 @@ git clone git@github.com:mcode/rems-smart-on-fhir.git `npm start` -## Utilities - -### keycloak -- Setup and run KeyCloak - - Download KeyCloak 16.1.1 from [www.github.com/keycloak/keycloak/releases/tag/16.1.1](https://github.com/keycloak/keycloak/releases/tag/16.1.1) - - Extract the downloaded file - - `tar -xvf keycloak-16.1.1.tar.gz` - - Navigate into directory - - `cd keycloak-16.1.1/bin` - - Start Keycloak - - `./standalone.sh -Djboss.socket.binding.port-offset=100` - - Create admin user and log in - - Launch the admin page in a web browser [localhost:8180/auth/](http://localhost:8180/auth/) - - Create a username and password for the admin user - - Select link for [Administration Console](http://localhost:8180/auth/admin/) - - Log in as user that was just created - - Import realm - - Select `Master` on top left and choose `Add realm` - - Select `Select file` in the middle - - In the file selection box choose `/src/main/resources/ClientFhirServerRealm.json` - - Select `Create` - - Note: newer versions of Keycloak work as well. - - Running 17, 18 or 19 with the legacy package (WildFly server) is setup the same as above. - - Running a different version with the newer Quarkus server - - Update test-ehr and crd-request-generator configuration to point to the correct auth end points - - Remove `/auth` from the URLs - - Launch Keycloak - - `KEYCLOAK_ADMIN=admin KEYCLOAK_ADMIN_PASSWORD=admin ./bin/kc.sh start-dev --http-port=8180` - - Configuration address for importing realm: [localhost:8180/admin/](http://localhost:8180/admin/) - -### mongodb -- Setup and Run MongoDB - - Download the latest version for your OS from [www.mongodb.com/try/download/community](https://www.mongodb.com/try/download/community) - - Extract the downloaded package - - Linux and Mac - - `tar -xvf ` - - Windows - - `unzip ` - - Create folder for database - - `mkdir db` - - Run mongo - - `./bin/mongod --dbpath db` -- Setup Mongo Shell `mongosh` to initialize the database - - Download latest version for your OS from [www.mongodb.com/try/download/shell](https://www.mongodb.com/try/download/shell) - - Extract the package - - `unzip ` - - Navigate into directory - - `cd ` - - Initialize the database - - (Database must already be running) - - `./bin/mongosh mongodb://localhost:27017 /mongo-init.js` - - Alternate Install Instructions: [www.mongodb.com/docs/mongodb-shell/install/#std-label-mdb-shell-install](https://www.mongodb.com/docs/mongodb-shell/install/#std-label-mdb-shell-install) - -- Restart mongo - - Stop the application - - Start as above - `./bin/mongod --dbpath db` - - Applications should now be able to connect \ No newline at end of file