Pivot is a web app for conducting Ranked Pairs elections
This repo is split into:
- nodejs v 10+
- npm
- Python 3.6+
- An AWS Account
- Create an Access Key
- Put your access key in ~/.aws/credentials (example)
- Populate ~/.aws/config with a region and an output (example)
Clone this repo.
$ git clone <clone url here>
cd ui
npm install
npm run build
cd ../infrastructure
npm install
npx cdk bootstrap
npx cdk deploy
# copy the API Gateway URL from the output to your clipboard
# ex: https://1234567890.execute-api.us-east-2.amazonaws.com/prod/
cd ../ui
# copy the example ui config to public/config.json
# (this path is ignored in ui/.gitignore)
cp config.example.json public/config.json
# paste the API Gateway URL from your clipboard into the config file
vim public/config.json
# verify locally
npm run serve
# visit the local URL
# ex: https://localhost:8080
# verify in the cloud
#rebuild the ui
npm run build
cd ../infrastructure
npx cdk deploy
# copy the cloudfront hostname from the output to your clipboard
# ex: 1234567890.cloudfront.net
# visit the remote URL
# ex: https://1234567890.cloudfront.net
cd infrastructure
npx cdk destroy
Additional documentation is available in each directory: