From 9ba439abefc4c62773cbddea044e4564c687c2e6 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Wed, 26 Nov 2025 22:04:17 -0800 Subject: [PATCH] Add web UI for document extraction, summarization, and indexing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Features: - Clean responsive interface with dark theme - File upload with drag-and-drop support - URL input for remote documents - Summary style selection (concise, bullet points, detailed, etc.) - Optional indexing to vector knowledge base - Real-time processing status - Tabbed results view (summary, full content, transcript) - Stats dashboard showing processing metrics 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- server.py | 665 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 661 insertions(+), 4 deletions(-) diff --git a/server.py b/server.py index d7aac35..6f0ed4f 100644 --- a/server.py +++ b/server.py @@ -20,7 +20,7 @@ from enum import Enum import httpx from fastapi import FastAPI, HTTPException, UploadFile, File, Form, BackgroundTasks from fastapi.middleware.cors import CORSMiddleware -from fastapi.responses import JSONResponse +from fastapi.responses import JSONResponse, HTMLResponse from pydantic import BaseModel, HttpUrl # Docling imports @@ -294,9 +294,666 @@ def extract_with_docling(file_path: Path, output_format: OutputFormat) -> tuple[ # ============== API Endpoints ============== -@app.get("/") -async def root(): - """Service info and health check""" +@app.get("/", response_class=HTMLResponse) +async def dashboard(): + """Web interface for document processing""" + html = """ + + + + + + Document Intelligence - Extract, Summarize, Index + + + +
+
+

Document Intelligence

+

Extract, summarize, and index documents into your knowledge base

+
+ +
+ +
+

📄 Input Source

+ +
+ + +
+ +
— or —
+ +
+
📁
+

Drop a file here or click to browse

+

PDF, DOCX, PPTX, XLSX, HTML, MD, TXT, EPUB, images, audio

+ +
+
+ + +
+
+ + +
+

⚙️ Processing Options

+ +
+ + +
+ +
+ + +
+ +
+ +
+ + +
+
+ + + +
+ + +
+
+

📊 Results

+
+ + + Processing... + + +
+
+ +
+
+
-
+
Pages
+
+
+
-
+
Tables
+
+
+
-
+
Figures
+
+
+
-
+
Characters
+
+
+ +
+ + + +
+ +
+
+ Processing... +
+
+
+
+ Loading content... +
+
+
+
+
+
+
+
+ +
+
+
""" + str(stats["documents_processed"]) + """
+
Documents Processed
+
+
+
""" + str(stats["pages_extracted"]) + """
+
Pages Extracted
+
+
+
""" + str(stats["audio_transcribed"]) + """
+
Audio Transcribed
+
+
+
+ + + + + """ + return HTMLResponse(content=html) + + +@app.get("/api/info") +async def api_info(): + """Service info (JSON API endpoint)""" return { "service": "Docling Service", "version": "1.0.0",