-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #206 from CBIIT/mvp-2
Sync MVP-2 (M2) with MVP-2 (M3)
- Loading branch information
Showing
80 changed files
with
2,230 additions
and
695 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
### Overview | ||
|
||
N/A | ||
|
||
### Change Details (Specifics) | ||
|
||
N/A | ||
|
||
### Related Ticket(s) | ||
|
||
N/A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Certify Changes | ||
|
||
on: | ||
pull_request: | ||
branches: "*" | ||
paths: | ||
- "src/**" | ||
- "public/**" | ||
- "*.json" | ||
- "*.js" | ||
- "*.jsx" | ||
- "*.ts" | ||
- "*.tsx" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
certify: | ||
name: Certify Build Changes | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Dependencies | ||
run: npm ci --legacy-peer-deps | ||
|
||
- name: Run Typecheck | ||
run: npm run check:ci | ||
|
||
- name: Run Jest | ||
run: npm run test:ci | ||
|
||
- name: Run Linter | ||
run: npm run lint:ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
# NGINX Installation For Mac | ||
|
||
Follow this guide to install and configure Nginx for usage with this project. For a understanding of the overall architecture, see the [Deployment Architecture](#deployment-architecture) section. | ||
|
||
Install NGINX: | ||
|
||
```bash | ||
brew install nginx | ||
``` | ||
|
||
Remove Default NGINX Configuration (Optional) | ||
|
||
```bash | ||
rm /usr/local/etc/nginx/nginx.conf.default | ||
rm /usr/local/etc/nginx/nginx.conf | ||
``` | ||
|
||
Clone Provided Configuration | ||
|
||
```bash | ||
cp ./nginx.conf /usr/local/etc/nginx/ | ||
``` | ||
|
||
> **Warning**: Do not confuse the [nginx.conf](./nginx.conf) file in this directory with the one in [conf/nginx.conf](../conf/nginx.conf). The latter is used for | ||
> production deployments. | ||
Start/Restart NGINX | ||
|
||
```bash | ||
brew services restart nginx | ||
``` | ||
|
||
# React App Configuration | ||
|
||
See the provided [.env](../.env.example) file for the required environment variables. At a minimum, include: | ||
|
||
```properties | ||
# ... other variables | ||
|
||
REACT_APP_BACKEND_API="http://localhost:4010/api/graphql" | ||
|
||
PORT=3010 | ||
|
||
# ... other variables | ||
``` | ||
|
||
> **Note**: After modifying the .env file, you must completely restart the React app for the changes to take effect. | ||
# Deployment Architecture | ||
|
||
## Semi-Hosted Deployment (Recommended) | ||
|
||
A deployment architecture diagram is shown below using the frontend deployed locally and the backend deployed on the hosted DEV/DEV2 tiers. This avoids the need to install and configure the entire backend tech stack. | ||
|
||
```mermaid | ||
--- | ||
title: Semi-Hosted Deployment Architecture | ||
--- | ||
flowchart TD | ||
id0["Browser – You"] | ||
id1["Nginx – port:4010"] | ||
id2["FE – port:3010"] | ||
id3["DEV Backend"] | ||
id4["DEV AuthZ"] | ||
id5["DEV AuthN"] | ||
id0 <--"https://localhost:4010"--> id1 | ||
subgraph lh[" "] | ||
subgraph nx["Nginx – Reverse Proxy"] | ||
id1 | ||
end | ||
subgraph be["DEV/DEV2 Hosted Backend Services"] | ||
id1 --"/api/graphql"---> id3 | ||
id1 --"/api/authn/"---> id4 | ||
id1 --"/api/authz/"---> id5 | ||
end | ||
subgraph fe["Frontend Services"] | ||
id2 | ||
end | ||
id1 <--"*Catch All*"--> fe | ||
end | ||
``` | ||
|
||
## Local Deployment | ||
|
||
An overview of the local deployment architecture is shown below using the following locally hosted tech stack: | ||
|
||
- Frontend – <https://github.com/CBIIT/crdc-datahub-ui> | ||
- Backend – <https://github.com/CBIIT/crdc-datahub-backend> | ||
- AuthZ – <https://github.com/CBIIT/crdc-datahub-authz> | ||
- AuthN – <https://github.com/CBIIT/crdc-datahub-authn> | ||
- MongoDB | ||
|
||
Please see the individual repos for installation and configuration instructions. | ||
|
||
```mermaid | ||
--- | ||
title: Local Deployment Architecture | ||
--- | ||
flowchart TD | ||
id0["Browser"] | ||
id1["Nginx – port:4010"] | ||
id2["FE – port:3010"] | ||
id3["BE – port:4020"] | ||
id4["AuthZ – port:4030"] | ||
id5["AuthN – port:4040"] | ||
id6["MongoDB"] | ||
id0 <--"https://localhost:4010"--> id1 | ||
subgraph lh[" "] | ||
subgraph nx[" "] | ||
id1 | ||
end | ||
id1 --"/api/graphql"---> be | ||
id1 --"/api/authn/graphql"---> be | ||
id1 --"/api/authz/graphql"---> be | ||
subgraph be["Backend Services"] | ||
direction RL | ||
id3 | ||
id4 | ||
id5 | ||
subgraph misc["Misc. Dependencies"] | ||
id6 | ||
end | ||
id3-->misc | ||
id4-->misc | ||
id5-->misc | ||
end | ||
subgraph fe["Frontend Services"] | ||
id2 | ||
end | ||
id1 <--"*Catch All*"--> fe | ||
end | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# CRDC-DH NGINX Config | ||
# | ||
# Last Modified: October 23, 2023 | ||
# https://github.com/CBIIT/crdc-datahub-ui | ||
|
||
# NOTES: | ||
# - Nginx runs on port 4010 | ||
# - The frontend runs on port 3010 | ||
# - Modify the proxy_pass URL to point to the DEV or DEV2 tiers | ||
|
||
worker_processes 1; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
server { | ||
listen 0.0.0.0:4010; | ||
server_name localhost; | ||
|
||
# Authn | ||
location /api/authn/ { | ||
# proxy_pass http://localhost:4030/api/authn/; | ||
proxy_pass "https://hub-dev2.datacommons.cancer.gov/api/authn/"; | ||
} | ||
|
||
# AuthZ | ||
location /api/authz/ { | ||
# proxy_pass http://localhost:4020/api/authz/; | ||
proxy_pass "https://hub-dev2.datacommons.cancer.gov/api/authz/"; | ||
} | ||
|
||
# Backend | ||
location /api/graphql { | ||
# proxy_pass http://localhost:4040/api/graphql; | ||
proxy_pass "https://hub-dev2.datacommons.cancer.gov/api/graphql"; | ||
} | ||
|
||
# Frontend | ||
location / { | ||
allow all; | ||
proxy_pass http://localhost:3010/; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ window.injectedEnv = { | |
NIH_AUTHORIZE_URL: '', | ||
NIH_CLIENT_ID: '', | ||
NIH_REDIRECT_URL: '', | ||
REACT_APP_DEV_TIER: '' | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
Oops, something went wrong.