Skip to content

Navigation Menu

Sign in
Sign up

Latest commit

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

📄 Intelligent Document Processing Engine

AWS SAM Python 3.11 License: MIT

Overview

A fully serverless document processing pipeline built on AWS. Upload PDFs or images to S3 — Lambda automatically triggers AWS Textract for OCR — extracted text is stored in DynamoDB — and SNS notifications alert downstream consumers when processing completes.

Designed with event-driven architecture, IAM least-privilege policies, and infrastructure-as-code via AWS SAM.

Architecture

[S3 Upload] → [Lambda: ProcessDocument] → [AWS Textract]
 ↓
[API Gateway] ← [Lambda: GetDocument] ← [DynamoDB: Results]
 ↓
 [SNS Notification]

Features

  • Event-driven S3 triggers — automatic processing on file upload
  • AWS Textract OCR — extract text from PDFs, images, and scanned documents
  • DynamoDB storage — document metadata and extracted text with TTL cleanup
  • REST API — retrieve documents and results via API Gateway
  • SNS notifications — real-time alerts on processing completion or failure
  • IAM least-privilege — each Lambda gets only the permissions it needs
  • Pagination support — efficiently list large document collections
  • X-Ray tracing — built-in observability for all Lambda functions

API Endpoints

Method Endpoint Description
GET /documents List all processed documents
GET /documents/{documentId} Get document details and results

Deployment

Prerequisites

Deploy

sam build
sam deploy --guided

On first deploy, SAM will walk you through configuration (stack name, region, etc.). Subsequent deploys use the saved samconfig.toml.

Upload a Document

aws s3 cp my-document.pdf s3://<DocumentsBucketName>/uploads/my-document.pdf

Project Structure

intelligent-doc-engine/
├── template.yaml # SAM infrastructure template
├── samconfig.toml # Deployment configuration
├── handlers/
│ ├── __init__.py
│ ├── process_document.py # S3 trigger → Textract
│ ├── store_results.py # Textract results → DynamoDB
│ ├── get_document.py # GET /documents/{id}
│ ├── list_documents.py # GET /documents
│ └── requirements.txt
├── tests/
│ └── test_process_document.py
├── README.md
└── LICENSE

Testing

pip install pytest boto3
pytest tests/ -v

AWS Free Tier

This project is designed to stay within the AWS Free Tier for low-volume usage:

Service Free Tier Allowance
Lambda 1M requests / 400,000 GB-seconds
DynamoDB 25 GB storage / 25 RCU / 25 WCU
S3 5 GB storage / 20,000 GET requests
Textract 1,000 pages/month (first 3 months)
SNS 1M publishes / 100,000 HTTP delivers
API Gateway 1M REST API calls/month

Note: Textract free tier is limited to the first 3 months. Monitor usage in the AWS Billing Dashboard.

Author

Kushal Pitaliya

License

This project is licensed under the MIT License — see the LICENSE file for details.

About

Serverless document processing pipeline — S3 → Lambda → AWS Textract → DynamoDB → SNS. Built with AWS SAM, IAM least-privilege, and event-driven architecture.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /