This project is the web interface (UI Application) that provides the front-end experience. The application is based on Reactjs framework and uses components from the AWS Cloudscape Design System
To build and run the application locally, the setup requires
- Nodejs 18.x or higher installed
Follow the below steps before building the web app for local execution
- The backend infrastructure stacks from
source/infrastructure
are deployed in your AWS account - Create a file
source/ui-deployment/public/runtimeConfig.json
(if one does not exist) by executing
mkdir -p source/ui-deployment/public
touch source/ui-deployment/public/runtimeConfig.json
- From the AWS CloudFormation console, navigate to the
Outputs
tab of the main/ parent stack deployed and copy theValue
of theKey
namedWebConfigKey
. - Navigate to AWS Systems Manager Parameter Store in the AWS web console, search for the
Key
in the previous step and copy the contents into the file created in the previous (step #2) steps (source/ui-deployment/public/runtimeConfig.json
)
For reference, the string in the Parameter Store should look something like the below:
{
"KnowledgeBaseParams": {
"kendra": {
"MaxQueryCapacityUnits": "1",
"DefaultNewKendraIndexName": "GAABKnowledgeBaseIndex",
"MaxNumberOfDocs": "100",
"DefaultStorageCapacityUnits": "0",
"AvailableEditions": [
"DEVELOPER_EDITION",
"ENTERPRISE_EDITION"
],
"MinNumberOfDocs": "1",
"MaxStorageCapacityUnits": "5",
"DefaultQueryCapacityUnits": "0",
"DefaultEdition": "DEVELOPER_EDITION",
"DefaultNumberOfDocs": "2"
}
},
"ApiEndpoint": "https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com/prod/",
"UserPoolClientId": "xxxxxxxxx",
"UserPoolId": "us-east-1_xxxxxxxxx",
"IsInternalUser": "false",
"AwsRegion": "us-east-1"
}
After completing the above steps, you can run the web application locally.
- From the project root directory, change directory to
source/ui-deployment
cd source/ui-deployment
- Install the library modules if building the project for the first time
npm install
- Building the project with the below command will generate a
build
folder which contains the compiled components and minified javascript files.
npm run build
- Executing the following command will run a local server on port 3000 (http://localhost:3000)
npm start
You should now be able to log in with the User Id and Password for which you should have received an email during deployment. You can also create additional users in the Amazon Cognito User Pool from the AWS web console.