A streamlined document processing application built with .NET 8 Blazor Server that leverages AWS Bedrock AI for intelligent document analysis and summarization.
- π€ AI-Powered Processing: Integration with AWS Bedrock (Claude 3.5 Sonnet) for intelligent document summarization
- π Multi-Format Support: Process PDF documents with text extraction
- π€ Easy Upload: Drag-and-drop interface for document uploads
- βοΈ Flexible Storage: Support for both AWS S3 and local file storage
- π Secure Credentials: AWS Secrets Manager integration for database connection strings
- πΎ Database Support: Works with both SQL Server and PostgreSQL
- π Document Management: Track upload status, view summaries, and manage documents
- π Status Tracking: Real-time processing status (Pending, Processing, Processed, Failed)
Simple single-project Blazor Server architecture:
DPS/
βββ src/
βββ DocumentProcessor.Web/
βββ Components/ # Blazor components and pages
βββ Data/ # DbContext and database configuration
βββ Models/ # Document entity and enums
βββ Services/ # Business logic (AI, Storage, Processing)
βββ wwwroot/ # Static files (CSS, images)
- .NET 8.0 SDK or later
- SQL Server or PostgreSQL database
- AWS Account with:
- Bedrock access (Claude 3.5 Sonnet model)
- S3 bucket (optional, for cloud storage)
- Secrets Manager (for database credentials)
- AWS CLI configured with appropriate credentials
-
Clone the repository
git clone https://github.com/aws-samples/sample-document-processing-system.git cd .\sample-document-processing-system\
-
Configure AWS Credentials
Ensure your AWS credentials are configured:
aws configure
Or set environment variables:
export AWS_ACCESS_KEY_ID=your_access_key export AWS_SECRET_ACCESS_KEY=your_secret_key export AWS_DEFAULT_REGION=us-east-1
-
Set Up Database Credentials in AWS Secrets Manager
The application retrieves database credentials from AWS Secrets Manager. Create secrets with the following structure:
For PostgreSQL (secret name:
atx-db-modernization-atx-db-modernization-1-target):{ "username": "your_username", "password": "your_password", "host": "your-db-host.rds.amazonaws.com", "port": "5432" }For SQL Server (secret with description:
Password for RDS MSSQL used for MAM319.):{ "username": "your_username", "password": "your_password", "host": "your-db-host.rds.amazonaws.com", "port": "1433", "dbname": "your_database_name" } -
Configure Application Settings (Optional)
Update
src/DocumentProcessor.Web/appsettings.jsonfor local development fallback:{ "ConnectionStrings": { "DefaultConnection": "Server=localhost;Database=DocumentProcessor;Integrated Security=true;TrustServerCertificate=True;" }, "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } } } -
Run the application
cd src/DocumentProcessor.Web dotnet run -
Access the application
Navigate to
http://localhost:5197
- Drag-and-drop Interface: Easy file upload with visual feedback
- PDF Text Extraction: Automatic text extraction using PdfPig
- AI Summarization: Generate intelligent summaries using AWS Bedrock
- Document Classification: Categorize documents automatically
- Status Tracking: Monitor document processing status in real-time
The application supports two storage backends:
- Local File System: Documents stored in
uploads/directory - AWS S3: Cloud storage with automatic bucket management
Storage is configured automatically based on AWS credentials availability.
- SQL Server: Primary database support with Entity Framework Core
- PostgreSQL: Alternative database option for cloud deployments
- Automatic Migration: Database schema created automatically on first run
-
Backend:
- .NET 8 with C# 12
- ASP.NET Core Blazor Server
- Entity Framework Core 8
-
Frontend:
- Blazor Server-Side Rendering
- Bootstrap 5 for responsive UI
- Custom CSS for styling
-
Database:
- Microsoft SQL Server (EntityFrameworkCore.SqlServer 8.0.10)
- PostgreSQL support (via configuration)
-
Cloud Services:
- AWS Bedrock (Claude 3.5 Sonnet for AI processing)
- AWS S3 (Document storage)
- AWS Secrets Manager (Credential management)
-
Document Processing:
- PdfPig 0.1.11 (PDF text extraction)
- CsvHelper 33.1.0 (CSV processing)
src/DocumentProcessor.Web/
βββ Components/
β βββ Layout/
β β βββ MainLayout.razor # Main app layout
β β βββ NavMenu.razor # Navigation menu
β βββ Pages/
β βββ Home.razor # Main page with upload and document list
βββ Data/
β βββ AppDbContext.cs # Entity Framework DbContext
βββ Models/
β βββ Document.cs # Document entity with status enum
βββ Services/
β βββ AIService.cs # AWS Bedrock integration
β βββ DatabaseInfoService.cs # Database metadata
β βββ DocumentProcessingService.cs # Document processing logic
β βββ FileStorageService.cs # S3/local file storage
β βββ SecretsService.cs # AWS Secrets Manager
βββ wwwroot/
β βββ css/
β βββ app.css # Custom styles
βββ Program.cs # App configuration and startup
The application uses Claude 3.5 Sonnet v2 by default:
- Model ID:
anthropic.claude-3-5-sonnet-20241022-v2:0 - Region: Configured via AWS CLI or environment variables
- Max Tokens: 1024 for summaries
Local Storage (default fallback):
DocumentProcessor.Web/uploads/
AWS S3 Storage:
- Bucket:
document-processor-uploads-{accountId} - Auto-created if it doesn't exist
- Files organized by document ID
The app attempts to connect in this order:
- AWS Secrets Manager (PostgreSQL target secret)
- AWS Secrets Manager (SQL Server with "MAM319" description)
- Local connection string from appsettings.json
- AWS Secrets Manager: Database credentials never stored in code
- Secure File Storage: Documents stored with unique GUIDs
- Input Validation: File type and size validation
- SQL Injection Prevention: Parameterized queries via EF Core
- XSS Protection: Built-in Blazor security features
- Soft Deletes: Documents marked as deleted, not physically removed
Documents progress through the following states:
- Pending: Uploaded, waiting for processing
- Processing: Currently being analyzed by AI
- Processed: Successfully processed with summary available
- Failed: Processing encountered an error
The application is designed for AWS deployment:
- Database: RDS (SQL Server or PostgreSQL)
- Storage: S3 for document files
- Compute: Elastic Beanstalk, ECS, or EC2
- Credentials: Secrets Manager for sensitive data
Docker support can be added with a standard .NET 8 Dockerfile.
If you see database connection errors:
- Verify AWS Secrets Manager secrets are configured correctly
- Check AWS credentials have permissions to access Secrets Manager
- Fallback to local connection string in appsettings.json
If AI processing fails:
- Verify AWS region supports Bedrock
- Check IAM permissions include Bedrock access
- Ensure Claude model access is enabled in AWS console
If uploads fail:
- Check file size and format (PDF supported)
- Verify local uploads directory exists and is writable
- For S3: confirm S3 bucket permissions and AWS credentials
- Support for additional document formats (DOCX, TXT, images)
- Batch document processing
- Document search and filtering
- Export capabilities
- User authentication
- Document versioning
- Advanced AI analysis options
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
- Built with .NET 8
- AI powered by AWS Bedrock
- UI framework by Bootstrap
- PDF processing by PdfPig
Built with β€οΈ using .NET 8 and AWS Bedrock AI

