Skip to content

Commit

Permalink
Merge pull request #83 from mcode/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
smalho01 authored Dec 4, 2023
2 parents 778a390 + 08343f9 commit 321459f
Show file tree
Hide file tree
Showing 55 changed files with 14,203 additions and 11,553 deletions.
9 changes: 7 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@

REACT_APP_REALM = ClientFhirServer
REACT_APP_CLIENT = app-login
REACT_APP_CLIENT_SCOPES = launch offline_access openid profile user/Patient.read patient/Patient.read user/Practitioner.read
REACT_APP_AUTH = http://localhost:8180
REACT_APP_SERVER = http://localhost:8090
REACT_APP_EHR_SERVER = http://localhost:8080/test-ehr/r4
REACT_APP_EHR_SERVER_TO_BE_SENT_TO_REMS_ADMIN_FOR_PREFETCH = http://localhost:8080/test-ehr/r4
REACT_APP_EHR_BASE = http://localhost:8080/test-ehr/r4
REACT_APP_CDS_SERVICE = http://localhost:8090/cds-services
REACT_APP_GENERATE_JWT = true
REACT_APP_ORDER_SIGN = rems-order-sign
REACT_APP_ORDER_SELECT = rems-order-select
REACT_APP_PATIENT_VIEW = rems-patient-view
REACT_APP_PATIENT_FHIR_QUERY = Patient?_sort=identifier&_count=12
REACT_APP_USER = alice
REACT_APP_PASSWORD = alice
REACT_APP_PUBLIC_KEYS = http://localhost:3001/public_keys
Expand All @@ -25,7 +30,7 @@ REACT_APP_EHR_LINK = http://localhost:8080/ehr-server/
HTTPS = false
HTTPS_KEY_PATH = server.key
HTTPS_CERT_PATH = server.cert

REACT_APP_GH_PAGES=false
# To Override start command:
# REACT_APP_AUTH=http://example.com PORT=6000 npm start
# Note that .env values can only be accessed by react app starting with 'REACT_APP_'
# Note that .env values can only be accessed by react app starting with 'REACT_APP_'
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Production
build

# Dependencies
node_modules
build.js
24 changes: 24 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"parser": "@babel/eslint-parser",
"extends": ["eslint:recommended", "prettier"],
"parserOptions": {
"ecmaVersion": 2018,
"requireConfigFile": false,
"sourceType": "module",
"babelOptions": {
"presets": ["@babel/preset-react"]
}
},
"plugins": ["import"],
"rules": {
"semi": ["error", "always"],
"quotes": ["error", "single", { "avoidEscape": true }],
"no-empty-function": "warn",
"no-unused-vars": 1
},
"env": {
"browser": true,
"node": true,
"es6": true
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ typings/
build/
package-lock.json
src/db.json

# Environment variable files
.env.local
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Production
build
build.js
# Dependencies
node_modules

# This gets modified via `npm install`
package-lock.json
16 changes: 16 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"trailingComma": "none",
"arrowParens": "avoid",
"endOfLine": "auto",
"printWidth": 100,
"tabWidth": 2,
"singleQuote": true,
"overrides": [
{
"files": "*.json",
"options": {
"singleQuote": false
}
}
]
}
94 changes: 45 additions & 49 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,46 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Debug Request-Generator (Launch Docker)",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}",
"sourceMapPathOverrides": {
"/home/node/app/request-generator/*": "${webRoot}/*",
},
"runtimeArgs": [
"--remote-debugging-port=9222"
]
},
{
"type": "chrome",
"request": "attach",
"name": "Debug Request-Generator (Attach Docker)",
"port": 9222,
"urlFilter": "http://localhost:3000/*",
"webRoot": "${workspaceFolder}",
"sourceMapPathOverrides": {
"/home/node/app/request-generator/*": "${webRoot}/*",
}
},
{
"type": "chrome",
"request": "launch",
"name": "Debug Request-Generator (Launch Local)",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}",
"runtimeArgs": [
"--remote-debugging-port=9222"
]
},
{
"type": "chrome",
"request": "attach",
"port": 9222,
"name": "Debug Request-Generator (Attach Local)",
"urlFilter": "http://localhost:3000/*",
"webRoot": "${workspaceFolder}",
}
]
}
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Debug Request-Generator (Launch Docker)",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}",
"sourceMapPathOverrides": {
"/home/node/app/request-generator/*": "${webRoot}/*"
},
"runtimeArgs": ["--remote-debugging-port=9222"]
},
{
"type": "chrome",
"request": "attach",
"name": "Debug Request-Generator (Attach Docker)",
"port": 9222,
"urlFilter": "http://localhost:3000/*",
"webRoot": "${workspaceFolder}",
"sourceMapPathOverrides": {
"/home/node/app/request-generator/*": "${webRoot}/*"
}
},
{
"type": "chrome",
"request": "launch",
"name": "Debug Request-Generator (Launch Local)",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}",
"runtimeArgs": ["--remote-debugging-port=9222"]
},
{
"type": "chrome",
"request": "attach",
"port": 9222,
"name": "Debug Request-Generator (Attach Local)",
"urlFilter": "http://localhost:3000/*",
"webRoot": "${workspaceFolder}"
}
]
}
59 changes: 31 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This subproject provides a small web application that is capable of generating r
This should open a browser window directed to the value set in `REACT_APP_URL`. The request-generator assumes the CRD server is running on the default value set for `REACT_APP_SERVER`. This can be changed in the properties file [.env](./.env). [The following section](./README.md#how-to-override-defaults) lists the default values for these environment variables.

## Versions
This application requires node v20.0 or greater.
This application requires node v14.


### How To Override Defaults
Expand All @@ -23,30 +23,33 @@ The .env file contains the default URI paths, these can be overwritten from the

Following are a list of modifiable paths:

| URI Name | Default |
| -----------------------|--------------------------------------------------|
| REACT_APP_AUTH | `http://localhost:8180` |
| REACT_APP_EHR_SERVER | `http://localhost:8080/test-ehr/r4` |
| REACT_APP_CDS_SERVICE | `http://localhost:8090/cds-services` |
| REACT_APP_PUBLIC_KEYS | `http://localhost:3001/public_keys` |
| REACT_APP_LAUNCH_URL | `http://localhost:3005/launch` |
| REACT_APP_PIMS_SERVER | `http://localhost:5051/doctorOrders/api/addRx` |
| REACT_APP_REALM | `ClientFhirServer` |
| REACT_APP_CLIENT | `app-login` |
| REACT_APP_SERVER | `http://localhost:8090` |
| REACT_APP_EHR_BASE | `http://localhost:8080/test-ehr/r4` |
| REACT_APP_ORDER_SIGN | `rems-order-sign` |
| REACT_APP_ORDER_SELECT | `rems-order-select` |
| REACT_APP_USER | `alice` |
| REACT_APP_PASSWORD | `alice` |
| REACT_APP_ALT_DRUG | `true` |
| REACT_APP_SMART_LAUNCH_URL | `http://localhost:4040/` |
| REACT_APP_DEFAULT_USER | `pra1234` |
| REACT_APP_RESPONSE_EXPIRATION_DAYS | `30` |
| REACT_APP_HOMEPAGE | `http://localhost:8080` |
| REACT_APP_URL | `http://localhost:3000` |
| REACT_APP_URL_FILTER | `http://localhost:3000/*` |
| REACT_APP_EHR_LINK | `http://localhost:8080/ehr-server/` |
| HTTPS | `false` |
| HTTPS_KEY_PATH | `server.key` |
| HTTPS_CERT_PATH | `server.cert` |
| URI Name | Default |
| -----------------------|---------------------------------------------------------------------------|
| REACT_APP_AUTH | `http://localhost:8180` |
| REACT_APP_EHR_SERVER | `http://localhost:8080/test-ehr/r4` |
| REACT_APP_CDS_SERVICE | `http://localhost:8090/cds-services` |
| REACT_APP_PUBLIC_KEYS | `http://localhost:3001/public_keys` |
| REACT_APP_LAUNCH_URL | `http://localhost:4040/launch` |
| REACT_APP_PIMS_SERVER | `http://localhost:5051/doctorOrders/api/addRx` |
| REACT_APP_REALM | `ClientFhirServer` |
| REACT_APP_CLIENT | `app-login` |
| REACT_APP_SERVER | `http://localhost:8090` |
| REACT_APP_EHR_BASE | `http://localhost:8080/test-ehr/r4` |
| REACT_APP_EHR_SERVER_TO_BE_SENT_TO_REMS_ADMIN_FOR_PREFETCH | `http://localhost:8080/test-ehr/r4` |
| REACT_APP_ORDER_SIGN | `rems-order-sign` |
| REACT_APP_ORDER_SELECT | `rems-order-select` |
| REACT_APP_PATIENT_VIEW | `rems-patient-view` |
| REACT_APP_USER | `alice` |
| REACT_APP_PASSWORD | `alice` |
| REACT_APP_ALT_DRUG | `true` |
| REACT_APP_SMART_LAUNCH_URL | `http://localhost:4040/` |
| REACT_APP_DEFAULT_USER | `pra1234` |
| REACT_APP_RESPONSE_EXPIRATION_DAYS | `30` |
| REACT_APP_HOMEPAGE | `http://localhost:8080` |
| REACT_APP_URL | `http://localhost:3000` |
| REACT_APP_URL_FILTER | `http://localhost:3000/*` |
| REACT_APP_EHR_LINK | `http://localhost:8080/ehr-server/` |
| HTTPS | `false` |
| HTTPS_KEY_PATH | `server.key` |
| HTTPS_CERT_PATH | `server.cert` |
| REACT_APP_PATIENT_FHIR_QUERY | `Patient?_sort=identifier&_count=12` |
19 changes: 19 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const rewire = require('rewire');
const defaults = rewire('react-scripts/scripts/build.js');
const config = defaults.__get__('config');

// Consolidate chunk files instead
config.optimization.splitChunks = {
cacheGroups: {
default: false,
},
};
// Move runtime into bundle instead of separate file
config.optimization.runtimeChunk = false;
config.optimization.minimize = false;

// JS
config.output.filename = '[name].js';
// CSS. "5" is MiniCssPlugin
config.plugins[5].options.filename = '[name].css';
config.plugins[5].options.publicPath = '../';
Loading

0 comments on commit 321459f

Please sign in to comment.