{"id":51167090,"url":"https://github.com/navapbc/strata-documentai-api-enterprise","last_synced_at":"2026-06-26T20:30:24.907Z","repository":{"id":362775339,"uuid":"1247015402","full_name":"navapbc/strata-documentai-api-enterprise","owner":"navapbc","description":"Application to identify and extract data from documents","archived":false,"fork":false,"pushed_at":"2026-06-23T02:29:51.000Z","size":17291,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-23T03:13:34.042Z","etag":null,"topics":["caseworker-toolkit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/navapbc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-22T20:06:59.000Z","updated_at":"2026-06-23T02:29:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/navapbc/strata-documentai-api-enterprise","commit_stats":null,"previous_names":["navapbc/strata-documentai-api-enterprise"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/navapbc/strata-documentai-api-enterprise","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navapbc%2Fstrata-documentai-api-enterprise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navapbc%2Fstrata-documentai-api-enterprise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navapbc%2Fstrata-documentai-api-enterprise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navapbc%2Fstrata-documentai-api-enterprise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/navapbc","download_url":"https://codeload.github.com/navapbc/strata-documentai-api-enterprise/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navapbc%2Fstrata-documentai-api-enterprise/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34832916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-26T02:00:06.560Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["caseworker-toolkit"],"created_at":"2026-06-26T20:30:23.620Z","updated_at":"2026-06-26T20:30:24.898Z","avatar_url":"https://github.com/navapbc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp\u003e\n  \u003cimg src=\"docs/documentai-api/media/Nava-Strata-Logo-V02.svg\" alt=\"Nava Strata\" width=\"400\"\u003e\n\u003c/p\u003e\n\u003cp\u003e\u003ci\u003eOpen source tools for every layer of government service delivery.\u003c/i\u003e\u003c/p\u003e\n\u003cp\u003e\u003cb\u003eStrata is a gold-standard target architecture and suite of open-source tools that gives government agencies everything they need to run a modern service.\u003c/b\u003e\u003c/p\u003e\n\n\u003ch4 align=\"center\"\u003e\n  \u003ca href=\"https://github.com/navapbc/strata-documentai-api-enterprise/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-apache_2.0-red\" alt=\"Nava Strata is released under the Apache 2.0 license\" \u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/navapbc/strata-documentai-api-enterprise/blob/main/CONTRIBUTING.md\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/PRs-Welcome-brightgreen\" alt=\"PRs welcome!\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/navapbc/strata-documentai-api-enterprise/commits/main\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/commit-activity/m/navapbc/strata-documentai-api-enterprise\" alt=\"git commit activity\" /\u003e\n  \u003c/a\u003e\n\u003c/h4\u003e\n\n# DocumentAI API\n\nOpen source tools for document processing and intelligent data extraction. \n\nDocumentAI API is a serverless document processing platform that helps teams upload documents, extract structured data, manage tenants and API keys, and review results through an admin console for operating document extraction workflows.\n\nThis repository is a complete DocumentAI API application. It includes the API, admin UI, infrastructure, documentation, and deployment scripts needed to run the platform in AWS.\n\nFor Strata template applications, see [`navapbc/strata`](https://github.com/navapbc/strata).\n\n\u003e ⚠️ **Public Preview / Active Development (June 2026)**\n\u003e This project is under active development, but is being designed for out-of-the-box use. APIs, configuration, and features may change.\n\n## Features\n\n- API for uploading, identifying, and extracting data from document files\n- Serverless FastAPI application deployed on AWS Lambda\n- Document processing with Bedrock Data Automation\n- Multi-tenant API key authentication and authorization\n- Admin console for managing tenants, users, API keys, and extraction rules\n- Terraform infrastructure for the full serverless stack\n- Metrics pipeline for document processing and platform usage\n- Cognito-backed admin authentication with MFA and Google SSO support\n\n## Getting Started\n### Repo structure\n```\n├── documentai-api/     # Python API using FastAPI on Lambda\n├── ui/\n│   ├── shared/         # Shared services, utils, and styles\n│   ├── admin/          # Admin console (vanilla JS SPA)\n│   └── demo/           # Demo UI (upload + extraction with bbox overlay)\n├── infra/              # Terraform infrastructure\n├── docs/               # Architecture diagrams and specs\n├── .github/            # CI/CD workflows\n└── Makefile            # Commands for setup, deploy, and teardown\n```\n\n### Requirements\n\nBefore getting started, install and configure:\n\n- AWS CLI\n- Terraform 1.10 or newer\n- Docker\n- Node.js 18 or newer\n- Python 3.11 or newer with [uv](https://github.com/astral-sh/uv)\n\nYou will also need an AWS profile with permission to create the required infrastructure.\n\n### Setup\n\nTo set up the application for the first time:\n\n1. Configure your AWS profile.\n\n```bash\nexport AWS_PROFILE=your-profile\n```\n\n2. Create the Terraform state bucket. This only needs to happen once per environment.\n\n```bash\ncd infra\nmake infra-bootstrap ENVIRONMENT=dev\nmake infra-init ENVIRONMENT=dev\n```\n\n3. Deploy the infrastructure and admin UI.\n\n```bash\ncd ..\nmake deploy\n```\n\nThe deploy command builds the API, applies the Terraform infrastructure, builds the admin UI, uploads it to S3, and updates CloudFront. The admin UI configuration is generated automatically during deployment.\n\n### Local development\n\n#### API\n\nTo run the API locally with Docker:\n\n```bash\ncd documentai-api\ncp local.env.example .env\nmake init\nmake start\n```\n\nThe API will run at `localhost:8000`.\n\nTo run without Docker:\n\n```bash\nmake init-local\nexport RUN_CMD_APPROACH=local\nmake start-local\n```\n\n#### Admin UI\n\n```bash\ncd ui/admin\nnpm install\ncp config.example.json config.json\nnpm run dev\n```\n\nThe admin UI will run at `localhost:3000`. If you have not deployed the infrastructure yet, update `ui/admin/config.json` with the API endpoint and Cognito values you want to use.\n\n#### Demo UI\n\n```bash\ncd ui/demo\nnpm install\ncp config.example.json config.json\nnpm run dev\n```\n\nThe demo UI will run at `localhost:3001`. It provides document upload and extraction with bounding box overlay - no admin features.\n\n### Deploy\n\nFrom the repository root:\n\n```bash\nmake deploy\n```\n\nYou can also deploy pieces separately:\n\n```bash\nmake deploy-infra\nmake deploy-ui\n```\n\nTo use a specific environment or AWS profile:\n\n```bash\nmake deploy ENVIRONMENT=dev AWS_PROFILE=my-profile\n```\n\u003e **Note**: Region is configured in `infra/environments/\u003cenv\u003e/terraform.tfvars`. The state bucket is created in `us-east-1` by default.\n\nOnly the `dev` environment exists today. To add another environment, copy `infra/environments/dev/` and update its `terraform.tfvars`.\n\n### Teardown\n\nTo remove the deployed infrastructure:\n\n```bash\ncd infra\nmake infra-destroy ENVIRONMENT=dev\n```\n\n## Components\n\n### documentai-api/\n\nFastAPI application deployed as a Lambda container. Handles document upload and processing via Bedrock Data Automation, multi-tenant API key authentication, extraction rule configuration, and metrics collection.\n\n```bash\ncd documentai-api\nmake start        # Local development server (Docker)\nmake test         # Run pytest suite\nmake test-e2e     # Run e2e suite\nmake lint         # Ruff + mypy\n```\n\n\u003e [!NOTE]\n\u003e The `e2e` and `integration` test suites run against **synthetic, fake sample documents**\n\u003e that contain no real data. See\n\u003e [test-documents/README.md](documentai-api/tests/helpers/fixtures/test-documents/README.md)\n\u003e for details on the test data and how to report a concern.\n\n### ui/admin/\n\nSingle-page admin console for managing the platform. Features API key lifecycle management, tenant and user management with role-based access, extraction rule editor, document viewer, and Cognito auth with TOTP MFA.\n\n```bash\ncd ui/admin\nnpm run dev       # Dev server at localhost:3000\nnpm test          # Unit tests (Vitest)\nnpm run test:e2e  # e2e tests (Playwright)\n```\n\n### ui/demo/\n\nMinimal demo app for uploading documents and viewing extraction results with bounding box overlays. Same Cognito auth, auto-scoped to the user's tenant.\n\n```bash\ncd ui/demo\nnpm run dev       # Dev server at localhost:3001\nnpm test          # Unit tests (Vitest)\n```\n\n### infra/\n\nTerraform modules for the complete serverless stack. See [infra/README.md](infra/README.md) for the full module list and usage.\n\n```bash\ncd infra\nmake infra-plan   # Terraform plan\nmake infra-apply  # Terraform apply\n```\n\n## Architecture\n\nAt a high level:\n\n1. A client uploads a document through the API Gateway to Lambda.\n2. The document is stored in S3 and metadata in DynamoDB.\n3. EventBridge triggers the document processor Lambda.\n4. The processor invokes Bedrock Data Automation with a tenant-specific blueprint.\n5. BDA writes results to S3.\n6. The result processor Lambda extracts fields and updates DynamoDB.\n7. Metrics are emitted to SQS, processed into Parquet via Glue, and stored in S3.\n\nThe system follows an event-driven architecture:\n\n![Architecture diagram](docs/documentai-api/media/architecture.svg)\n\nThe diagram source lives in [`architecture.mmd`](docs/documentai-api/diagrams/architecture.mmd).\n\n## Auth\n\n- **API clients**: `API-Key` header, DynamoDB-backed and tenant-scoped\n- **Admin users**: Cognito JWT with super-admin or tenant-admin roles\n- **Google SSO**: Optional federated sign-in via Cognito (admin + demo UIs)\n- **Dual auth**: Endpoints support both via `get_user_context_with_fallback`\n\n## Contributing\n\nFor more information about our contribution guidelines, see\n[CONTRIBUTING.md](CONTRIBUTING.md). All contributors are expected to follow our\n[Code of Conduct](CODE_OF_CONDUCT.md).\n\n## License\n\nThis project is licensed under the Apache 2.0 License. See the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavapbc%2Fstrata-documentai-api-enterprise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavapbc%2Fstrata-documentai-api-enterprise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavapbc%2Fstrata-documentai-api-enterprise/lists"}