From 04a38a64d112dbbe552f8b9ad8c3b788f26547a2 Mon Sep 17 00:00:00 2001 From: Dylan Starink Date: Thu, 17 Oct 2024 09:29:20 -0700 Subject: [PATCH] Update README.md with Build Instructions --- README.md | 71 ++++++++----------------------------------------------- 1 file changed, 10 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index 1231bae14..8a3aed6fb 100644 --- a/README.md +++ b/README.md @@ -58,52 +58,16 @@ Email: kevin.zurek@teamfemr.org ### Step 1: Download and Install the following Software and Dependencies - [IntelliJ IDEA Ultimate](https://www.jetbrains.com/idea/download/) -- [MySQL Server](https://dev.mysql.com/downloads/mysql/) -- [MySQL Workbench](https://dev.mysql.com/downloads/workbench/) -- [Java JDK 1.8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) +- [Docker Desktop](https://www.docker.com/products/docker-desktop/) - [Git](http://git-scm.com/) -### Step 2: Clone the repo and checkout super-femr branch +### Step 2: Clone the repo - `git clone https://github.com/FEMR/femr.git` -- `git checkout super-femr` ### Step 3: Setting up the DB -1. Make sure your MySQL server is running on your machine. -2. Open the MySQL Workbench. -3. Select the db icon to create a new schema and call it `femr_db`. - -
screenshot - -![Image](https://github.com/kylene-phillips/femr-installation/blob/gh-pages/images/mysqlworkbench1.png?raw=true) - -
- -4. Under the Administration tab, select `User and Priviliges`. Then `Add account` and add `Login name` and `Password` of your preference. Save the login and password because you will need it in the later steps. - - For this example, the username is `testing` and password is `password`. - -
screenshot - -![Image](https://github.com/kylene-phillips/femr-installation/blob/gh-pages/images/mysqlworkbench2.png?raw=true) - -
- -5. Then go to the `Schema Privileges` tab, select `Add Entry...` for the user you created in the previous step, and select the `femr_db` schema. - -
screenshot - -![Image](https://github.com/kylene-phillips/femr-installation/blob/gh-pages/images/mysqlworkbench3.png?raw=true) - -![Image](https://github.com/kylene-phillips/femr-installation/blob/gh-pages/images/mysqlworkbench4.png?raw=true) - -
- -6. Give all of the rights, except the `GRANT OPTION`. - -
screenshot - -![Image](https://github.com/kylene-phillips/femr-installation/blob/gh-pages/images/mysqlworkbench5.png?raw=true) - -
+1. Ensure Docker Desktop is running +2. Open a terminal at the repository root +3. Run `docker-compose up db` to bring up the database. To stop the database use Ctrl+c ### Step 4: Configuring IntelliJ @@ -112,39 +76,24 @@ Email: kevin.zurek@teamfemr.org 2. In IntelliJ IDEA Ultimate and go to `Preferences` -> `Plugins` -> click `Marketplace` -> Then download `Scala` and `Play Framework`. Then restart the IDE. 3. Inside `femr/conf` folder, create a new file named `application.dev.conf`. -4. Copy the following settings inside and save it. Note that `db.default.username` and `db.default.password` values must match the account and password from the Step 3.3. For this example, my username is `testing` and password is `password`. ``` include "application.conf" settings.researchOnly=0 db.default.url="jdbc:mysql://127.0.0.1:3306/femr_db?characterEncoding=UTF-8&useSSL=false" -db.default.username="testing" +db.default.username="femr" db.default.password="password" photos.defaultProfilePhoto="./public/img/defaultProfile.png" csv.path="./Upload/CSV" ``` -5. Go to `Run` -> `Edit Configurations` -> click on the `+` sign -> `Play 2 App`. +4. Go to `Run` -> `Edit Configurations` -> click on the `+` sign -> `Play 2 App`. - If `Play 2 App` doesn't appear, try restarting the IDE. -
screenshot - -![Image](https://github.com/kylene-phillips/femr-installation/blob/gh-pages/images/intellij5.png?raw=true) - -
- -6. Then, click on `Edit Environment Variables` -> add the following two environment variables: `user.dir` and `config.file` (make sure to change the value based on where the two are stored on your local machine). Then click apply and ok. - - `config.file` is the path for application.dev.conf. - - `user.dir` is the path for the project. - -
screenshot - -![Image](https://github.com/kylene-phillips/femr-installation/blob/gh-pages/images/intellij6.png?raw=true) - -
+5. In the JVM options of the configuration add `-Dconfig.resource=application.dev.conf` to the end. -7. Go to `File` -> `Project structure` -> Under the `Project` tab -> Select `Project SDK` and set it to 1.8. +6. Go to `File` -> `Project structure` -> Under the `Project` tab -> Select `Project SDK` and set it to 1.8. - You can download 1.8 directly from IntelliJ. If so, choose 1.8 Amazon Correto.
screenshot @@ -162,7 +111,7 @@ csv.path="./Upload/CSV"
9. On the rightmost side of IntelliJ, if there is a vertical line containing sbt. Click on the sbt tab and then click the refresh symbol. - - If there isn’t sbt on the right, remove the .idea folder from the root directory of the project. In the command line, traverse to the root directory and do: rm -r .idea. Then redo step 2 and then continue. If still does not work try removing the project and recloning it again. + - If there isn’t sbt on the right, remove the .idea folder from the root directory of the project. In the command line, traverse to the root directory and do: rm -r .idea. Then redo step 2 and then continue. If still does not work try invaliadating IntelliJ's cache.
screenshot