-
Notifications
You must be signed in to change notification settings - Fork 5
Setting Up PAPUA
This page will help you get the complete PAPUA system deployed via AWS Amplify. You can optionally deploy a standalone frontend with Github Pages. See more details and steps on the Github Pages Setup page.
Before you can start using PAPUA, make sure you have access to and are familiar with the following:
In order to take full advantage of project features, please ensure you have an existing Github account with access to your organization. The deployment and update process depends on updates to your fork of this repository.
PAPUA is built to take advantage of the AWS ecosystem of services. With a properly configured AWS account, deployment time for this MVP is less than 10 minutes. We do not currently support Azure, GCP, or on-prem deployments, please talk to us if this is a hard requirement for you.
The website that PAPUA displays is based on information entered in form.yml
, found in the repo. While we fully support making edits to the form directly in the browser, it is significantly easier to download form.yml
to your computer and edit locally. Any text editor will do, but we've taken some steps to make editing as easy as possible by including intellisense support. We recommend using an IDE like VSCode that can display intellisense hints.
Fork the project. You can hit the fork button on our repo, or click the button below to both fork and deploy the project.
Your fork is now configured to auto-deploy the master branch to your Amplify deployment.
Update the questions used in your state's PAPUA form by editing forms.yml and committing those changes to the master branch of your fork.
Update the state logo by dropping a .png file into public and committing that change to the master branch of your fork.
By default, this system will produce an hourly CSV of claim submissions. If you want to customize this, you can implement a "transformer" which will write claims in batches into your state's system. You can do this by adding a file to backend/functions/transformer/src/transformers/.ts where is your state's two-letter state abbreviation (CA, OR, etc).
Inside that file, implement a function like so:
// backend/functions/transformer/src/transformers/<state code>.ts
import { Transformer } from './index'
// Name this function the same name as your state code.
//
// cfg includes the hour/day of this run.
// claims includes an array of all JSON claims uploaded in the previous hour.
export const ca: Transformer = async (cfg, claims) => {
// TODO(you): write `claims` into your system.
return {}
}
You can this commit this file to the master branch in your fork, which will update your deployment on Amplify. To switch the backend transformer from the default (csv) to your state's () just update the STATE_CODE environment variable.
At this point, you can now reboot your Lambda to pick up this environment change by clicking on your backend environment and selecting Redeploy this version.
Redirect a subdomain from your state's website to this Amplify app. See details in the AWS custom domain documentation, specific configuration will depend on a few factors.