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:
$ cd kompetansekartlegging-app
(or whatever you've chosen to
name the project in the cloning process)$ ./install.sh
cd cdk
python sync_sso.py aws-cli-profile
aws configure
followed by either export AWS_PROFILE={aws cli profilename}
on Linux/macOS or set AWS_PROFILE={aws cli profilename}
on Windows, where {aws cli profilename}=default
if you have not configured additional profilescdk bootstrap
ENV
key:
ENV
any value you want, but it has to be unique, so you might get a conflict if it already exists on AWSENV
value must be dev
or prod
. You also need to add an AZURE
key (Azure AD metadata url)
{
"ENV": "exampleenv"
}
npm run deploy
followed by npm run codegen
(Alternatively, go to root directory and run ./deploybackend.sh full
)cd ../frontend
followed by npm start
./deploybackend.sh
to deploy changes to the backendnpm start
in frontend folder to run frontend locallyscripts/create_test_data.py
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testsnpm run lint
run ESLint and Prettier checknpm run lint-fix
fix auto-fixable lint and formatting errorscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template./test.sh
installs test dependencies and runs testsGitHub Actions is configured to deploy the app to the AWS dev environment on every PR merge. This will be skipped if there are only changes to certain files like readmes, and are specified in .github/workflows/deploy.yml
.
Additionally, deployment can be triggered through the dispatchable workflow "Deploy to AWS
", where you specify which environment to deploy to, and whether to deploy the entire app or the backend only.
ESLint and Prettier is configured for the frontend code using recommended rules. GitHub Actions analyzes the code when PRs towards the main branch are opened.
Tests run on every pull request towards the main branch.
When deploying to both the dev and production environments, a bot will post to a channel using Slack Apps and the Slack Notify action.
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