Skip to content

Commit 32aaa15

Browse files
author
Yan Xu
committed
Update env
1 parent da62891 commit 32aaa15

9 files changed

+86
-82
lines changed

installation/README.md

+11-4
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,24 @@ https://docs.mongodb.com/manual/installation/#mongodb-community-edition-installa
2626

2727
- Populate the "client build" environment configuration file (i.e. `webapp/client/.env`).
2828

29-
You can initialize it based upon the corresponding development/production example file:
29+
You can initialize it based upon the corresponding example file:
3030
```shell
31-
cp webapp/client/.env.development.example \
31+
cp webapp/client/.env.example \
3232
webapp/client/.env
3333
```
3434
> Those environment variables are used within `webapp/client/src/config.js`.
35+
36+
- Create a build directory with a production build of the client:
37+
```shell
38+
cd webapp/client
39+
npm run build
40+
```
41+
3542
- Populate the server environment configuration file (i.e. `webapp/server/.env`).
3643

37-
You can initialize it based upon the corresponding development/production example file:
44+
You can initialize it based upon the corresponding example file:
3845
```shell
39-
cp webapp/server/.env.development.example \
46+
cp webapp/server/.env.example \
4047
webapp/server/.env
4148
```
4249
> Those environment variables are used within `webapp/server/config.js`.

installation/install.sh

+10-7
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,19 @@ do
5151
done
5252

5353
echo "Setup LANL EDGE webapp ..."
54-
#build client
55-
echo "build client..."
54+
#install client
55+
echo "install client..."
5656
cd $app_home/webapp/client
5757
npm install --legacy-peer-deps
58-
npm run build
59-
#build server
60-
echo "build server..."
58+
#install server
59+
echo "install server..."
6160
cd $app_home/webapp/server
6261
npm install
6362

6463
echo "LANL EDGE webapp successfully installed!"
65-
echo "To start the webapp in EDGEv3's root directory:"
66-
echo "pm2 start pm2.config.js"
64+
echo "Next steps:"
65+
echo "1. copy webapp/client/.env.example to webapp/client/.env and update settings in the .env file"
66+
echo "2. inside webapp/client, run command: npm run build"
67+
echo "3. copy webapp/server/.env.example to webapp/server/.env and update settings in the .env file"
68+
echo "4. start MongoDB if it's not started yet"
69+
echo "5. start the webapp in EDGEv3's root directory: pm2 start pm2.config.js"

webapp/README.md

+12-22
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,28 @@
88
## Install the webapp
99

1010
cd installation
11-
./install-local.sh
11+
./install.sh
12+
13+
## Configure and start ui client
14+
15+
cd webapp/client
16+
cp .env.example .env
17+
(update settings in .env)
18+
npm start
1219

13-
## Start api server
20+
## Configure and start api server
1421

1522
cd webapp/server
16-
(change NODE_ENV=prod to NODE_ENV=dev in .env)
23+
cp .env.example .env
24+
(update settings in .env)
1725
npm start
1826

19-
## Start ui client
20-
21-
cd webapp/client
22-
npm start
2327

2428
## View the website
2529

2630
http://localhost:3000
2731

2832
## Note
2933

30-
- Have to restart the client when any changes made in client/.env.
31-
- Have to restart the server when any changes made in server code or server/.env.
32-
33-
#### Restart api server
34-
35-
cd webapp/server
36-
use Ctrl-C to stop the webapp server
37-
npm start
38-
39-
#### Restart ui client
40-
41-
cd webapp/client
42-
use Ctrl-C to stop the webapp client
43-
npm start
44-
34+
- Have to restart the api server when any changes made in webapp/server code or webapp/server/.env.
4535

webapp/client/.env.development.example

-8
This file was deleted.

webapp/client/.env.example

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
###############################################################################
2+
# Refer to `./src/config.js` to see all supported environment variables. #
3+
###############################################################################
4+
VITE_NAME=EDGE V3
5+
VITE_EMAIL_NOTIFICATION_ENABLED=false
6+
VITE_FILEUPLOAD_ENABLED=true
7+
8+
# for development only
9+
# VITE_API_URL=http://localhost:5000
10+
11+
# ORCiD login
12+
VITE_IS_ORCID_AUTH_ENABLED=false
13+
VITE_ORCID_CLIENT_ID=="__POPULATE_ME_IF_ENABLING_ORCID_AUTH__"

webapp/client/.env.production.example

-7
This file was deleted.

webapp/server/.env.development.example

-18
This file was deleted.

webapp/server/.env.example

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# uncomment 'SYSTEM_MESSAGE' and restart pm2 to disable workflow submission
2+
# SYSTEM_MESSAGE=Workflow submission is temporarily unavailable. You can still browse/view your submitted projects.
3+
4+
###############################################################################
5+
# Refer to `./config.js` to see all supported environment variables. #
6+
###############################################################################
7+
8+
# Networking:
9+
# -----------
10+
PORT=5000
11+
CRON_PORT=5555
12+
13+
# default is 'production'
14+
# NODE_ENV=development
15+
16+
# Base URL at which visitors can access the web UI server
17+
# Example url for development
18+
# APP_UI_BASE_URL=http://localhost:3000
19+
APP_UI_BASE_URL="__POPULATE_ME__"
20+
21+
# Secrets:
22+
# --------
23+
#
24+
# Note: You can generate a secret by running the following shell command:
25+
# $ node -e 'console.log(require("crypto").randomBytes(20).toString("hex"))'
26+
#
27+
JWT_SECRET="__POPULATE_ME__"
28+
29+
# Database
30+
DB_NAME="__POPULATE_ME_IN_PRODUCTION__"
31+
32+
# upload file, file extensions
33+
FILEUPLOAD_ALLOWED_EXTENSIONS=fastq|fq|faa|fa|fasta|fna|contigs|fastq.gz|fq.gz|fa.gz|fasta.gz|fna.gz|contigs.gz|fa.bz2|fasta.bz2|contigs.bz2|fna.bz2|fa.xz|fasta.xz|contigs.xz|fna.xz|gbk|gff|genbank|gb|xlsx|txt|bed|config|tsv|csv|raw|d|bam|sam
34+
35+
# Email:
36+
# ------
37+
SEND_PROJECT_STATUS_EMAILS=false
38+
PROJECT_STATUS_SUBJECT=Your EDGE project status
39+
EMAIL_MAILGUN_API_KEY="__POPULATE_ME_IF_ENABLING_EMAIL__"
40+
EMAIL_MAILGUN_DOMAIN="__POPULATE_ME_IF_ENABLING_EMAIL__"

webapp/server/.env.production.example

-16
This file was deleted.

0 commit comments

Comments
 (0)