This is an internal project for Knowit. The project aims to create a tool to gauge the employees' skills and motivations through a web form, and to make the analyses based on the form available for the individual employees and managers.
This project requires npm. It also requires that AWS CLI and AWS CDK are installed. All custom scripts are written in bash script.
To use an AWS CLI sso profile, you need to run the sync_sso.py script before running our npm commands for deploying the backend. This script requires you to have boto3 installed on the python environment you use.
python sync_sso.py awscliprofilename
is the full command you need to run. This creates temporary credentials for the SSO profile, allowing npm run deploy to use those to perform calls to AWS.
To run the project locally:
- Clone the GitHub repo.
- Run
$ cd kompetansekartlegging-app
(or whatever you've chosen to name the project in the cloning process). - Run
$ ./install.sh
- Run
cd cdk
a. If you are using aws sso profiles you need to runpython sync_sso.py aws-cli-profile
after step 4 - Run
cdk bootstrap
- Create a cdk.context.json file
{
"ENV": "exampleenv"
}
- Add ENV to it. If you are deploying to a sandbox account, you can give it any value you want. These have to be unique, so you might get a conflict if it already exists on AWS. IF YOU ARE DEPLOYING TO PROD OR DEVELOPMENT the ENV value should be
prod
ordev
. - IF DEPLOYING TO PROD OR DEVELOPMENT: Add GOOGLE_ID, GOOGLE_SECRET and AZURE to it, where GOOGLE_ID is the GCP App Id, GOOGLE_SECRET is the GCP App secret key, and AZURE is the Azure AD metadata url
- Run
export AWS_PROFILE={aws cli profilename}
followed bynpm run deploy
andnpm run codegen
(Alternatively, go to root directory and run./deploybackend.sh full
). For most{aws cli profilename}=default
if you have not configured additional aws cli profiles. - Change directory to frontend and run
npm start
- Run
./deploybackend.sh
to deploy changes to the backend - Run
npm start
in frontend folder to run frontend locally
Production deployment instructions can be found here
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template
- Appsync Transformer for CDK: https://github.com/kcwinner/cdk-appsync-transformer
- Codegen inspiration: https://github.com/kcwinner/advocacy/tree/master/cdk-amplify-appsync-helpers
Documentation for the external API can be found at this projects Github Pages (kompetansekartlegging-app/docs
) or at this URL: https://apidocs.kompetanse.knowit.no