File size: 22,868 Bytes
28c6c44
 
 
 
 
3ee9207
 
28c6c44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3ee9207
 
28c6c44
 
 
 
 
 
 
 
 
 
 
 
 
 
3ee9207
28c6c44
3ee9207
28c6c44
3ee9207
28c6c44
 
 
 
 
6e9d77b
 
 
 
3ee9207
 
 
6e9d77b
 
 
3ee9207
 
 
 
 
 
 
28c6c44
6e9d77b
28c6c44
 
3ee9207
 
 
28c6c44
 
 
 
 
 
3ee9207
 
28c6c44
 
 
 
 
 
 
 
 
 
 
 
 
3ee9207
28c6c44
 
 
 
3ee9207
28c6c44
 
3ee9207
 
28c6c44
 
 
 
 
 
 
 
 
 
 
 
 
 
3ee9207
28c6c44
 
 
 
3ee9207
28c6c44
 
3ee9207
 
28c6c44
 
 
 
 
 
 
 
 
 
 
 
 
 
3ee9207
28c6c44
 
 
 
3ee9207
28c6c44
 
3ee9207
 
28c6c44
 
 
 
 
 
 
 
 
 
 
3ee9207
28c6c44
3ee9207
28c6c44
 
 
 
3ee9207
28c6c44
 
 
3ee9207
28c6c44
 
 
3ee9207
28c6c44
 
3ee9207
28c6c44
 
 
3ee9207
 
 
 
28c6c44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3ee9207
28c6c44
3ee9207
28c6c44
 
 
3ee9207
 
 
 
 
28c6c44
 
 
 
 
 
 
 
 
 
 
 
 
3ee9207
 
 
28c6c44
 
 
 
 
 
 
 
 
3ee9207
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208c09c
3ee9207
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6e9d77b
28c6c44
 
 
 
 
 
 
 
 
 
 
 
 
6e9d77b
28c6c44
 
6e9d77b
 
 
 
 
3ee9207
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6e9d77b
3ee9207
6e9d77b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3ee9207
 
 
 
 
 
1df57b4
 
 
 
6e9d77b
3ee9207
6e9d77b
28c6c44
157be1b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
<!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>