Spaces:
Running
Running
Add 3 files
Browse files- README.md +7 -5
- index.html +657 -19
- prompts.txt +1 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: deepsite-draft-1
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: purple
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,657 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>AI Knowledge Base Server</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
|
| 10 |
+
<style>
|
| 11 |
+
.gradient-bg {
|
| 12 |
+
background: linear-gradient(135deg, #6e8efb, #a777e3);
|
| 13 |
+
}
|
| 14 |
+
.knowledge-card {
|
| 15 |
+
transition: all 0.3s ease;
|
| 16 |
+
border-left: 4px solid #6e8efb;
|
| 17 |
+
}
|
| 18 |
+
.knowledge-card:hover {
|
| 19 |
+
transform: translateY(-5px);
|
| 20 |
+
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
|
| 21 |
+
}
|
| 22 |
+
.file-upload {
|
| 23 |
+
border: 2px dashed #a777e3;
|
| 24 |
+
transition: all 0.3s ease;
|
| 25 |
+
}
|
| 26 |
+
.file-upload:hover {
|
| 27 |
+
background-color: rgba(167, 119, 227, 0.1);
|
| 28 |
+
}
|
| 29 |
+
.sidebar {
|
| 30 |
+
transition: all 0.3s ease;
|
| 31 |
+
}
|
| 32 |
+
.sidebar-item:hover {
|
| 33 |
+
background-color: rgba(255,255,255,0.1);
|
| 34 |
+
}
|
| 35 |
+
.pulse-animation {
|
| 36 |
+
animation: pulse 2s infinite;
|
| 37 |
+
}
|
| 38 |
+
@keyframes pulse {
|
| 39 |
+
0% { box-shadow: 0 0 0 0 rgba(110, 142, 251, 0.7); }
|
| 40 |
+
70% { box-shadow: 0 0 0 10px rgba(110, 142, 251, 0); }
|
| 41 |
+
100% { box-shadow: 0 0 0 0 rgba(110, 142, 251, 0); }
|
| 42 |
+
}
|
| 43 |
+
.auth-modal {
|
| 44 |
+
transition: all 0.3s ease;
|
| 45 |
+
}
|
| 46 |
+
.auth-modal.hidden {
|
| 47 |
+
opacity: 0;
|
| 48 |
+
pointer-events: none;
|
| 49 |
+
}
|
| 50 |
+
.auth-modal:not(.hidden) {
|
| 51 |
+
opacity: 1;
|
| 52 |
+
}
|
| 53 |
+
</style>
|
| 54 |
+
</head>
|
| 55 |
+
<body class="bg-gray-100 font-sans">
|
| 56 |
+
<!-- Auth Modal -->
|
| 57 |
+
<div id="auth-modal" class="auth-modal fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
|
| 58 |
+
<div class="bg-white rounded-lg shadow-xl w-full max-w-md">
|
| 59 |
+
<div class="p-4 border-b border-gray-200 flex justify-between items-center">
|
| 60 |
+
<h3 class="text-lg font-semibold" id="auth-modal-title">Sign In</h3>
|
| 61 |
+
<button id="close-auth-modal" class="text-gray-500 hover:text-gray-700">
|
| 62 |
+
<i class="fas fa-times"></i>
|
| 63 |
+
</button>
|
| 64 |
+
</div>
|
| 65 |
+
|
| 66 |
+
<div class="p-6">
|
| 67 |
+
<div id="auth-tabs" class="flex border-b border-gray-200 mb-6">
|
| 68 |
+
<button class="auth-tab px-4 py-2 font-medium text-purple-600 border-b-2 border-purple-600" data-tab="signin">Sign In</button>
|
| 69 |
+
<button class="auth-tab px-4 py-2 font-medium text-gray-500 hover:text-gray-700" data-tab="signup">Sign Up</button>
|
| 70 |
+
<button class="auth-tab px-4 py-2 font-medium text-gray-500 hover:text-gray-700" data-tab="forgot">Forgot Password</button>
|
| 71 |
+
</div>
|
| 72 |
+
|
| 73 |
+
<!-- Sign In Form -->
|
| 74 |
+
<div id="signin-form" class="auth-form">
|
| 75 |
+
<div class="mb-4">
|
| 76 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Email</label>
|
| 77 |
+
<input type="email" id="signin-email" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 78 |
+
</div>
|
| 79 |
+
<div class="mb-6">
|
| 80 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Password</label>
|
| 81 |
+
<input type="password" id="signin-password" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 82 |
+
</div>
|
| 83 |
+
<button id="signin-btn" class="w-full gradient-bg text-white py-2 px-4 rounded-md font-medium mb-4">
|
| 84 |
+
Sign In
|
| 85 |
+
</button>
|
| 86 |
+
<div class="text-center text-sm text-gray-500">
|
| 87 |
+
Or sign in with
|
| 88 |
+
</div>
|
| 89 |
+
<div class="flex justify-center space-x-4 mt-4">
|
| 90 |
+
<button id="google-signin" class="p-2 border border-gray-300 rounded-full hover:bg-gray-50">
|
| 91 |
+
<i class="fab fa-google text-red-500"></i>
|
| 92 |
+
</button>
|
| 93 |
+
<button id="github-signin" class="p-2 border border-gray-300 rounded-full hover:bg-gray-50">
|
| 94 |
+
<i class="fab fa-github text-gray-800"></i>
|
| 95 |
+
</button>
|
| 96 |
+
</div>
|
| 97 |
+
</div>
|
| 98 |
+
|
| 99 |
+
<!-- Sign Up Form -->
|
| 100 |
+
<div id="signup-form" class="auth-form hidden">
|
| 101 |
+
<div class="mb-4">
|
| 102 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Email</label>
|
| 103 |
+
<input type="email" id="signup-email" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 104 |
+
</div>
|
| 105 |
+
<div class="mb-4">
|
| 106 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Password</label>
|
| 107 |
+
<input type="password" id="signup-password" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 108 |
+
</div>
|
| 109 |
+
<div class="mb-6">
|
| 110 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Confirm Password</label>
|
| 111 |
+
<input type="password" id="signup-confirm-password" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 112 |
+
</div>
|
| 113 |
+
<button id="signup-btn" class="w-full gradient-bg text-white py-2 px-4 rounded-md font-medium">
|
| 114 |
+
Create Account
|
| 115 |
+
</button>
|
| 116 |
+
</div>
|
| 117 |
+
|
| 118 |
+
<!-- Forgot Password Form -->
|
| 119 |
+
<div id="forgot-form" class="auth-form hidden">
|
| 120 |
+
<div class="mb-6">
|
| 121 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Email</label>
|
| 122 |
+
<input type="email" id="forgot-email" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 123 |
+
</div>
|
| 124 |
+
<button id="forgot-btn" class="w-full gradient-bg text-white py-2 px-4 rounded-md font-medium">
|
| 125 |
+
Send Reset Link
|
| 126 |
+
</button>
|
| 127 |
+
</div>
|
| 128 |
+
|
| 129 |
+
<div id="auth-message" class="mt-4 text-center text-sm hidden"></div>
|
| 130 |
+
</div>
|
| 131 |
+
</div>
|
| 132 |
+
</div>
|
| 133 |
+
|
| 134 |
+
<!-- Main App (hidden until authenticated) -->
|
| 135 |
+
<div id="app-container" class="hidden">
|
| 136 |
+
<div class="flex h-screen overflow-hidden">
|
| 137 |
+
<!-- Sidebar -->
|
| 138 |
+
<div class="sidebar w-64 bg-gray-900 text-white flex flex-col">
|
| 139 |
+
<div class="p-4 border-b border-gray-700">
|
| 140 |
+
<h1 class="text-2xl font-bold flex items-center">
|
| 141 |
+
<i class="fas fa-brain mr-2 text-purple-400"></i>
|
| 142 |
+
AI Knowledge Base
|
| 143 |
+
</h1>
|
| 144 |
+
<p class="text-gray-400 text-sm mt-1">Your centralized intelligence hub</p>
|
| 145 |
+
</div>
|
| 146 |
+
|
| 147 |
+
<div class="flex-1 overflow-y-auto">
|
| 148 |
+
<div class="p-4">
|
| 149 |
+
<h2 class="text-lg font-semibold text-gray-300 mb-2 flex items-center">
|
| 150 |
+
<i class="fas fa-folder-open mr-2 text-blue-400"></i>
|
| 151 |
+
Categories
|
| 152 |
+
</h2>
|
| 153 |
+
<ul id="categories-list" class="space-y-1">
|
| 154 |
+
<li class="sidebar-item px-3 py-2 rounded cursor-pointer bg-gray-800">
|
| 155 |
+
<i class="fas fa-code mr-2 text-green-400"></i>
|
| 156 |
+
Code Frameworks
|
| 157 |
+
</li>
|
| 158 |
+
<li class="sidebar-item px-3 py-2 rounded cursor-pointer">
|
| 159 |
+
<i class="fas fa-file-alt mr-2 text-yellow-400"></i>
|
| 160 |
+
Documentation
|
| 161 |
+
</li>
|
| 162 |
+
<li class="sidebar-item px-3 py-2 rounded cursor-pointer">
|
| 163 |
+
<i class="fas fa-chart-line mr-2 text-red-400"></i>
|
| 164 |
+
Analytics
|
| 165 |
+
</li>
|
| 166 |
+
<li class="sidebar-item px-3 py-2 rounded cursor-pointer">
|
| 167 |
+
<i class="fas fa-project-diagram mr-2 text-purple-400"></i>
|
| 168 |
+
Projects
|
| 169 |
+
</li>
|
| 170 |
+
</ul>
|
| 171 |
+
</div>
|
| 172 |
+
|
| 173 |
+
<div class="p-4 border-t border-gray-700">
|
| 174 |
+
<h2 class="text-lg font-semibold text-gray-300 mb-2 flex items-center">
|
| 175 |
+
<i class="fas fa-tags mr-2 text-blue-400"></i>
|
| 176 |
+
Popular Tags
|
| 177 |
+
</h2>
|
| 178 |
+
<div id="tags-list" class="flex flex-wrap gap-2">
|
| 179 |
+
<span class="sidebar-item px-2 py-1 rounded-full text-xs bg-gray-800 cursor-pointer">
|
| 180 |
+
#python
|
| 181 |
+
</span>
|
| 182 |
+
<span class="sidebar-item px-2 py-1 rounded-full text-xs bg-gray-800 cursor-pointer">
|
| 183 |
+
#ai
|
| 184 |
+
</span>
|
| 185 |
+
<span class="sidebar-item px-2 py-1 rounded-full text-xs bg-gray-800 cursor-pointer">
|
| 186 |
+
#flask
|
| 187 |
+
</span>
|
| 188 |
+
<span class="sidebar-item px-2 py-1 rounded-full text-xs bg-gray-800 cursor-pointer">
|
| 189 |
+
#machinelearning
|
| 190 |
+
</span>
|
| 191 |
+
</div>
|
| 192 |
+
</div>
|
| 193 |
+
|
| 194 |
+
<div class="p-4 border-t border-gray-700">
|
| 195 |
+
<h2 class="text-lg font-semibold text-gray-300 mb-2 flex items-center">
|
| 196 |
+
<i class="fas fa-cog mr-2 text-blue-400"></i>
|
| 197 |
+
AI Models
|
| 198 |
+
</h2>
|
| 199 |
+
<ul class="space-y-2">
|
| 200 |
+
<li class="sidebar-item px-3 py-2 rounded cursor-pointer flex items-center justify-between">
|
| 201 |
+
<div>
|
| 202 |
+
<i class="fas fa-robot mr-2 text-green-400"></i>
|
| 203 |
+
DeepSeek V3.1
|
| 204 |
+
</div>
|
| 205 |
+
<span class="text-xs bg-green-500 text-white px-2 py-1 rounded-full">Active</span>
|
| 206 |
+
</li>
|
| 207 |
+
<li class="sidebar-item px-3 py-2 rounded cursor-pointer flex items-center">
|
| 208 |
+
<i class="fas fa-robot mr-2 text-blue-400"></i>
|
| 209 |
+
Local LLM
|
| 210 |
+
</li>
|
| 211 |
+
</ul>
|
| 212 |
+
</div>
|
| 213 |
+
</div>
|
| 214 |
+
|
| 215 |
+
<div class="p-4 border-t border-gray-700">
|
| 216 |
+
<button id="upload-btn" class="w-full gradient-bg text-white py-2 px-4 rounded-lg font-medium flex items-center justify-center">
|
| 217 |
+
<i class="fas fa-cloud-upload-alt mr-2"></i>
|
| 218 |
+
Upload Knowledge
|
| 219 |
+
</button>
|
| 220 |
+
</div>
|
| 221 |
+
</div>
|
| 222 |
+
|
| 223 |
+
<!-- Main Content -->
|
| 224 |
+
<div class="flex-1 flex flex-col overflow-hidden">
|
| 225 |
+
<!-- Header -->
|
| 226 |
+
<header class="bg-white shadow-sm z-10">
|
| 227 |
+
<div class="flex items-center justify-between px-6 py-4">
|
| 228 |
+
<div class="flex items-center">
|
| 229 |
+
<div class="relative w-64">
|
| 230 |
+
<input type="text" placeholder="Search knowledge base..."
|
| 231 |
+
class="w-full pl-10 pr-4 py-2 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent">
|
| 232 |
+
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
|
| 233 |
+
</div>
|
| 234 |
+
</div>
|
| 235 |
+
|
| 236 |
+
<div class="flex items-center space-x-4">
|
| 237 |
+
<button class="pulse-animation gradient-bg text-white py-2 px-4 rounded-lg font-medium flex items-center">
|
| 238 |
+
<i class="fas fa-bolt mr-2"></i>
|
| 239 |
+
Train AI Model
|
| 240 |
+
</button>
|
| 241 |
+
<div id="user-menu" class="relative">
|
| 242 |
+
<button id="user-menu-button" class="flex items-center space-x-2 focus:outline-none">
|
| 243 |
+
<div class="h-8 w-8 rounded-full bg-purple-500 flex items-center justify-center text-white font-bold">
|
| 244 |
+
<i class="fas fa-user"></i>
|
| 245 |
+
</div>
|
| 246 |
+
<span id="user-email" class="text-sm font-medium"></span>
|
| 247 |
+
</button>
|
| 248 |
+
<div id="user-dropdown" class="hidden absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-50">
|
| 249 |
+
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Profile</a>
|
| 250 |
+
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Settings</a>
|
| 251 |
+
<button id="signout-btn" class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Sign Out</button>
|
| 252 |
+
</div>
|
| 253 |
+
</div>
|
| 254 |
+
</div>
|
| 255 |
+
</div>
|
| 256 |
+
</header>
|
| 257 |
+
|
| 258 |
+
<!-- Content -->
|
| 259 |
+
<main class="flex-1 overflow-y-auto p-6 bg-gray-50">
|
| 260 |
+
<div class="mb-6 flex justify-between items-center">
|
| 261 |
+
<h2 class="text-2xl font-bold text-gray-800">Knowledge Repository</h2>
|
| 262 |
+
<div class="flex space-x-2">
|
| 263 |
+
<button class="bg-white border border-gray-300 px-3 py-1 rounded-lg text-sm flex items-center">
|
| 264 |
+
<i class="fas fa-filter mr-2 text-gray-500"></i>
|
| 265 |
+
Filter
|
| 266 |
+
</button>
|
| 267 |
+
<button class="bg-white border border-gray-300 px-3 py-1 rounded-lg text-sm flex items-center">
|
| 268 |
+
<i class="fas fa-sort mr-2 text-gray-500"></i>
|
| 269 |
+
Sort
|
| 270 |
+
</button>
|
| 271 |
+
</div>
|
| 272 |
+
</div>
|
| 273 |
+
|
| 274 |
+
<!-- Stats Cards -->
|
| 275 |
+
<div class="grid grid-cols-1 md:grid-cols-4 gap-4 mb-6">
|
| 276 |
+
<div class="bg-white rounded-lg shadow p-4">
|
| 277 |
+
<div class="flex items-center justify-between">
|
| 278 |
+
<div>
|
| 279 |
+
<p class="text-gray-500 text-sm">Total Files</p>
|
| 280 |
+
<h3 class="text-2xl font-bold">1,248</h3>
|
| 281 |
+
</div>
|
| 282 |
+
<div class="p-3 rounded-full bg-blue-100 text-blue-500">
|
| 283 |
+
<i class="fas fa-file-alt"></i>
|
| 284 |
+
</div>
|
| 285 |
+
</div>
|
| 286 |
+
</div>
|
| 287 |
+
<div class="bg-white rounded-lg shadow p-4">
|
| 288 |
+
<div class="flex items-center justify-between">
|
| 289 |
+
<div>
|
| 290 |
+
<p class="text-gray-500 text-sm">AI Models</p>
|
| 291 |
+
<h3 class="text-2xl font-bold">5</h3>
|
| 292 |
+
</div>
|
| 293 |
+
<div class="p-3 rounded-full bg-purple-100 text-purple-500">
|
| 294 |
+
<i class="fas fa-robot"></i>
|
| 295 |
+
</div>
|
| 296 |
+
</div>
|
| 297 |
+
</div>
|
| 298 |
+
<div class="bg-white rounded-lg shadow p-4">
|
| 299 |
+
<div class="flex items-center justify-between">
|
| 300 |
+
<div>
|
| 301 |
+
<p class="text-gray-500 text-sm">Knowledge Used</p>
|
| 302 |
+
<h3 class="text-2xl font-bold">87%</h3>
|
| 303 |
+
</div>
|
| 304 |
+
<div class="p-3 rounded-full bg-green-100 text-green-500">
|
| 305 |
+
<i class="fas fa-chart-pie"></i>
|
| 306 |
+
</div>
|
| 307 |
+
</div>
|
| 308 |
+
</div>
|
| 309 |
+
<div class="bg-white rounded-lg shadow p-4">
|
| 310 |
+
<div class="flex items-center justify-between">
|
| 311 |
+
<div>
|
| 312 |
+
<p class="text-gray-500 text-sm">Last Training</p>
|
| 313 |
+
<h3 class="text-2xl font-bold">2h ago</h3>
|
| 314 |
+
</div>
|
| 315 |
+
<div class="p-3 rounded-full bg-yellow-100 text-yellow-500">
|
| 316 |
+
<i class="fas fa-bolt"></i>
|
| 317 |
+
</div>
|
| 318 |
+
</div>
|
| 319 |
+
</div>
|
| 320 |
+
</div>
|
| 321 |
+
|
| 322 |
+
<!-- Knowledge Items -->
|
| 323 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
| 324 |
+
<!-- Sample knowledge cards -->
|
| 325 |
+
<div class="knowledge-card bg-white rounded-lg shadow p-4">
|
| 326 |
+
<div class="flex items-start justify-between mb-3">
|
| 327 |
+
<div class="flex items-center">
|
| 328 |
+
<div class="p-2 rounded-lg bg-blue-100 text-blue-500 mr-3">
|
| 329 |
+
<i class="fas fa-code"></i>
|
| 330 |
+
</div>
|
| 331 |
+
<div>
|
| 332 |
+
<h4 class="font-bold">Custom AI Framework</h4>
|
| 333 |
+
<p class="text-gray-500 text-sm">Advanced neural network implementation</p>
|
| 334 |
+
</div>
|
| 335 |
+
</div>
|
| 336 |
+
<button class="text-gray-400 hover:text-gray-600">
|
| 337 |
+
<i class="fas fa-ellipsis-v"></i>
|
| 338 |
+
</button>
|
| 339 |
+
</div>
|
| 340 |
+
<p class="text-gray-600 text-sm mb-3">Complete implementation of our proprietary AI framework with custom layers and optimization techniques.</p>
|
| 341 |
+
<div class="flex flex-wrap gap-2 mb-3">
|
| 342 |
+
<span class="px-2 py-1 bg-blue-100 text-blue-600 text-xs rounded-full">#python</span>
|
| 343 |
+
<span class="px-2 py-1 bg-purple-100 text-purple-600 text-xs rounded-full">#tensorflow</span>
|
| 344 |
+
<span class="px-2 py-1 bg-green-100 text-green-600 text-xs rounded-full">#ai</span>
|
| 345 |
+
</div>
|
| 346 |
+
<div class="flex items-center justify-between text-xs text-gray-500">
|
| 347 |
+
<span>Updated 3 days ago</span>
|
| 348 |
+
<span>1.2 MB</span>
|
| 349 |
+
</div>
|
| 350 |
+
</div>
|
| 351 |
+
|
| 352 |
+
<div class="knowledge-card bg-white rounded-lg shadow p-4">
|
| 353 |
+
<div class="flex items-start justify-between mb-3">
|
| 354 |
+
<div class="flex items-center">
|
| 355 |
+
<div class="p-2 rounded-lg bg-purple-100 text-purple-500 mr-3">
|
| 356 |
+
<i class="fas fa-project-diagram"></i>
|
| 357 |
+
</div>
|
| 358 |
+
<div>
|
| 359 |
+
<h4 class="font-bold">Project Blueprint</h4>
|
| 360 |
+
<p class="text-gray-500 text-sm">Architecture documentation</p>
|
| 361 |
+
</div>
|
| 362 |
+
</div>
|
| 363 |
+
<button class="text-gray-400 hover:text-gray-600">
|
| 364 |
+
<i class="fas fa-ellipsis-v"></i>
|
| 365 |
+
</button>
|
| 366 |
+
</div>
|
| 367 |
+
<p class="text-gray-600 text-sm mb-3">Detailed system architecture and component interactions for our flagship AI product.</p>
|
| 368 |
+
<div class="flex flex-wrap gap-2 mb-3">
|
| 369 |
+
<span class="px-2 py-1 bg-blue-100 text-blue-600 text-xs rounded-full">#architecture</span>
|
| 370 |
+
<span class="px-2 py-1 bg-yellow-100 text-yellow-600 text-xs rounded-full">#documentation</span>
|
| 371 |
+
<span class="px-2 py-1 bg-red-100 text-red-600 text-xs rounded-full">#design</span>
|
| 372 |
+
</div>
|
| 373 |
+
<div class="flex items-center justify-between text-xs text-gray-500">
|
| 374 |
+
<span>Updated 1 week ago</span>
|
| 375 |
+
<span>450 KB</span>
|
| 376 |
+
</div>
|
| 377 |
+
</div>
|
| 378 |
+
|
| 379 |
+
<div class="knowledge-card bg-white rounded-lg shadow p-4">
|
| 380 |
+
<div class="flex items-start justify-between mb-3">
|
| 381 |
+
<div class="flex items-center">
|
| 382 |
+
<div class="p-2 rounded-lg bg-green-100 text-green-500 mr-3">
|
| 383 |
+
<i class="fas fa-chart-line"></i>
|
| 384 |
+
</div>
|
| 385 |
+
<div>
|
| 386 |
+
<h4 class="font-bold">Performance Metrics</h4>
|
| 387 |
+
<p class="text-gray-500 text-sm">Model evaluation results</p>
|
| 388 |
+
</div>
|
| 389 |
+
</div>
|
| 390 |
+
<button class="text-gray-400 hover:text-gray-600">
|
| 391 |
+
<i class="fas fa-ellipsis-v"></i>
|
| 392 |
+
</button>
|
| 393 |
+
</div>
|
| 394 |
+
<p class="text-gray-600 text-sm mb-3">Comprehensive evaluation of model performance across different datasets and parameters.</p>
|
| 395 |
+
<div class="flex flex-wrap gap-2 mb-3">
|
| 396 |
+
<span class="px-2 py-1 bg-green-100 text-green-600 text-xs rounded-full">#analytics</span>
|
| 397 |
+
<span class="px-2 py-1 bg-indigo-100 text-indigo-600 text-xs rounded-full">#metrics</span>
|
| 398 |
+
<span class="px-2 py-1 bg-pink-100 text-pink-600 text-xs rounded-full">#evaluation</span>
|
| 399 |
+
</div>
|
| 400 |
+
<div class="flex items-center justify-between text-xs text-gray-500">
|
| 401 |
+
<span>Updated yesterday</span>
|
| 402 |
+
<span>780 KB</span>
|
| 403 |
+
</div>
|
| 404 |
+
</div>
|
| 405 |
+
</div>
|
| 406 |
+
</main>
|
| 407 |
+
</div>
|
| 408 |
+
</div>
|
| 409 |
+
</div>
|
| 410 |
+
|
| 411 |
+
<!-- Upload Modal -->
|
| 412 |
+
<div id="upload-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
|
| 413 |
+
<div class="bg-white rounded-lg shadow-xl w-full max-w-2xl">
|
| 414 |
+
<div class="p-4 border-b border-gray-200 flex justify-between items-center">
|
| 415 |
+
<h3 class="text-lg font-semibold">Upload to Knowledge Base</h3>
|
| 416 |
+
<button id="close-modal" class="text-gray-500 hover:text-gray-700">
|
| 417 |
+
<i class="fas fa-times"></i>
|
| 418 |
+
</button>
|
| 419 |
+
</div>
|
| 420 |
+
|
| 421 |
+
<div class="p-6">
|
| 422 |
+
<div class="file-upload p-8 rounded-lg text-center mb-6 cursor-pointer">
|
| 423 |
+
<i class="fas fa-cloud-upload-alt text-4xl text-purple-500 mb-3"></i>
|
| 424 |
+
<p class="font-medium">Drag & drop files here or click to browse</p>
|
| 425 |
+
<p class="text-gray-500 text-sm mt-1">Supports: .py, .js, .html, .css, .pdf, .txt, .md, .ipynb</p>
|
| 426 |
+
<input type="file" id="file-input" class="hidden" multiple>
|
| 427 |
+
</div>
|
| 428 |
+
|
| 429 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
|
| 430 |
+
<div>
|
| 431 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Categories</label>
|
| 432 |
+
<input type="text" placeholder="e.g. Frameworks, Documentation"
|
| 433 |
+
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 434 |
+
</div>
|
| 435 |
+
<div>
|
| 436 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Tags</label>
|
| 437 |
+
<input type="text" placeholder="e.g. python, ai, flask"
|
| 438 |
+
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 439 |
+
</div>
|
| 440 |
+
</div>
|
| 441 |
+
|
| 442 |
+
<div class="mb-4">
|
| 443 |
+
<label class="block text-sm font-medium text-gray-700 mb-1">Description</label>
|
| 444 |
+
<textarea rows="3" placeholder="Brief description of the knowledge content"
|
| 445 |
+
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500"></textarea>
|
| 446 |
+
</div>
|
| 447 |
+
|
| 448 |
+
<div class="flex justify-end space-x-3">
|
| 449 |
+
<button id="cancel-upload" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50">
|
| 450 |
+
Cancel
|
| 451 |
+
</button>
|
| 452 |
+
<button class="gradient-bg text-white px-4 py-2 rounded-md hover:opacity-90">
|
| 453 |
+
<i class="fas fa-save mr-2"></i>
|
| 454 |
+
Save Knowledge
|
| 455 |
+
</button>
|
| 456 |
+
</div>
|
| 457 |
+
</div>
|
| 458 |
+
</div>
|
| 459 |
+
</div>
|
| 460 |
+
|
| 461 |
+
<!-- Training Modal -->
|
| 462 |
+
<div id="training-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
|
| 463 |
+
<div class="bg-white rounded-lg shadow-xl w-full max-w-2xl">
|
| 464 |
+
<div class="p-4 border-b border-gray-200 flex justify-between items-center">
|
| 465 |
+
<h3 class="text-lg font-semibold">Train AI Model with Knowledge</h3>
|
| 466 |
+
<button id="close-training-modal" class="text-gray-500 hover:text-gray-700">
|
| 467 |
+
<i class="fas fa-times"></i>
|
| 468 |
+
</button>
|
| 469 |
+
</div>
|
| 470 |
+
|
| 471 |
+
<div class="p-6">
|
| 472 |
+
<div class="mb-6">
|
| 473 |
+
<label class="block text-sm font-medium text-gray-700 mb-2">Select AI Model</label>
|
| 474 |
+
<select class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 475 |
+
<option>DeepSeek V3.1</option>
|
| 476 |
+
<option>Local LLM</option>
|
| 477 |
+
<option>Custom Fine-tuned Model</option>
|
| 478 |
+
</select>
|
| 479 |
+
</div>
|
| 480 |
+
|
| 481 |
+
<div class="mb-6">
|
| 482 |
+
<label class="block text-sm font-medium text-gray-700 mb-2">Select Knowledge to Include</label>
|
| 483 |
+
<div class="border border-gray-300 rounded-md p-4 max-h-64 overflow-y-auto">
|
| 484 |
+
<div class="space-y-3">
|
| 485 |
+
<div class="flex items-center">
|
| 486 |
+
<input type="checkbox" id="knowledge-1" class="h-4 w-4 text-purple-600 focus:ring-purple-500 border-gray-300 rounded">
|
| 487 |
+
<label for="knowledge-1" class="ml-2 block text-sm text-gray-700">
|
| 488 |
+
Custom AI Framework (Advanced neural network implementation)
|
| 489 |
+
</label>
|
| 490 |
+
</div>
|
| 491 |
+
<div class="flex items-center">
|
| 492 |
+
<input type="checkbox" id="knowledge-2" class="h-4 w-4 text-purple-600 focus:ring-purple-500 border-gray-300 rounded">
|
| 493 |
+
<label for="knowledge-2" class="ml-2 block text-sm text-gray-700">
|
| 494 |
+
Project Blueprint (Architecture documentation)
|
| 495 |
+
</label>
|
| 496 |
+
</div>
|
| 497 |
+
<div class="flex items-center">
|
| 498 |
+
<input type="checkbox" id="knowledge-3" class="h-4 w-4 text-purple-600 focus:ring-purple-500 border-gray-300 rounded">
|
| 499 |
+
<label for="knowledge-3" class="ml-2 block text-sm text-gray-700">
|
| 500 |
+
Performance Metrics (Model evaluation results)
|
| 501 |
+
</label>
|
| 502 |
+
</div>
|
| 503 |
+
</div>
|
| 504 |
+
</div>
|
| 505 |
+
</div>
|
| 506 |
+
|
| 507 |
+
<div class="mb-6">
|
| 508 |
+
<label class="block text-sm font-medium text-gray-700 mb-2">Training Parameters</label>
|
| 509 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
| 510 |
+
<div>
|
| 511 |
+
<label class="block text-xs text-gray-500 mb-1">Epochs</label>
|
| 512 |
+
<input type="number" value="10" min="1"
|
| 513 |
+
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 514 |
+
</div>
|
| 515 |
+
<div>
|
| 516 |
+
<label class="block text-xs text-gray-500 mb-1">Learning Rate</label>
|
| 517 |
+
<input type="number" step="0.0001" value="0.001"
|
| 518 |
+
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
|
| 519 |
+
</div>
|
| 520 |
+
</div>
|
| 521 |
+
</div>
|
| 522 |
+
|
| 523 |
+
<div class="flex justify-end space-x-3">
|
| 524 |
+
<button id="cancel-training" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50">
|
| 525 |
+
Cancel
|
| 526 |
+
</button>
|
| 527 |
+
<button class="gradient-bg text-white px-4 py-2 rounded-md hover:opacity-90">
|
| 528 |
+
<i class="fas fa-bolt mr-2"></i>
|
| 529 |
+
Start Training
|
| 530 |
+
</button>
|
| 531 |
+
</div>
|
| 532 |
+
</div>
|
| 533 |
+
</div>
|
| 534 |
+
</div>
|
| 535 |
+
|
| 536 |
+
<script>
|
| 537 |
+
// Supabase Configuration
|
| 538 |
+
const supabaseUrl = 'https://xlfboxorogcafgkokjeg.supabase.co';
|
| 539 |
+
const supabaseKey = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhsZmJveG9yb2djYWZna29ramVnIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDU3ODgzNDAsImV4cCI6MjA2MTM2NDM0MH0.Ohi958kKpbLGv5xRmwbtyw1nadPUxcZVJf-Jf0VTs9c';
|
| 540 |
+
|
| 541 |
+
const supabase = supabase.createClient(supabaseUrl, supabaseKey);
|
| 542 |
+
|
| 543 |
+
// DOM Elements
|
| 544 |
+
const authModal = document.getElementById('auth-modal');
|
| 545 |
+
const closeAuthModal = document.getElementById('close-auth-modal');
|
| 546 |
+
const authTabs = document.querySelectorAll('.auth-tab');
|
| 547 |
+
const authForms = document.querySelectorAll('.auth-form');
|
| 548 |
+
const authModalTitle = document.getElementById('auth-modal-title');
|
| 549 |
+
const authMessage = document.getElementById('auth-message');
|
| 550 |
+
|
| 551 |
+
const appContainer = document.getElementById('app-container');
|
| 552 |
+
const userMenuButton = document.getElementById('user-menu-button');
|
| 553 |
+
const userDropdown = document.getElementById('user-dropdown');
|
| 554 |
+
const userEmail = document.getElementById('user-email');
|
| 555 |
+
const signoutBtn = document.getElementById('signout-btn');
|
| 556 |
+
|
| 557 |
+
// Auth Form Elements
|
| 558 |
+
const signinForm = document.getElementById('signin-form');
|
| 559 |
+
const signupForm = document.getElementById('signup-form');
|
| 560 |
+
const forgotForm = document.getElementById('forgot-form');
|
| 561 |
+
|
| 562 |
+
const signinEmail = document.getElementById('signin-email');
|
| 563 |
+
const signinPassword = document.getElementById('signin-password');
|
| 564 |
+
const signinBtn = document.getElementById('signin-btn');
|
| 565 |
+
|
| 566 |
+
const signupEmail = document.getElementById('signup-email');
|
| 567 |
+
const signupPassword = document.getElementById('signup-password');
|
| 568 |
+
const signupConfirmPassword = document.getElementById('signup-confirm-password');
|
| 569 |
+
const signupBtn = document.getElementById('signup-btn');
|
| 570 |
+
|
| 571 |
+
const forgotEmail = document.getElementById('forgot-email');
|
| 572 |
+
const forgotBtn = document.getElementById('forgot-btn');
|
| 573 |
+
|
| 574 |
+
const googleSignin = document.getElementById('google-signin');
|
| 575 |
+
const githubSignin = document.getElementById('github-signin');
|
| 576 |
+
|
| 577 |
+
// Check auth state on page load
|
| 578 |
+
document.addEventListener('DOMContentLoaded', async () => {
|
| 579 |
+
// Show auth modal by default
|
| 580 |
+
authModal.classList.remove('hidden');
|
| 581 |
+
|
| 582 |
+
// Check if user is already signed in
|
| 583 |
+
const { data: { session }, error } = await supabase.auth.getSession();
|
| 584 |
+
|
| 585 |
+
if (session) {
|
| 586 |
+
// User is signed in
|
| 587 |
+
handleSignedIn(session.user);
|
| 588 |
+
} else {
|
| 589 |
+
// User is not signed in
|
| 590 |
+
authModal.classList.remove('hidden');
|
| 591 |
+
appContainer.classList.add('hidden');
|
| 592 |
+
}
|
| 593 |
+
});
|
| 594 |
+
|
| 595 |
+
// Auth Tab Switching
|
| 596 |
+
authTabs.forEach(tab => {
|
| 597 |
+
tab.addEventListener('click', () => {
|
| 598 |
+
const tabName = tab.getAttribute('data-tab');
|
| 599 |
+
|
| 600 |
+
// Update active tab
|
| 601 |
+
authTabs.forEach(t => {
|
| 602 |
+
t.classList.remove('text-purple-600', 'border-purple-600');
|
| 603 |
+
t.classList.add('text-gray-500', 'hover:text-gray-700');
|
| 604 |
+
});
|
| 605 |
+
|
| 606 |
+
tab.classList.remove('text-gray-500', 'hover:text-gray-700');
|
| 607 |
+
tab.classList.add('text-purple-600', 'border-purple-600');
|
| 608 |
+
|
| 609 |
+
// Update form visibility
|
| 610 |
+
authForms.forEach(form => {
|
| 611 |
+
form.classList.add('hidden');
|
| 612 |
+
});
|
| 613 |
+
|
| 614 |
+
// Update modal title
|
| 615 |
+
if (tabName === 'signin') {
|
| 616 |
+
authModalTitle.textContent = 'Sign In';
|
| 617 |
+
signinForm.classList.remove('hidden');
|
| 618 |
+
} else if (tabName === 'signup') {
|
| 619 |
+
authModalTitle.textContent = 'Sign Up';
|
| 620 |
+
signupForm.classList.remove('hidden');
|
| 621 |
+
} else if (tabName === 'forgot') {
|
| 622 |
+
authModalTitle.textContent = 'Forgot Password';
|
| 623 |
+
forgotForm.classList.remove('hidden');
|
| 624 |
+
}
|
| 625 |
+
|
| 626 |
+
// Clear any messages
|
| 627 |
+
authMessage.classList.add('hidden');
|
| 628 |
+
authMessage.textContent = '';
|
| 629 |
+
});
|
| 630 |
+
});
|
| 631 |
+
|
| 632 |
+
// Close Auth Modal
|
| 633 |
+
closeAuthModal.addEventListener('click', () => {
|
| 634 |
+
authModal.classList.add('hidden');
|
| 635 |
+
});
|
| 636 |
+
|
| 637 |
+
// Sign In
|
| 638 |
+
signinBtn.addEventListener('click', async () => {
|
| 639 |
+
const email = signinEmail.value;
|
| 640 |
+
const password = signinPassword.value;
|
| 641 |
+
|
| 642 |
+
if (!email || !password) {
|
| 643 |
+
showAuthMessage('Please enter both email and password', 'error');
|
| 644 |
+
return;
|
| 645 |
+
}
|
| 646 |
+
|
| 647 |
+
const { data, error } = await supabase.auth.signInWithPassword({
|
| 648 |
+
email,
|
| 649 |
+
password
|
| 650 |
+
});
|
| 651 |
+
|
| 652 |
+
if (error) {
|
| 653 |
+
showAuthMessage(error.message, 'error');
|
| 654 |
+
} else {
|
| 655 |
+
handleSignedIn(data.user);
|
| 656 |
+
authModal.classList.add
|
| 657 |
+
</html>
|
prompts.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
add login with supabase auth REACT_APP_SUPABASE_URL=https://xlfboxorogcafgkokjeg.supabase.co REACT_APP_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhsZmJveG9yb2djYWZna29ramVnIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDU3ODgzNDAsImV4cCI6MjA2MTM2NDM0MH0.Ohi958kKpbLGv5xRmwbtyw1nadPUxcZVJf-Jf0VTs9c
|