S-Dreamer commited on
Commit
a6c5d0a
·
verified ·
1 Parent(s): c8e1113

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +424 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Codeguard
3
- emoji: 😻
4
- colorFrom: indigo
5
- colorTo: red
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: codeguard
3
+ emoji: 🐳
4
+ colorFrom: green
5
+ colorTo: pink
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,424 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>CodeGuard | AI-Powered Code Review & Security Analysis</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
9
+ <style>
10
+ body {
11
+ font-family: 'Inter', sans-serif;
12
+ background-color: #22272E;
13
+ color: #ADBAC7;
14
+ }
15
+ .code-font {
16
+ font-family: 'JetBrains Mono', monospace;
17
+ }
18
+ .sidebar {
19
+ scrollbar-width: thin;
20
+ scrollbar-color: #2D333B #22272E;
21
+ }
22
+ .sidebar::-webkit-scrollbar {
23
+ width: 6px;
24
+ }
25
+ .sidebar::-webkit-scrollbar-track {
26
+ background: #22272E;
27
+ }
28
+ .sidebar::-webkit-scrollbar-thumb {
29
+ background-color: #2D333B;
30
+ border-radius: 3px;
31
+ }
32
+ .code-editor {
33
+ background-color: #1C2128;
34
+ }
35
+ .cm-editor {
36
+ height: 100%;
37
+ }
38
+ .security-critical {
39
+ border-left: 3px solid #CF222E;
40
+ }
41
+ .security-high {
42
+ border-left: 3px solid #E16F24;
43
+ }
44
+ .security-medium {
45
+ border-left: 3px solid #D4A017;
46
+ }
47
+ .security-low {
48
+ border-left: 3px solid #347D39;
49
+ }
50
+ .tab-active {
51
+ border-bottom: 2px solid #347D39;
52
+ color: white;
53
+ }
54
+ .resizer {
55
+ background-color: #2D333B;
56
+ }
57
+ .resizer:hover {
58
+ background-color: #347D39;
59
+ }
60
+ </style>
61
+ </head>
62
+ <body class="h-screen flex flex-col overflow-hidden">
63
+ <!-- Header -->
64
+ <header class="bg-[#2D333B] border-b border-[#444C56] px-6 py-3 flex items-center justify-between">
65
+ <div class="flex items-center space-x-4">
66
+ <div class="flex items-center">
67
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8 text-[#347D39]" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
68
+ <path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"></path>
69
+ </svg>
70
+ <span class="ml-2 text-xl font-bold">CodeGuard</span>
71
+ </div>
72
+ <nav class="hidden md:flex space-x-6">
73
+ <a href="#" class="hover:text-white">Dashboard</a>
74
+ <a href="#" class="hover:text-white">Code Review</a>
75
+ <a href="#" class="hover:text-white">Security Scan</a>
76
+ <a href="#" class="hover:text-white">Reports</a>
77
+ <a href="#" class="hover:text-white">Settings</a>
78
+ </nav>
79
+ </div>
80
+ <div class="flex items-center space-x-4">
81
+ <button class="bg-[#347D39] hover:bg-[#46954A] text-white px-4 py-1.5 rounded-md text-sm font-medium">
82
+ New Scan
83
+ </button>
84
+ <div class="relative">
85
+ <div class="h-8 w-8 rounded-full bg-[#444C56] flex items-center justify-center cursor-pointer">
86
+ <span class="text-sm">JS</span>
87
+ </div>
88
+ </div>
89
+ </div>
90
+ </header>
91
+
92
+ <!-- Main Content -->
93
+ <div class="flex flex-1 overflow-hidden">
94
+ <!-- Sidebar -->
95
+ <div class="sidebar w-64 bg-[#2D333B] border-r border-[#444C56] overflow-y-auto flex flex-col">
96
+ <div class="p-4 border-b border-[#444C56]">
97
+ <h2 class="font-semibold text-lg mb-2">Recent Projects</h2>
98
+ <div class="space-y-2">
99
+ <div class="flex items-center p-2 rounded hover:bg-[#373E47] cursor-pointer">
100
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-[#ADBAC7]" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
101
+ <path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 2h5a2 2 0 0 1 2 2z"></path>
102
+ </svg>
103
+ <span class="ml-2">web-app-frontend</span>
104
+ </div>
105
+ <div class="flex items-center p-2 rounded hover:bg-[#373E47] cursor-pointer">
106
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-[#ADBAC7]" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
107
+ <path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 2h5a2 2 0 0 1 2 2z"></path>
108
+ </svg>
109
+ <span class="ml-2">api-service</span>
110
+ </div>
111
+ <div class="flex items-center p-2 rounded hover:bg-[#373E47] cursor-pointer">
112
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-[#ADBAC7]" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
113
+ <path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 2h5a2 2 0 0 1 2 2z"></path>
114
+ </svg>
115
+ <span class="ml-2">mobile-app</span>
116
+ </div>
117
+ </div>
118
+ </div>
119
+ <div class="p-4 border-b border-[#444C56]">
120
+ <h2 class="font-semibold text-lg mb-2">Security Scans</h2>
121
+ <div class="space-y-2">
122
+ <div class="flex items-center p-2 rounded hover:bg-[#373E47] cursor-pointer">
123
+ <div class="h-2 w-2 rounded-full bg-[#347D39]"></div>
124
+ <span class="ml-2 text-sm">Completed 2 min ago</span>
125
+ </div>
126
+ <div class="flex items-center p-2 rounded hover:bg-[#373E47] cursor-pointer">
127
+ <div class="h-2 w-2 rounded-full bg-[#E16F24]"></div>
128
+ <span class="ml-2 text-sm">Running (45%)</span>
129
+ </div>
130
+ <div class="flex items-center p-2 rounded hover:bg-[#373E47] cursor-pointer">
131
+ <div class="h-2 w-2 rounded-full bg-[#CF222E]"></div>
132
+ <span class="ml-2 text-sm">Failed</span>
133
+ </div>
134
+ </div>
135
+ </div>
136
+ <div class="p-4">
137
+ <h2 class="font-semibold text-lg mb-2">Quick Actions</h2>
138
+ <div class="space-y-2">
139
+ <button class="w-full flex items-center p-2 rounded hover:bg-[#373E47] cursor-pointer text-left">
140
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-[#ADBAC7]" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
141
+ <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
142
+ <polyline points="14 2 14 8 20 8"></polyline>
143
+ <line x1="16" y1="13" x2="8" y2="13"></line>
144
+ <line x1="16" y1="17" x2="8" y2="17"></line>
145
+ <polyline points="10 9 9 9 8 9"></polyline>
146
+ </svg>
147
+ <span class="ml-2">New Code Review</span>
148
+ </button>
149
+ <button class="w-full flex items-center p-2 rounded hover:bg-[#373E47] cursor-pointer text-left">
150
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-[#ADBAC7]" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
151
+ <circle cx="12" cy="12" r="10"></circle>
152
+ <line x1="12" y1="8" x2="12" y2="12"></line>
153
+ <line x1="12" y1="16" x2="12.01" y2="16"></line>
154
+ </svg>
155
+ <span class="ml-2">Vulnerability Scan</span>
156
+ </button>
157
+ <button class="w-full flex items-center p-2 rounded hover:bg-[#373E47] cursor-pointer text-left">
158
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-[#ADBAC7]" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
159
+ <path d="M12 20h9"></path>
160
+ <path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path>
161
+ </svg>
162
+ <span class="ml-2">Penetration Test</span>
163
+ </button>
164
+ </div>
165
+ </div>
166
+ </div>
167
+
168
+ <!-- Main Panel -->
169
+ <div class="flex-1 flex flex-col overflow-hidden">
170
+ <!-- Tabs -->
171
+ <div class="border-b border-[#444C56] flex">
172
+ <div class="px-4 py-3 font-medium tab-active">Code Review</div>
173
+ <div class="px-4 py-3 font-medium text-[#768390] hover:text-white cursor-pointer">Security Analysis</div>
174
+ <div class="px-4 py-3 font-medium text-[#768390] hover:text-white cursor-pointer">Red Team Tools</div>
175
+ <div class="px-4 py-3 font-medium text-[#768390] hover:text-white cursor-pointer">Blue Team Tools</div>
176
+ </div>
177
+
178
+ <!-- Split View Container -->
179
+ <div class="flex-1 flex overflow-hidden">
180
+ <!-- Code Editor Panel -->
181
+ <div class="flex-1 flex flex-col overflow-hidden border-r border-[#444C56]">
182
+ <div class="p-3 border-b border-[#444C56] flex justify-between items-center">
183
+ <div class="flex items-center">
184
+ <span class="text-sm font-medium">app/components/AuthForm.js</span>
185
+ <span class="ml-2 text-xs px-2 py-0.5 bg-[#444C56] rounded">JavaScript</span>
186
+ </div>
187
+ <div class="flex space-x-2">
188
+ <button class="p-1 rounded hover:bg-[#373E47]">
189
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
190
+ <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>
191
+ </svg>
192
+ </button>
193
+ <button class="p-1 rounded hover:bg-[#373E47]">
194
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
195
+ <path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path>
196
+ <path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path>
197
+ </svg>
198
+ </button>
199
+ <button class="p-1 rounded hover:bg-[#373E47]">
200
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
201
+ <circle cx="12" cy="12" r="1"></circle>
202
+ <circle cx="12" cy="5" r="1"></circle>
203
+ <circle cx="12" cy="19" r="1"></circle>
204
+ </svg>
205
+ </button>
206
+ </div>
207
+ </div>
208
+ <div class="code-editor flex-1 overflow-auto p-4 code-font">
209
+ <div class="relative">
210
+ <div class="absolute left-0 top-0 w-8 text-right pr-2 text-[#768390] select-none">
211
+ <div>1</div>
212
+ <div>2</div>
213
+ <div>3</div>
214
+ <div>4</div>
215
+ <div>5</div>
216
+ <div>6</div>
217
+ <div>7</div>
218
+ <div>8</div>
219
+ <div>9</div>
220
+ <div>10</div>
221
+ <div>11</div>
222
+ <div>12</div>
223
+ <div>13</div>
224
+ <div>14</div>
225
+ <div>15</div>
226
+ <div>16</div>
227
+ <div>17</div>
228
+ <div>18</div>
229
+ <div>19</div>
230
+ <div>20</div>
231
+ </div>
232
+ <div class="ml-10">
233
+ <div><span class="text-[#6CB6FF]">import</span> React <span class="text-[#6CB6FF]">from</span> <span class="text-[#96D0FF]">'react'</span>;</div>
234
+ <div><span class="text-[#6CB6FF]">import</span> { useState } <span class="text-[#6CB6FF]">from</span> <span class="text-[#96D0FF]">'react'</span>;</div>
235
+ <div><span class="text-[#6CB6FF]">import</span> axios <span class="text-[#6CB6FF]">from</span> <span class="text-[#96D0FF]">'axios'</span>;</div>
236
+ <div><br></div>
237
+ <div><span class="text-[#6CB6FF]">const</span> <span class="text-[#DCBDFB]">AuthForm</span> = () <span class="text-[#6CB6FF]">=></span> {</div>
238
+ <div> <span class="text-[#6CB6FF]">const</span> [email, setEmail] = <span class="text-[#DCBDFB]">useState</span>(<span class="text-[#96D0FF]">''</span>);</div>
239
+ <div> <span class="text-[#6CB6FF]">const</span> [password, setPassword] = <span class="text-[#DCBDFB]">useState</span>(<span class="text-[#96D0FF]">''</span>);</div>
240
+ <div><br></div>
241
+ <div> <span class="text-[#6CB6FF]">const</span> <span class="text-[#DCBDFB]">handleSubmit</span> = <span class="text-[#6CB6FF]">async</span> (e) <span class="text-[#6CB6FF]">=></span> {</div>
242
+ <div> e.<span class="text-[#DCBDFB]">preventDefault</span>();</div>
243
+ <div> <span class="text-[#6CB6FF]">try</span> {</div>
244
+ <div> <span class="text-[#6CB6FF]">const</span> response = <span class="text-[#6CB6FF]">await</span> axios.<span class="text-[#DCBDFB]">post</span>(<span class="text-[#96D0FF]">'/api/auth'</span>, { email, password });</div>
245
+ <div> console.<span class="text-[#DCBDFB]">log</span>(response.<span class="text-[#DCBDFB]">data</span>);</div>
246
+ <div> } <span class="text-[#6CB6FF]">catch</span> (error) {</div>
247
+ <div> console.<span class="text-[#DCBDFB]">error</span>(error.<span class="text-[#DCBDFB]">response</span>.<span class="text-[#DCBDFB]">data</span>);</div>
248
+ <div> }</div>
249
+ <div> };</div>
250
+ <div><br></div>
251
+ <div> <span class="text-[#6CB6FF]">return</span> (</div>
252
+ <div> &lt;form onSubmit={<span class="text-[#DCBDFB]">handleSubmit</span>}&gt;</div>
253
+ <div> &lt;input type=<span class="text-[#96D0FF]">"email"</span> value={<span class="text-[#DCBDFB]">email</span>} onChange={(e) <span class="text-[#6CB6FF]">=></span> <span class="text-[#DCBDFB]">setEmail</span>(e.<span class="text-[#DCBDFB]">target</span>.<span class="text-[#DCBDFB]">value</span>)} /&gt;</div>
254
+ <div> &lt;input type=<span class="text-[#96D0FF]">"password"</span> value={<span class="text-[#DCBDFB]">password</span>} onChange={(e) <span class="text-[#6CB6FF]">=></span> <span class="text-[#DCBDFB]">setPassword</span>(e.<span class="text-[#DCBDFB]">target</span>.<span class="text-[#DCBDFB]">value</span>)} /&gt;</div>
255
+ <div> &lt;button type=<span class="text-[#96D0FF]">"submit"</span>&gt;Login&lt;/button&gt;</div>
256
+ <div> &lt;/form&gt;</div>
257
+ <div> );</div>
258
+ <div>};</div>
259
+ <div><br></div>
260
+ <div><span class="text-[#6CB6FF]">export</span> <span class="text-[#6CB6FF]">default</span> <span class="text-[#DCBDFB]">AuthForm</span>;</div>
261
+ </div>
262
+ </div>
263
+ </div>
264
+ </div>
265
+
266
+ <!-- Analysis Panel -->
267
+ <div class="w-96 flex flex-col border-l border-[#444C56]">
268
+ <div class="p-3 border-b border-[#444C56] flex justify-between items-center">
269
+ <div class="flex items-center">
270
+ <span class="text-sm font-medium">Analysis Results</span>
271
+ <span class="ml-2 text-xs px-2 py-0.5 bg-[#444C56] rounded">3 issues</span>
272
+ </div>
273
+ <div class="flex space-x-2">
274
+ <button class="p-1 rounded hover:bg-[#373E47]">
275
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
276
+ <polyline points="3 6 5 6 21 6"></polyline>
277
+ <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
278
+ </svg>
279
+ </button>
280
+ <button class="p-1 rounded hover:bg-[#373E47]">
281
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
282
+ <circle cx="12" cy="12" r="1"></circle>
283
+ <circle cx="12" cy="5" r="1"></circle>
284
+ <circle cx="12" cy="19" r="1"></circle>
285
+ </svg>
286
+ </button>
287
+ </div>
288
+ </div>
289
+ <div class="flex-1 overflow-auto p-4">
290
+ <div class="space-y-4">
291
+ <!-- Critical Issue -->
292
+ <div class="security-critical p-3 rounded bg-[#2D333B]">
293
+ <div class="flex items-start">
294
+ <div class="flex-shrink-0 mt-1">
295
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-[#CF222E]" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
296
+ <circle cx="12" cy="12" r="10"></circle>
297
+ <line x1="12" y1="8" x2="12" y2="12"></line>
298
+ <line x1="12" y1="16" x2="12.01" y2="16"></line>
299
+ </svg>
300
+ </div>
301
+ <div class="ml-3">
302
+ <h3 class="text-sm font-medium">Sensitive Data Exposure</h3>
303
+ <div class="mt-1 text-sm">
304
+ <p>Passwords are being transmitted in plaintext. Use HTTPS and implement proper password hashing.</p>
305
+ </div>
306
+ <div class="mt-2 flex items-center text-xs text-[#768390]">
307
+ <span>Line 9</span>
308
+ <span class="mx-2">•</span>
309
+ <span>Critical</span>
310
+ </div>
311
+ </div>
312
+ </div>
313
+ </div>
314
+
315
+ <!-- High Issue -->
316
+ <div class="security-high p-3 rounded bg-[#2D333B]">
317
+ <div class="flex items-start">
318
+ <div class="flex-shrink-0 mt-1">
319
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-[#E16F24]" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
320
+ <circle cx="12" cy="12" r="10"></circle>
321
+ <line x1="12" y1="8" x2="12" y2="12"></line>
322
+ <line x1="12" y1="16" x2="12.01" y2="16"></line>
323
+ </svg>
324
+ </div>
325
+ <div class="ml-3">
326
+ <h3 class="text-sm font-medium">Insecure Direct Object Reference</h3>
327
+ <div class="mt-1 text-sm">
328
+ <p>The authentication endpoint doesn't implement rate limiting, making it vulnerable to brute force attacks.</p>
329
+ </div>
330
+ <div class="mt-2 flex items-center text-xs text-[#768390]">
331
+ <span>Line 9</span>
332
+ <span class="mx-2">•</span>
333
+ <span>High</span>
334
+ </div>
335
+ </div>
336
+ </div>
337
+ </div>
338
+
339
+ <!-- Medium Issue -->
340
+ <div class="security-medium p-3 rounded bg-[#2D333B]">
341
+ <div class="flex items-start">
342
+ <div class="flex-shrink-0 mt-1">
343
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-[#D4A017]" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
344
+ <circle cx="12" cy="12" r="10"></circle>
345
+ <line x1="12" y1="8" x2="12" y2="12"></line>
346
+ <line x1="12" y1="16" x2="12.01" y2="16"></line>
347
+ </svg>
348
+ </div>
349
+ <div class="ml-3">
350
+ <h3 class="text-sm font-medium">Debug Information Exposure</h3>
351
+ <div class="mt-1 text-sm">
352
+ <p>Console logging of sensitive information in production code. Remove or implement proper logging.</p>
353
+ </div>
354
+ <div class="mt-2 flex items-center text-xs text-[#768390]">
355
+ <span>Lines 10, 12</span>
356
+ <span class="mx-2">•</span>
357
+ <span>Medium</span>
358
+ </div>
359
+ </div>
360
+ </div>
361
+ </div>
362
+ </div>
363
+
364
+ <div class="mt-6">
365
+ <h3 class="text-sm font-medium mb-2">Suggested Fixes</h3>
366
+ <div class="bg-[#1C2128] p-3 rounded code-font text-sm">
367
+ <div>1. Implement HTTPS for all authentication requests</div>
368
+ <div>2. Use bcrypt or Argon2 for password hashing</div>
369
+ <div>3. Add rate limiting to the auth endpoint</div>
370
+ <div>4. Remove console.log statements in production</div>
371
+ </div>
372
+ </div>
373
+
374
+ <div class="mt-6">
375
+ <button class="w-full bg-[#347D39] hover:bg-[#46954A] text-white px-4 py-2 rounded-md text-sm font-medium">
376
+ Apply Auto-Fixes
377
+ </button>
378
+ </div>
379
+ </div>
380
+ </div>
381
+ </div>
382
+ </div>
383
+ </div>
384
+
385
+ <script>
386
+ // Simple demo functionality
387
+ document.addEventListener('DOMContentLoaded', function() {
388
+ // Tab switching
389
+ const tabs = document.querySelectorAll('.flex.border-b div[class*="px-4"]');
390
+ tabs.forEach(tab => {
391
+ tab.addEventListener('click', function() {
392
+ tabs.forEach(t => t.classList.remove('tab-active', 'text-white'));
393
+ tabs.forEach(t => t.classList.add('text-[#768390]'));
394
+ this.classList.add('tab-active', 'text-white');
395
+ this.classList.remove('text-[#768390]');
396
+ });
397
+ });
398
+
399
+ // Simulate analysis loading
400
+ setTimeout(() => {
401
+ const analysisPanel = document.querySelector('.w-96');
402
+ if (analysisPanel) {
403
+ const loadingIndicator = document.createElement('div');
404
+ loadingIndicator.className = 'absolute inset-0 flex items-center justify-center bg-[#22272E] bg-opacity-80';
405
+ loadingIndicator.innerHTML = `
406
+ <div class="flex flex-col items-center">
407
+ <svg class="animate-spin h-8 w-8 text-[#347D39]" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
408
+ <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
409
+ <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
410
+ </svg>
411
+ <span class="mt-2 text-sm">Analyzing code...</span>
412
+ </div>
413
+ `;
414
+ analysisPanel.appendChild(loadingIndicator);
415
+
416
+ setTimeout(() => {
417
+ loadingIndicator.remove();
418
+ }, 1500);
419
+ }
420
+ }, 500);
421
+ });
422
+ </script>
423
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=S-Dreamer/codeguard" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
424
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ A web-based Code Review and Security Analysis platform that combines automated code review capabilities with security testing features, powered by Gradio. Core Features: - Code analysis interface for uploading and reviewing code snippets with automated feedback - Security testing dashboard with vulnerability scanning and intrusion detection monitoring - Combined red team (offensive) and blue team (defensive) security tools integration - Real-time analysis results and recommendations display Visual References: Inspired by GitHub's code review interface and Snyk's security dashboard, known for their clear presentation of code analysis and security insights. Style Guide: - Colors: Primary #2D333B (github dark), Secondary #347D39 (success green), Warning #E16F24 (alert orange), Error #CF222E (error red), Background #22272E (dark mode), Text #ADBAC7 (light text) - Design: JetBrains Mono/Inter fonts, split-pane layout with code editor and analysis results, dark theme optimized for code display, clear hierarchy for security alerts, responsive design with collapsible panels