Deployment preparations
Deploying the application
These instructions assume a clean build of CentOS 8 with none of the dependencies installed.
The instructions here have been tested for a server running CentOS 8
. However, all the app related configuration and deployment should be generally valid for any linux distribution. Install relevant dependencies based on respective distros.
Install NodeJS
- Requires NodeJS >= 16 (or any latest release)
- Install from here
# Install Node.js
sudo dnf -y module enable nodejs:16
sudo dnf -y install nodejs
Update the NPM package manager
sudo npm install -g npm
Clone the repo
git clone https://github.com/CEGRcode/stencil.git
Updating STENCIL dependencies
- Before deployment to a production environment, all STENCIL dependencies should be updated to reduce risk of using compromised repositories
- To get a list of packages that are outdated, execute the below command from the STENCIL project root directory
npm outdated
- From your project root directory, run the update command
npm update
cd stencil/backend
npm update
npm install
cd stencil/frontend
npm update
npm install
Updating dependencies sometimes breaks the app, which is expected and common software development. Refer the changelog for the packages that are updated to fix any issues.
More details on above command usage : npm docs
Update sampleData for POSTing to backend
The sampleData by default points to 'localhost'. This needs to be updated to the backend server name for proper access
This example uses the artemis.cac.cornell.edu DNS as an example
Update to HTTP (non-SSL secured)
find ~/stencil/backend/sampleData \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i ‘s/localhost:8081/artemics.cac.cornell.edu:8081/g’
grep -ri local ~/stencil/backend/sampleData
- Update to HTTPS (SSL secured)
find ~/stencil/backend/sampleData \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i ‘s|http://localhost:8081|https://artemis.cac.cornell.edu:8081|g’
grep -ri local ~/stencil/backend/sampleData
Learn More
- Getting started with Create React App documentation.
- To learn React, check out the React documentation.
- Code Splitting
- Analyzing the Bundle Size
- Making a Progressive Web App
- Advanced Configuration
- Deployment
build
fails to minify- Guide to install
node
(stable version) forCentOS
, here is a tutorial. - Guide to install
mongodb
on theCentOS
server.