A Blazor Server application that provides AI-powered document summarization with support for multiple AI providers (OpenAI, Azure OpenAI, Claude).
-
Core Architecture
- Clean service-based architecture with dependency injection
- Abstraction layer for AI providers (IAISummarizationService)
- Document processing orchestrator for multiple file formats
- Settings persistence service
-
AI Provider Support
- OpenAI (GPT-4, GPT-3.5-turbo, etc.)
- Azure OpenAI Service
- Anthropic Claude (Claude 3 models)
- Google Gemini (infrastructure ready)
-
Document Processing
- PDF documents (via iText7)
- Word documents/DOCX (via DocumentFormat.OpenXml)
- Text files (.txt, .md, .log)
-
User Interface
- Main document upload and summarization page
- Settings page for AI provider configuration
- Document type selection (10 types including contracts, proposals, RFPs, etc.)
- Custom instruction support
- Real-time processing status
- Summary results display with metadata
-
Document Types Supported
- General documents
- Technical proposals
- Contracts
- Request for Proposals (RFPs)
- Tenders
- Compliance documents
- Financial reports
- Technical specifications
- Meeting minutes
- Research papers
- .NET 9.0 SDK
- API key for at least one AI provider (OpenAI, Azure OpenAI, or Claude)
-
Navigate to the project directory:
cd /Users/claude-cognativ/Projects/DocumentSummarizer -
Run the application:
dotnet run
-
Open your browser to the URL displayed (typically https://localhost:5001 or http://localhost:5000)
-
Configure an AI provider:
- Click on "Settings" in the navigation menu
- Add your AI provider credentials (API key, model name, etc.)
- Test the connection to verify settings
- Set as default provider
-
Summarize a document:
- Return to the home page
- Select a document file (PDF, DOCX, or TXT)
- Choose the appropriate document type
- Optionally add custom instructions
- Click "Generate Summary"
A sample contract is included in:
/Users/claude-cognativ/Projects/DocumentSummarizer/TestDocuments/sample-contract.txt
- API Key: Get from https://platform.openai.com/api-keys
- Model: gpt-4, gpt-3.5-turbo, gpt-4-turbo
- Recommended temperature: 0.3
- Recommended max tokens: 1000
- Endpoint: Your Azure OpenAI resource endpoint (e.g., https://your-resource.openai.azure.com/)
- API Key: From Azure Portal
- Model: Your deployment name (not the model name)
- Same temperature and token recommendations
- API Key: Get from https://console.anthropic.com/
- Model: claude-3-opus-20240229, claude-3-sonnet-20240229, claude-3-haiku-20240307
- Same temperature and token recommendations
DocumentSummarizer/
├── Components/
│ ├── Pages/
│ │ ├── Home.razor # Main document upload/summarization page
│ │ ├── Settings.razor # AI provider configuration
│ │ └── Error.razor
│ ├── Layout/
│ │ ├── MainLayout.razor
│ │ └── NavMenu.razor
│ └── App.razor
├── Models/
│ ├── AIProvider.cs # Enum of supported providers
│ ├── AIProviderSettings.cs # Provider configuration model
│ ├── AppSettings.cs # Application settings model
│ ├── DocumentType.cs # Enum of document types
│ ├── SummarizationRequest.cs # Request model
│ └── SummarizationResult.cs # Result model
├── Services/
│ ├── IAISummarizationService.cs # AI service interface
│ ├── OpenAISummarizationService.cs # OpenAI implementation
│ ├── AzureOpenAISummarizationService.cs # Azure OpenAI implementation
│ ├── ClaudeSummarizationService.cs # Claude implementation
│ ├── AISummarizationServiceFactory.cs # Service factory
│ ├── IDocumentProcessingService.cs # Document processor interface
│ ├── PdfDocumentProcessor.cs # PDF processing
│ ├── WordDocumentProcessor.cs # DOCX processing
│ ├── TextDocumentProcessor.cs # Text file processing
│ ├── DocumentProcessingOrchestrator.cs # Processing coordinator
│ └── SettingsService.cs # Settings persistence
├── TestDocuments/
│ └── sample-contract.txt
├── Program.cs # Application entry point with DI setup
├── appsettings.json # Application configuration
└── DocumentSummarizer.csproj # Project file
Settings storage: /Users/claude-cognativ/Projects/DocumentSummarizer/AppData/appsettings.user.json
- Document upload (PDF, DOCX, TXT)
- Text extraction from all supported formats
- AI-powered summarization with provider selection
- Document type-aware prompts (10 types)
- Custom instruction support
- API key configuration and testing
- Settings persistence
- Multiple provider support
- Real-time processing feedback
- Error handling and user feedback
-
Production Readiness
- Add comprehensive error handling edge cases
- Implement proper logging throughout
- Add unit and integration tests
- Security hardening (API key encryption at rest)
- Rate limiting and request throttling
-
UI/UX Polish
- Improve styling and visual design
- Add drag-and-drop file upload
- Better mobile responsiveness
- Copy-to-clipboard for summaries
- Download summary as file
-
Advanced Features
- Document history and saved summaries
- Batch processing of multiple documents
- Comparison between different AI provider results
- Cost tracking and usage analytics
- Support for larger documents (chunking strategy)
- OCR for image-based PDFs
- Additional file formats (PPT, Excel, etc.)
-
Enterprise Features
- User authentication and authorization
- Multi-tenant support
- Database persistence (replace file-based settings)
- API endpoint for programmatic access
- Audit logging
- Admin dashboard
- Maximum file size: 10 MB (configurable in settings)
- Image-based PDFs not supported (no OCR)
- Very large documents may exceed token limits
- No batch processing capability yet
- Settings stored in plain JSON file (not production-ready for API keys)
- Framework: .NET 9.0
- Render Mode: Blazor Server (Interactive Server)
- Build Status: Successfully compiles with 0 warnings
- iText7 (8.0.5) - PDF processing
- DocumentFormat.OpenXml (3.1.0) - Word document processing
- Newtonsoft.Json (13.0.3) - JSON serialization
- ASP.NET Core 9.0 - Web framework