Skip to content

Build Ipe For Dev and Prod

WindBeneathYourWings edited this page Dec 29, 2021 · 28 revisions

This document will explain how to build and deploy the ipe project to production. The document will also serve as a reference to deploy other independent projects using druid.

Clone github repo

git clone [email protected]:ng-druid/platform.git druid

Install npm dependencies

cd druid
npm install

Build druid core libraries

cd bin
chmod +x build.sh
./build.sh

Build client, server, and lambda application. Replace xxx with cloudfront distribution for client assets.

ng run ipe:build --deployUrl="https://xxx.cloudfront.net/"
ng run ipe:server --deployUrl="https://xxx.cloudfront.net/"
ng run ipe:lambda:dev  --deployUrl="https://xxx.cloudfront.net/"

Some background information on how the deployment is structured. The application is broken up into a express application and client side application. The client-side assets including all the JavaScript files will be placed on s3. There is a cloudfront edge distribution that makes those files publicly available. The application can run from the cloudfront distribution domain. However, doing so limits the application to only running in the browser. The second part of the deployment deploys a universal express application as a lambda. This enables the application to served from a lambda using server-side rendering for search optimization and supporting permalinks with preview content since the initial pages content will be physically rendered onto the page as html. Serving static assets from s3 significantly optimizes the application in contract to regenerating those assets with the lambda each and every time. The application also seems to run much more efficiently using cdn tom serve the assets linked to in the html responsible for the modern single page experience.

Clone this wiki locally