For one time setup instructions see setup for macOS
For everyday use see work on macOS
Use the version in .nvmrc. Install Node.js directly, or use nvm and run nvm use in the repo root.
- Clone this repository and
cdinto it. - Install or select Node.js per Prerequisites.
- Run
nvm useto switch to the latest compatible version of node. - Run
npm ci. If package.json is missing runnpm installinstead. The ci command needs a package.json to work. - Edit dev server port in webpack.config.js to an available port on your localhost. Under plugins -> devServer ->
port: 9002. - Run
npm run start. - Open a browser and go to
localhost:9002orlocalhost:<port>.
This repository uses detect-secrets to prevent accidental credential commits. A .secrets.baseline file tracks known, audited findings.
pip install detect-secrets~=1.5.0Or install all script dependencies at once:
pip install -r scripts/requirements.txt# Regenerate baseline after adding/removing files with false positives
scripts/detect_secrets_baseline.sh scan
# Interactively audit any unreviewed findings in the baseline
scripts/detect_secrets_baseline.sh audit
# Check for new secrets vs the committed baseline (what CI runs)
scripts/detect_secrets_baseline.sh- Run
scripts/detect_secrets_baseline.sh scanto generate/update.secrets.baseline. - Run
scripts/detect_secrets_baseline.sh auditto mark each detected item as a real secret or a false positive. - Commit the updated
.secrets.baseline.
Add per-repo file exclusion patterns to .detect-secrets-ignore (one regex per line). The scripts/detect_secrets_baseline.sh script already excludes node_modules, dist, build, .git, and a few other standard paths.
This application is designed to work in AWS. It needs an S3 bucket that holds the source code and a cloudfront to serve it. Any data bucket it is meant to read needs its own cloudfront set up. Terraform is used to create the s3-bucket and the cloudfront.
- Edit the bucketEndpoints object inside bucketEndpoints.js with the endpoints s3-browser should traverse.
- Edit webpack.config.js with the location url at which the app will be deployed. The default is set to /data in other words
https://<site>/data. EditPUBLIC_PATH: '/data/',publicPath: '/data/',index: '/data/index.html'with your expected path. - Run
npm run build. This will create the distribution code in the /dist directory. This is what will need to be uploaded to the s3-bucket
The S3 bucket is managed by terraform. More details here. https://github.com/NASA-PDS/pds-tf-modules/blob/main/terraform/modules/s3/README.md
cd terraform- There are 3 backends that can be used -dev, -test, -prod. Run
terraform init -backend-config=backend-dev.hcl -lock=falsereplacingbackend-dev.hclwith the the correct environment. - If changing backend after init was already run add -reconfigure.
terraform init -reconfigure -backend-config=backend-dev.hcl -lock=false - Update the terraform.tfvars file with the expected values.
terraform validate- Plan the changes
terraform plan -var-file=terraform.tfvars -lock=falsereview the output to make sure the changes are expected. - Run
terraform apply -var-file=terraform.tfvars -lock=falseto apply the changes. - Login to the AWS Console with your AWS Account. Verify that the s3-bucket was created.
- Upload the distribution code in the /dist file from the build step into the s3-bucket.
- Run the cloudfront terraform at https://github.com/NASA-PDS/pds-mcp-infra/tree/main/terraform/cloudfront It will create the cloudfront environment and attach a policy to the s3 bucket that allows cloudfront to serve it.