Public Benefits Studio's Document Extractor to automate document data extraction with AI and OCR.
Using your browser of choice, navigate to the CloudFront distribution URL to start using.
The requirements needed to deploy are...
You can mimic the steps in our Continuous Delivery GitHub Action.
The basic steps to accomplish this are...
- Build the backend.
- Build the frontend.
- Deploy using the Infrastructure as Code (IaC).
One username and password is supported currently. To set this up, do a deployment and then do the following...
- Generate an RSA private key. Use the PEM encoding. Upload it to AWS Secrets Manager with
private-key
in the name. - Generate a public key from the aforementioned private key. Use the PEM encoding. Upload it to AWS Secrets Manager with
public-key
in the name. - Come up with a username you want to use. Upload it to AWS Secrets Manager with
username
in the name. - Come up with a strong password you want to use. Do not store the plaintext version of the password in AWS Secrets Manager because it is not ideal and doesn't work anyway. From the
backend
folder, runecho 'import bcrypt;print(bcrypt.hashpw(b"<your password>", bcrypt.gensalt()).decode())' | uv run -
and replace<your password>
with the password you want to use. Upload what is printed out to AWS Secrets Manager withpassword
in the name.
To build the backend, execute...
cd ./backend/
uv sync
uv run build.py
The built artifact is backend/dist/lambda.zip
.
To build the frontend, execute...
cd ./ui/
npm ci
npm run build
The built artifact is in ui/dist/
.
The additional requirements needed to contribute towards development are...
cd ./ui/
npm install
npm run dev
- Navigate to the UI folder
- Install dependencies
- Start the development server
And it runs on http://localhost:1234
- Replace browser system alert messages with user-friendly error handling.
- Improve page transitions for smoother user experience.
- Display the uploaded filename in the UI.
- Add frontend unit tests
- As the project grows, consider using USWDS Sass for better CSS organization and customization.
We use pre-commit
to run some hooks on every commit. These
hooks do linting to ensure things are in a good spot before a commit is made. Please install pre-commit
and then
install the hooks.
pre-commit install
Most of the time any errors encountered by pre-commit are automatically fixed. Run git status
to see the fixed files,
run git add .
to add the fixes, and rerun the commit. You will need to manually fix any errors that are not
automatically fixed.