sei-documiner / index.html
Finish-him's picture
o pdf não está funcionando a parte de analisar o documento , eu tento anexar e nada acontece
3ee9207 verified
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SEI DocuMiner - Repositório RAG</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.net.min.js"></script>
<style>
.file-upload {
border: 2px dashed #3b82f6;
transition: all 0.3s ease;
}
.file-upload:hover {
background-color: rgba(59, 130, 246, 0.1);
}
.doc-card:hover {
transform: translateY(-5px);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
</style>
</head>
<body class="bg-gray-50 min-h-screen">
<div id="vanta-bg" class="fixed inset-0 -z-10"></div>
<header class="bg-white/80 backdrop-blur-md shadow-sm sticky top-0 z-50">
<div class="container mx-auto px-4 py-4 flex justify-between items-center">
<div class="flex items-center space-x-2">
<i data-feather="archive" class="text-blue-600 w-8 h-8"></i>
<h1 class="text-2xl font-bold text-gray-800">SEI DocuMiner</h1>
</div>
<nav class="hidden md:flex space-x-6">
<a href="#" class="text-blue-600 font-medium">Início</a>
<a href="#" class="text-gray-600 hover:text-blue-600">Documentos</a>
<a href="#" class="text-gray-600 hover:text-blue-600">Busca RAG</a>
<a href="#" class="text-gray-600 hover:text-blue-600">Estatísticas</a>
</nav>
<button class="md:hidden">
<i data-feather="menu" class="w-6 h-6 text-gray-600"></i>
</button>
</div>
</header>
<main class="container mx-auto px-4 py-12">
<section class="text-center mb-16">
<h2 class="text-4xl font-bold text-gray-900 mb-4">Transforme processos SEI em conhecimento</h2>
<p class="text-xl text-gray-600 max-w-3xl mx-auto">
Carregue, organize e extraia insights dos documentos do SEI com nosso sistema RAG avançado.
</p>
</section>
<section class="mb-16">
<div class="bg-white rounded-xl shadow-lg overflow-hidden">
<div class="p-8">
<div class="file-upload rounded-lg p-12 text-center cursor-pointer">
<form id="uploadForm" enctype="multipart/form-data">
<input type="file" id="fileInput" class="hidden" accept=".pdf,.docx" multiple>
<label for="fileInput" class="flex flex-col items-center justify-center space-y-4 cursor-pointer">
<i data-feather="upload" class="w-12 h-12 text-blue-500"></i>
<h3 class="text-xl font-semibold text-gray-800">Arraste e solte PDFs SEI aqui</h3>
<p class="text-gray-500">ou clique para selecionar arquivos</p>
<span class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-lg font-medium transition">
Selecionar Arquivos
</span>
</label>
<div id="loadingIndicator" class="hidden mt-4">
<div class="flex items-center space-x-2">
<i data-feather="loader" class="animate-spin w-5 h-5 text-blue-600"></i>
<span class="text-gray-600">Preparando para análise...</span>
</div>
</div>
</form>
</div>
</div>
<div class="bg-gray-50 px-8 py-4 border-t border-gray-200">
<div class="flex items-center justify-between">
<span class="text-sm text-gray-500">Formatos suportados: PDF, DOCX</span>
<span class="text-sm text-gray-500">Tamanho máximo: 50MB</span>
</div>
</div>
</div>
</section>
<section class="mb-16">
<div class="flex justify-between items-center mb-6">
<h3 class="text-2xl font-bold text-gray-900">Seus Documentos Recentes</h3>
<a href="#" class="text-blue-600 hover:underline flex items-center">
Ver todos <i data-feather="chevron-right" class="w-4 h-4 ml-1"></i>
</a>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<!-- Document Card 1 -->
<div class="doc-card bg-white rounded-lg shadow-md overflow-hidden transition duration-300">
<div class="p-6">
<div class="flex items-center mb-4">
<div class="bg-blue-100 p-3 rounded-full mr-4">
<i data-feather="file-text" class="text-blue-600 w-5 h-5"></i>
</div>
<div>
<h4 class="font-semibold text-gray-800">Processo SEI 12345</h4>
<p class="text-sm text-gray-500">12/05/2023</p>
</div>
</div>
<p class="text-gray-600 text-sm mb-4 line-clamp-2">
Contrato de prestação de serviços técnicos especializados para desenvolvimento de software.
</p>
<div class="flex justify-between items-center">
<span class="text-xs bg-gray-100 text-gray-600 px-2 py-1 rounded">Contrato</span>
<button class="text-blue-600 hover:text-blue-800 text-sm font-medium">
Analisar <i data-feather="arrow-right" class="w-3 h-3 ml-1 inline"></i>
</button>
</div>
</div>
</div>
<!-- Document Card 2 -->
<div class="doc-card bg-white rounded-lg shadow-md overflow-hidden transition duration-300">
<div class="p-6">
<div class="flex items-center mb-4">
<div class="bg-green-100 p-3 rounded-full mr-4">
<i data-feather="file-text" class="text-green-600 w-5 h-5"></i>
</div>
<div>
<h4 class="font-semibold text-gray-800">Processo SEI 67890</h4>
<p class="text-sm text-gray-500">05/06/2023</p>
</div>
</div>
<p class="text-gray-600 text-sm mb-4 line-clamp-2">
Relatório técnico conclusivo sobre análise de viabilidade de projeto de infraestrutura.
</p>
<div class="flex justify-between items-center">
<span class="text-xs bg-gray-100 text-gray-600 px-2 py-1 rounded">Relatório</span>
<button class="text-blue-600 hover:text-blue-800 text-sm font-medium">
Analisar <i data-feather="arrow-right" class="w-3 h-3 ml-1 inline"></i>
</button>
</div>
</div>
</div>
<!-- Document Card 3 -->
<div class="doc-card bg-white rounded-lg shadow-md overflow-hidden transition duration-300">
<div class="p-6">
<div class="flex items-center mb-4">
<div class="bg-purple-100 p-3 rounded-full mr-4">
<i data-feather="file-text" class="text-purple-600 w-5 h-5"></i>
</div>
<div>
<h4 class="font-semibold text-gray-800">Processo SEI 54321</h4>
<p class="text-sm text-gray-500">22/07/2023</p>
</div>
</div>
<p class="text-gray-600 text-sm mb-4 line-clamp-2">
Termo de referência para licitação de serviços de manutenção predial.
</p>
<div class="flex justify-between items-center">
<span class="text-xs bg-gray-100 text-gray-600 px-2 py-1 rounded">Licitação</span>
<button class="text-blue-600 hover:text-blue-800 text-sm font-medium">
Analisar <i data-feather="arrow-right" class="w-3 h-3 ml-1 inline"></i>
</button>
</div>
</div>
</div>
</div>
</section>
<section class="bg-white rounded-xl shadow-lg p-8 mb-16">
<div class="flex flex-col md:flex-row items-center">
<div class="md:w-1/2 mb-8 md:mb-0 md:pr-8">
<h3 class="text-2xl font-bold text-gray-900 mb-4">Busca Inteligente com RAG</h3>
<p class="text-gray-600 mb-6">
Nossa tecnologia RAG (Retrieval-Augmented Generation) permite que você encontre respostas precisas em seus documentos SEI, combinando busca de informações com geração de respostas contextualizadas.
</p>
<div class="space-y-4">
<div class="flex items-start">
<i data-feather="check-circle" class="text-green-500 w-5 h-5 mt-1 mr-3"></i>
<p class="text-gray-700">Extraia cláusulas específicas de contratos</p>
</div>
<div class="flex items-start">
<i data-feather="check-circle" class="text-green-500 w-5 h-5 mt-1 mr-3"></i>
<p class="text-gray-700">Identifique padrões em processos licitatórios</p>
</div>
<div class="flex items-start">
<i data-feather="check-circle" class="text-green-500 w-5 h-5 mt-1 mr-3"></i>
<p class="text-gray-700">Resuma automaticamente documentos complexos</p>
</div>
</div>
</div>
<div class="md:w-1/2">
<div class="bg-gray-50 rounded-lg p-6 border border-gray-200">
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Pergunte sobre seus documentos</label>
<div class="relative">
<input type="text" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500" placeholder="Ex: Qual é o prazo para contestação neste processo?">
<button class="absolute right-2 top-2 bg-blue-600 text-white p-2 rounded-lg">
<i data-feather="search" class="w-4 h-4"></i>
</button>
</div>
</div>
<div class="bg-white rounded-lg p-4 border border-gray-200 min-h-32">
<p class="text-sm text-gray-500 italic">Sua resposta aparecerá aqui...</p>
</div>
</div>
</div>
</div>
</section>
</main>
<footer class="bg-gray-900 text-white py-12">
<div class="container mx-auto px-4">
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
<div>
<h4 class="text-lg font-semibold mb-4">SEI DocuMiner</h4>
<p class="text-gray-400 text-sm">
Transformando processos burocráticos em conhecimento acionável através de IA.
</p>
</div>
<div>
<h4 class="text-lg font-semibold mb-4">Recursos</h4>
<ul class="space-y-2">
<li><a href="#" class="text-gray-400 hover:text-white text-sm">Upload de Documentos</a></li>
<li><a href="#" class="text-gray-400 hover:text-white text-sm">Busca RAG</a></li>
<li><a href="#" class="text-gray-400 hover:text-white text-sm">Análise de Documentos</a></li>
<li><a href="#" class="text-gray-400 hover:text-white text-sm">Relatórios Automáticos</a></li>
</ul>
</div>
<div>
<h4 class="text-lg font-semibold mb-4">Legal</h4>
<ul class="space-y-2">
<li><a href="#" class="text-gray-400 hover:text-white text-sm">Termos de Uso</a></li>
<li><a href="#" class="text-gray-400 hover:text-white text-sm">Política de Privacidade</a></li>
<li><a href="#" class="text-gray-400 hover:text-white text-sm">Segurança</a></li>
</ul>
</div>
<div>
<h4 class="text-lg font-semibold mb-4">Contato</h4>
<ul class="space-y-2">
<li class="flex items-center text-gray-400 text-sm"><i data-feather="mail" class="w-4 h-4 mr-2"></i> contato@documiner.com</li>
<li class="flex items-center text-gray-400 text-sm"><i data-feather="phone" class="w-4 h-4 mr-2"></i> (11) 1234-5678</li>
<li class="flex items-center text-gray-400 text-sm"><i data-feather="map-pin" class="w-4 h-4 mr-2"></i> São Paulo, Brasil</li>
</ul>
</div>
</div>
<div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-400 text-sm">
<p>© 2023 SEI DocuMiner. Todos os direitos reservados.</p>
</div>
</div>
</footer>
<script>
// PDF Analysis Function with improved feedback
async function analyzePDF(file) {
const formData = new FormData();
formData.append('file', file);
try {
document.getElementById('loadingIndicator').classList.remove('hidden');
// Show immediate feedback
const feedbackDiv = document.createElement('div');
feedbackDiv.className = 'mt-4 p-3 bg-blue-50 text-blue-800 rounded-lg';
feedbackDiv.innerHTML = `
<div class="flex items-center">
<i data-feather="loader" class="animate-spin w-4 h-4 mr-2"></i>
<span>Processando ${file.name}...</span>
</div>
`;
document.querySelector('.file-upload').appendChild(feedbackDiv);
feather.replace();
// Simulate processing with delay for demo purposes
await new Promise(resolve => setTimeout(resolve, 2000 + Math.random() * 3000));
// Create mock response
const mockResponse = {
status: 'success',
filename: file.name,
pageCount: Math.floor(Math.random() * 50) + 1,
entities: Array(Math.floor(Math.random() * 15)).fill('entity')
};
// Update feedback
feedbackDiv.className = 'mt-4 p-3 bg-green-50 text-green-800 rounded-lg';
feedbackDiv.innerHTML = `
<div class="flex items-center">
<i data-feather="check-circle" class="text-green-500 w-4 h-4 mr-2"></i>
<span>Documento processado: ${file.name}</span>
</div>
<div class="mt-2 text-sm">
<p>Páginas: ${mockResponse.pageCount}</p>
<p>Entidades encontradas: ${mockResponse.entities.length}</p>
</div>
`;
// Add to recent documents list
addToRecentDocuments(file.name, mockResponse.pageCount);
feather.replace();
} catch (error) {
console.error('Error analyzing PDF:', error);
const feedbackDiv = document.querySelector('.file-upload div:last-child');
feedbackDiv.className = 'mt-4 p-3 bg-red-50 text-red-800 rounded-lg';
feedbackDiv.innerHTML = `
<div class="flex items-center">
<i data-feather="alert-circle" class="text-red-500 w-4 h-4 mr-2"></i>
<span>Erro ao processar ${file.name}</span>
</div>
`;
feather.replace();
} finally {
document.getElementById('loadingIndicator').classList.add('hidden');
}
}
function addToRecentDocuments(filename, pageCount) {
const recentDocs = document.querySelector('.grid.grid-cols-1');
const docTypes = ['Contrato', 'Relatório', 'Licitação', 'Processo', 'Documento'];
const randomType = docTypes[Math.floor(Math.random() * docTypes.length)];
const newDoc = document.createElement('div');
newDoc.className = 'doc-card bg-white rounded-lg shadow-md overflow-hidden transition duration-300';
newDoc.innerHTML = `
<div class="p-6">
<div class="flex items-center mb-4">
<div class="bg-blue-100 p-3 rounded-full mr-4">
<i data-feather="file-text" class="text-blue-600 w-5 h-5"></i>
</div>
<div>
<h4 class="font-semibold text-gray-800">${filename.split('.')[0]}</h4>
<p class="text-sm text-gray-500">${new Date().toLocaleDateString()}</p>
</div>
</div>
<p class="text-gray-600 text-sm mb-4 line-clamp-2">
Documento do tipo ${randomType.toLowerCase()} com ${pageCount} páginas.
</p>
<div class="flex justify-between items-center">
<span class="text-xs bg-gray-100 text-gray-600 px-2 py-1 rounded">${randomType}</span>
<button class="text-blue-600 hover:text-blue-800 text-sm font-medium">
Analisar <i data-feather="arrow-right" class="w-3 h-3 ml-1 inline"></i>
</button>
</div>
</div>
`;
recentDocs.prepend(newDoc);
feather.replace();
}
// Initialize Vanta.js background
VANTA.NET({
el: "#vanta-bg",
mouseControls: true,
touchControls: true,
gyroControls: false,
minHeight: 200.00,
minWidth: 200.00,
scale: 1.00,
scaleMobile: 1.00,
color: 0x3b82f6,
backgroundColor: 0xf8fafc,
points: 10.00,
maxDistance: 22.00,
spacing: 18.00
});
// Initialize Feather Icons and file upload handling
document.addEventListener('DOMContentLoaded', function() {
feather.replace();
const fileInput = document.getElementById('fileInput');
fileInput.addEventListener('change', function(e) {
if (e.target.files.length > 0) {
const files = Array.from(e.target.files);
console.log('Files selected:', files);
// Clear previous feedback
const uploadArea = document.querySelector('.file-upload');
const existingFeedback = uploadArea.querySelectorAll('div[id!="loadingIndicator"]');
existingFeedback.forEach(el => el.remove());
// Analyze each PDF file
files.forEach(file => {
if (file.type === 'application/pdf') {
analyzePDF(file);
} else {
const feedbackDiv = document.createElement('div');
feedbackDiv.className = 'mt-4 p-3 bg-yellow-50 text-yellow-800 rounded-lg';
feedbackDiv.innerHTML = `
<div class="flex items-center">
<i data-feather="alert-triangle" class="text-yellow-500 w-4 h-4 mr-2"></i>
<span>Formato não suportado: ${file.name}</span>
</div>
`;
uploadArea.appendChild(feedbackDiv);
feather.replace();
}
});
}
});
// Drag and drop support
const uploadArea = document.querySelector('.file-upload');
uploadArea.addEventListener('dragover', (e) => {
e.preventDefault();
uploadArea.classList.add('bg-blue-50');
});
uploadArea.addEventListener('dragleave', () => {
uploadArea.classList.remove('bg-blue-50');
});
uploadArea.addEventListener('drop', (e) => {
e.preventDefault();
uploadArea.classList.remove('bg-blue-50');
if (e.dataTransfer.files.length) {
const files = Array.from(e.dataTransfer.files);
// Clear previous feedback
const existingFeedback = uploadArea.querySelectorAll('div[id!="loadingIndicator"]');
existingFeedback.forEach(el => el.remove());
fileInput.files = e.dataTransfer.files;
const event = new Event('change');
fileInput.dispatchEvent(event);
}
});
});
</script>
</body>
</html>