Commit
·
d8a02d4
1
Parent(s):
12be5e9
update docs
Browse files- templates/docs.html +390 -187
templates/docs.html
CHANGED
|
@@ -1,72 +1,176 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
</head>
|
| 24 |
-
<body class="
|
| 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 |
}</code></pre>
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
|
| 71 |
response = requests.post(
|
| 72 |
"https://hager-zon.vercel.app/api/chat",
|
|
@@ -78,11 +182,11 @@ response = requests.post(
|
|
| 78 |
}
|
| 79 |
)
|
| 80 |
print(response.json())</code></pre>
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
from django.http import JsonResponse
|
| 87 |
from django.views import View
|
| 88 |
|
|
@@ -94,11 +198,11 @@ class ChatView(View):
|
|
| 94 |
json={"message": data, "system_prompt": "You are a coding expert", "temperature": 0.7}
|
| 95 |
)
|
| 96 |
return JsonResponse(response.json())</code></pre>
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
import requests
|
| 103 |
|
| 104 |
app = Flask(__name__)
|
|
@@ -111,11 +215,11 @@ def chat():
|
|
| 111 |
json={"message": data, "system_prompt": "You are a coding expert", "temperature": 0.7}
|
| 112 |
)
|
| 113 |
return jsonify(response.json())</code></pre>
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
|
| 120 |
function ChatComponent() {
|
| 121 |
const [message, setMessage] = useState('');
|
|
@@ -146,11 +250,11 @@ function ChatComponent() {
|
|
| 146 |
}
|
| 147 |
|
| 148 |
export default ChatComponent;</code></pre>
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
const fetch = require('node-fetch');
|
| 155 |
const app = express();
|
| 156 |
|
|
@@ -173,11 +277,11 @@ app.post('/chat', async (req, res) => {
|
|
| 173 |
});
|
| 174 |
|
| 175 |
app.listen(3000, () => console.log('Server running on port 3000'));</code></pre>
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
|
| 182 |
class ChatController < ApplicationController
|
| 183 |
def create
|
|
@@ -194,11 +298,11 @@ class ChatController < ApplicationController
|
|
| 194 |
render json: response.parsed_response
|
| 195 |
end
|
| 196 |
end</code></pre>
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
|
| 203 |
class ChatController extends Controller
|
| 204 |
{
|
|
@@ -213,107 +317,206 @@ class ChatController extends Controller
|
|
| 213 |
return $response->json();
|
| 214 |
}
|
| 215 |
}</code></pre>
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-H "Content-Type: application/json" \
|
| 222 |
-d '{"message":"Generate a React component","system_prompt":"You are a coding expert","temperature":0.7,"max_new_tokens":4096}'</code></pre>
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
}</code></pre>
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
}</code></pre>
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-H "Content-Type: application/json" \
|
| 254 |
-d '{"client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET", "grant_type": "client_credentials"}'</code></pre>
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
</div>
|
| 258 |
-
<a href="/" class="inline-block bg-gradient-to-r from-orange-500 to-red-500 text-white px-8 py-4 rounded-full text-lg font-semibold hover:scale-105 transition transform mt-8">Back to Home</a>
|
| 259 |
-
</div>
|
| 260 |
</div>
|
| 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 |
-
<p>Read: <a href="https://hager-zon.vercel.app/faq" class="text-orange-500 hover:underline">mgzon.com/faq</a></p>
|
| 291 |
-
</div>
|
| 292 |
-
<div class="bg-gray-800 p-6 rounded-lg shadow-lg">
|
| 293 |
-
<i class="bx bx-book text-3xl text-orange-500 mb-4"></i>
|
| 294 |
-
<h3 class="text-lg font-semibold mb-2">Documentation</h3>
|
| 295 |
-
<p>Learn: <a href="/docs" class="text-orange-500 hover:underline">mgzon.com/docs</a></p>
|
| 296 |
-
</div>
|
| 297 |
-
</div>
|
| 298 |
-
<div class="flex justify-center gap-6 mt-6">
|
| 299 |
-
<a href="https://github.com/Mark-Lasfar/MGZon" class="text-2xl text-white hover:text-orange-500 transition"><i class="bx bxl-github"></i></a>
|
| 300 |
-
<a href="https://x.com/MGZon" class="text-2xl text-white hover:text-orange-500 transition"><i class="bx bxl-twitter"></i></a>
|
| 301 |
-
<a href="https://www.facebook.com/people/Mark-Al-Asfar/pfbid02GMisUQ8AqWkNZjoKtWFHH1tbdHuVscN1cjcFnZWy9HkRaAsmanBfT6mhySAyqpg4l/" class="text-2xl text-white hover:text-orange-500 transition"><i class="bx bxl-facebook"></i></a>
|
| 302 |
-
</div>
|
| 303 |
-
<p class="mt-6">© 2025 Mark Al-Asfar & MGZon AI. All rights reserved.</p>
|
| 304 |
</div>
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 316 |
});
|
| 317 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 318 |
</body>
|
| 319 |
</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>MGZon API Documentation</title>
|
| 7 |
+
<!-- Tailwind CSS v3 -->
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<!-- Boxicons -->
|
| 10 |
+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/css/boxicons.min.css" rel="stylesheet" />
|
| 11 |
+
<!-- Prism for code highlighting -->
|
| 12 |
+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/themes/prism.min.css" rel="stylesheet" />
|
| 13 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected].0/prism.min.js"></script>
|
| 14 |
+
<style>
|
| 15 |
+
/* Animated gradient background */
|
| 16 |
+
@keyframes gradientShift {
|
| 17 |
+
0% { background-position: 0% 50%; }
|
| 18 |
+
50% { background-position: 100% 50%; }
|
| 19 |
+
100% { background-position: 0% 50%; }
|
| 20 |
+
}
|
| 21 |
+
body {
|
| 22 |
+
background: linear-gradient(135deg, #0f172a, #0e7490, #065f46, #064e3b);
|
| 23 |
+
background-size: 400% 400%;
|
| 24 |
+
animation: gradientShift 15s ease infinite;
|
| 25 |
+
font-family: system-ui, sans-serif;
|
| 26 |
+
}
|
| 27 |
+
/* Glass-morphism helpers */
|
| 28 |
+
.glass {
|
| 29 |
+
background: rgba(255, 255, 255, 0.07);
|
| 30 |
+
border-radius: 1rem;
|
| 31 |
+
border: 1px solid rgba(255, 255, 255, 0.12);
|
| 32 |
+
backdrop-filter: blur(12px);
|
| 33 |
+
-webkit-backdrop-filter: blur(12px);
|
| 34 |
+
}
|
| 35 |
+
/* Sidebar transition */
|
| 36 |
+
.sidebar {
|
| 37 |
+
transition: transform 0.3s ease-in-out;
|
| 38 |
+
}
|
| 39 |
+
.sidebar.collapsed .logo {
|
| 40 |
+
opacity: 0;
|
| 41 |
+
transition: opacity 0.2s ease;
|
| 42 |
+
}
|
| 43 |
+
/* Prevent sidebar from covering footer */
|
| 44 |
+
.main-content {
|
| 45 |
+
min-height: calc(100vh - 4rem);
|
| 46 |
+
}
|
| 47 |
+
/* Hover effects for cards and tabs */
|
| 48 |
+
.glass:hover {
|
| 49 |
+
transform: scale(1.05);
|
| 50 |
+
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
|
| 51 |
+
background: rgba(255, 255, 255, 0.15);
|
| 52 |
+
}
|
| 53 |
+
/* Tab content transition */
|
| 54 |
+
.tab-content {
|
| 55 |
+
display: none;
|
| 56 |
+
transition: opacity 0.3s ease;
|
| 57 |
+
}
|
| 58 |
+
.tab-content.active {
|
| 59 |
+
display: block;
|
| 60 |
+
opacity: 1;
|
| 61 |
+
}
|
| 62 |
+
/* Responsive sidebar */
|
| 63 |
+
@media (max-width: 768px) {
|
| 64 |
+
.sidebar {
|
| 65 |
+
transform: translateX(-100%);
|
| 66 |
+
}
|
| 67 |
+
.sidebar.active {
|
| 68 |
+
transform: translateX(0);
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
/* Copy button feedback */
|
| 72 |
+
.copy-btn.copied::after {
|
| 73 |
+
content: 'Copied!';
|
| 74 |
+
position: absolute;
|
| 75 |
+
top: -2rem;
|
| 76 |
+
right: 1rem;
|
| 77 |
+
background: #10b981;
|
| 78 |
+
color: white;
|
| 79 |
+
padding: 0.5rem;
|
| 80 |
+
border-radius: 0.5rem;
|
| 81 |
+
font-size: 0.875rem;
|
| 82 |
+
}
|
| 83 |
+
</style>
|
| 84 |
</head>
|
| 85 |
+
<body class="text-white flex flex-col min-h-screen">
|
| 86 |
+
<!-- Mobile toggle button -->
|
| 87 |
+
<button
|
| 88 |
+
id="sidebarToggle"
|
| 89 |
+
class="md:hidden fixed top-4 left-4 z-50 p-2 text-2xl text-white rounded bg-gray-800/60 hover:bg-gray-700/80 transition"
|
| 90 |
+
aria-label="Toggle navigation"
|
| 91 |
+
>
|
| 92 |
+
<i class="bx bx-menu"></i>
|
| 93 |
+
</button>
|
| 94 |
+
|
| 95 |
+
<!-- Sidebar -->
|
| 96 |
+
<aside
|
| 97 |
+
id="sidebar"
|
| 98 |
+
class="sidebar fixed inset-y-0 left-0 w-64 bg-gradient-to-b from-teal-800 to-emerald-900 p-6 flex flex-col overflow-y-auto z-40"
|
| 99 |
+
>
|
| 100 |
+
<button
|
| 101 |
+
id="closeSidebar"
|
| 102 |
+
class="md:hidden text-white text-2xl absolute top-4 right-4"
|
| 103 |
+
aria-label="Close sidebar"
|
| 104 |
+
>
|
| 105 |
+
✕
|
| 106 |
+
</button>
|
| 107 |
+
<img
|
| 108 |
+
src="https://raw.githubusercontent.com/Mark-Lasfar/MGZon/main/public/icons/mg.svg"
|
| 109 |
+
alt="MGZon Logo"
|
| 110 |
+
class="logo w-20 h-20 mx-auto mb-8 animate-pulse"
|
| 111 |
+
/>
|
| 112 |
+
<nav class="flex flex-col gap-3">
|
| 113 |
+
<a href="/" class="px-4 py-2 rounded-lg hover:bg-emerald-600 transition">Home</a>
|
| 114 |
+
<a href="/docs" class="px-4 py-2 rounded-lg bg-emerald-600">API Documentation</a>
|
| 115 |
+
<a href="https://hager-zon.vercel.app/about" class="px-4 py-2 rounded-lg hover:bg-emerald-600 transition">About MGZon</a>
|
| 116 |
+
<a href="https://hager-zon.vercel.app/community" class="px-4 py-2 rounded-lg hover:bg-emerald-600 transition">Community</a>
|
| 117 |
+
<a href="https://mark-elasfar.web.app/" target="_blank" class="px-4 py-2 rounded-lg hover:bg-emerald-600 transition">Mark Al-Asfar</a>
|
| 118 |
+
</nav>
|
| 119 |
+
</aside>
|
| 120 |
+
|
| 121 |
+
<!-- Main content -->
|
| 122 |
+
<main class="flex-1 md:ml-64 p-6 main-content">
|
| 123 |
+
<section class="container max-w-6xl mx-auto">
|
| 124 |
+
<a
|
| 125 |
+
href="/"
|
| 126 |
+
class="inline-block bg-gray-700/80 text-white px-4 py-2 rounded-lg mb-4 hover:bg-emerald-600 transition"
|
| 127 |
+
>
|
| 128 |
+
Back to Home
|
| 129 |
+
</a>
|
| 130 |
+
<div class="text-center py-12">
|
| 131 |
+
<img
|
| 132 |
+
src="https://raw.githubusercontent.com/Mark-Lasfar/MGZon/main/public/icons/mg.svg"
|
| 133 |
+
alt="MGZon Logo"
|
| 134 |
+
class="w-32 h-32 mx-auto mb-6 animate-bounce"
|
| 135 |
+
/>
|
| 136 |
+
<h1 class="text-5xl font-bold mb-4 bg-clip-text text-transparent bg-gradient-to-r from-teal-300 to-emerald-400">
|
| 137 |
+
MGZon API Documentation 📚
|
| 138 |
+
</h1>
|
| 139 |
+
<p class="text-lg max-w-2xl mx-auto mb-8">
|
| 140 |
+
Integrate MGZon Chatbot into your projects with our API. Supports Python (Django, Flask, FastAPI), JavaScript (React, Node.js, Express), Ruby (Rails), PHP (Laravel), and more.
|
| 141 |
+
</p>
|
| 142 |
+
<a
|
| 143 |
+
href="/swagger"
|
| 144 |
+
class="inline-block bg-emerald-500 text-white px-4 py-2 rounded-lg mt-4 hover:bg-emerald-600 transition"
|
| 145 |
+
>
|
| 146 |
+
View Interactive API Docs
|
| 147 |
+
</a>
|
| 148 |
+
</div>
|
| 149 |
+
<div class="docs my-12">
|
| 150 |
+
<h2 class="text-3xl font-bold text-center mb-8">Endpoints</h2>
|
| 151 |
+
<div class="flex flex-wrap gap-4 mb-8">
|
| 152 |
+
<button class="tab-btn glass px-4 py-2 rounded-lg text-white bg-emerald-500" data-tab="chat">Chat</button>
|
| 153 |
+
<button class="tab-btn glass px-4 py-2 rounded-lg text-white" data-tab="code">Code</button>
|
| 154 |
+
<button class="tab-btn glass px-4 py-2 rounded-lg text-white" data-tab="analysis">Analysis</button>
|
| 155 |
+
<button class="tab-btn glass px-4 py-2 rounded-lg text-white" data-tab="oauth">OAuth</button>
|
| 156 |
+
</div>
|
| 157 |
+
<div id="chat" class="tab-content glass p-6 active">
|
| 158 |
+
<div class="code-block glass p-6 mb-6 relative">
|
| 159 |
+
<h3 class="text-xl font-semibold text-emerald-300 mb-2">POST /api/chat</h3>
|
| 160 |
+
<p>Send a chat message to the MGZon Chatbot and get a response.</p>
|
| 161 |
+
<pre><code class="language-json">{
|
| 162 |
+
"message": "Your query here",
|
| 163 |
+
"system_prompt": "You are a helpful assistant",
|
| 164 |
+
"history": [{"role": "user", "content": "Previous message"}, {"role": "assistant", "content": "Previous response"}],
|
| 165 |
+
"temperature": 0.7,
|
| 166 |
+
"max_new_tokens": 4096,
|
| 167 |
+
"enable_browsing": false
|
| 168 |
}</code></pre>
|
| 169 |
+
<button class="copy-btn bg-emerald-500 text-white px-4 py-2 rounded-lg mt-4 relative">Copy</button>
|
| 170 |
+
</div>
|
| 171 |
+
<div class="code-block glass p-6 mb-6 relative">
|
| 172 |
+
<h3 class="text-xl font-semibold text-emerald-300 mb-2">Python (requests)</h3>
|
| 173 |
+
<pre><code class="language-python">import requests
|
| 174 |
|
| 175 |
response = requests.post(
|
| 176 |
"https://hager-zon.vercel.app/api/chat",
|
|
|
|
| 182 |
}
|
| 183 |
)
|
| 184 |
print(response.json())</code></pre>
|
| 185 |
+
<button class="copy-btn bg-emerald-500 text-white px-4 py-2 rounded-lg mt-4 relative">Copy</button>
|
| 186 |
+
</div>
|
| 187 |
+
<div class="code-block glass p-6 mb-6 relative">
|
| 188 |
+
<h3 class="text-xl font-semibold text-emerald-300 mb-2">Python (Django)</h3>
|
| 189 |
+
<pre><code class="language-python">import requests
|
| 190 |
from django.http import JsonResponse
|
| 191 |
from django.views import View
|
| 192 |
|
|
|
|
| 198 |
json={"message": data, "system_prompt": "You are a coding expert", "temperature": 0.7}
|
| 199 |
)
|
| 200 |
return JsonResponse(response.json())</code></pre>
|
| 201 |
+
<button class="copy-btn bg-emerald-500 text-white px-4 py-2 rounded-lg mt-4 relative">Copy</button>
|
| 202 |
+
</div>
|
| 203 |
+
<div class="code-block glass p-6 mb-6 relative">
|
| 204 |
+
<h3 class="text-xl font-semibold text-emerald-300 mb-2">Python (Flask)</h3>
|
| 205 |
+
<pre><code class="language-python">from flask import Flask, request, jsonify
|
| 206 |
import requests
|
| 207 |
|
| 208 |
app = Flask(__name__)
|
|
|
|
| 215 |
json={"message": data, "system_prompt": "You are a coding expert", "temperature": 0.7}
|
| 216 |
)
|
| 217 |
return jsonify(response.json())</code></pre>
|
| 218 |
+
<button class="copy-btn bg-emerald-500 text-white px-4 py-2 rounded-lg mt-4 relative">Copy</button>
|
| 219 |
+
</div>
|
| 220 |
+
<div class="code-block glass p-6 mb-6 relative">
|
| 221 |
+
<h3 class="text-xl font-semibold text-emerald-300 mb-2">JavaScript (React)</h3>
|
| 222 |
+
<pre><code class="language-javascript">import React, { useState } from 'react';
|
| 223 |
|
| 224 |
function ChatComponent() {
|
| 225 |
const [message, setMessage] = useState('');
|
|
|
|
| 250 |
}
|
| 251 |
|
| 252 |
export default ChatComponent;</code></pre>
|
| 253 |
+
<button class="copy-btn bg-emerald-500 text-white px-4 py-2 rounded-lg mt-4 relative">Copy</button>
|
| 254 |
+
</div>
|
| 255 |
+
<div class="code-block glass p-6 mb-6 relative">
|
| 256 |
+
<h3 class="text-xl font-semibold text-emerald-300 mb-2">JavaScript (Node.js/Express)</h3>
|
| 257 |
+
<pre><code class="language-javascript">const express = require('express');
|
| 258 |
const fetch = require('node-fetch');
|
| 259 |
const app = express();
|
| 260 |
|
|
|
|
| 277 |
});
|
| 278 |
|
| 279 |
app.listen(3000, () => console.log('Server running on port 3000'));</code></pre>
|
| 280 |
+
<button class="copy-btn bg-emerald-500 text-white px-4 py-2 rounded-lg mt-4 relative">Copy</button>
|
| 281 |
+
</div>
|
| 282 |
+
<div class="code-block glass p-6 mb-6 relative">
|
| 283 |
+
<h3 class="text-xl font-semibold text-emerald-300 mb-2">Ruby (Rails)</h3>
|
| 284 |
+
<pre><code class="language-ruby">require 'httparty'
|
| 285 |
|
| 286 |
class ChatController < ApplicationController
|
| 287 |
def create
|
|
|
|
| 298 |
render json: response.parsed_response
|
| 299 |
end
|
| 300 |
end</code></pre>
|
| 301 |
+
<button class="copy-btn bg-emerald-500 text-white px-4 py-2 rounded-lg mt-4 relative">Copy</button>
|
| 302 |
+
</div>
|
| 303 |
+
<div class="code-block glass p-6 mb-6 relative">
|
| 304 |
+
<h3 class="text-xl font-semibold text-emerald-300 mb-2">PHP (Laravel)</h3>
|
| 305 |
+
<pre><code class="language-php">use Illuminate\Support\Facades\Http;
|
| 306 |
|
| 307 |
class ChatController extends Controller
|
| 308 |
{
|
|
|
|
| 317 |
return $response->json();
|
| 318 |
}
|
| 319 |
}</code></pre>
|
| 320 |
+
<button class="copy-btn bg-emerald-500 text-white px-4 py-2 rounded-lg mt-4 relative">Copy</button>
|
| 321 |
+
</div>
|
| 322 |
+
<div class="code-block glass p-6 mb-6 relative">
|
| 323 |
+
<h3 class="text-xl font-semibold text-emerald-300 mb-2">Bash (cURL)</h3>
|
| 324 |
+
<pre><code class="language-bash">curl -X POST https://hager-zon.vercel.app/api/chat \
|
| 325 |
-H "Content-Type: application/json" \
|
| 326 |
-d '{"message":"Generate a React component","system_prompt":"You are a coding expert","temperature":0.7,"max_new_tokens":4096}'</code></pre>
|
| 327 |
+
<button class="copy-btn bg-emerald-500 text-white px-4 py-2 rounded-lg mt-4 relative">Copy</button>
|
| 328 |
+
</div>
|
| 329 |
+
</div>
|
| 330 |
+
<div id="code" class="tab-content glass p-6">
|
| 331 |
+
<div class="code-block glass p-6 mb-6 relative">
|
| 332 |
+
<h3 class="text-xl font-semibold text-emerald-300 mb-2">POST /api/code</h3>
|
| 333 |
+
<p>Generate or modify code for various frameworks.</p>
|
| 334 |
+
<pre><code class="language-json">{
|
| 335 |
+
"framework": "React",
|
| 336 |
+
"task": "Create a login form component",
|
| 337 |
+
"code": "// Existing code (optional)"
|
| 338 |
}</code></pre>
|
| 339 |
+
<button class="copy-btn bg-emerald-500 text-white px-4 py-2 rounded-lg mt-4 relative">Copy</button>
|
| 340 |
+
</div>
|
| 341 |
+
</div>
|
| 342 |
+
<div id="analysis" class="tab-content glass p-6">
|
| 343 |
+
<div class="code-block glass p-6 mb-6 relative">
|
| 344 |
+
<h3 class="text-xl font-semibold text-emerald-300 mb-2">POST /api/analysis</h3>
|
| 345 |
+
<p>Analyze code or data with detailed insights.</p>
|
| 346 |
+
<pre><code class="language-json">{
|
| 347 |
+
"text": "Analyze this Python code: print('Hello World')"
|
| 348 |
}</code></pre>
|
| 349 |
+
<button class="copy-btn bg-emerald-500 text-white px-4 py-2 rounded-lg mt-4 relative">Copy</button>
|
| 350 |
+
</div>
|
| 351 |
+
</div>
|
| 352 |
+
<div id="oauth" class="tab-content glass p-6">
|
| 353 |
+
<div class="code-block glass p-6 mb-6 relative">
|
| 354 |
+
<h3 class="text-xl font-semibold text-emerald-300 mb-2">OAuth 2.0 Authentication</h3>
|
| 355 |
+
<p>Authenticate with MGZon using OAuth 2.0.</p>
|
| 356 |
+
<pre><code class="language-bash">curl -X POST https://hager-zon.vercel.app/oauth/token \
|
| 357 |
-H "Content-Type: application/json" \
|
| 358 |
-d '{"client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET", "grant_type": "client_credentials"}'</code></pre>
|
| 359 |
+
<button class="copy-btn bg-emerald-500 text-white px-4 py-2 rounded-lg mt-4 relative">Copy</button>
|
| 360 |
+
</div>
|
|
|
|
|
|
|
|
|
|
| 361 |
</div>
|
| 362 |
+
</div>
|
| 363 |
+
</section>
|
| 364 |
+
</main>
|
| 365 |
+
|
| 366 |
+
<!-- Footer -->
|
| 367 |
+
<footer class="bg-gradient-to-r from-teal-900 to-emerald-900 py-12 mt-8">
|
| 368 |
+
<div class="container max-w-6xl mx-auto text-center">
|
| 369 |
+
<img
|
| 370 |
+
src="https://raw.githubusercontent.com/Mark-Lasfar/MGZon/main/public/icons/mg.svg"
|
| 371 |
+
alt="MGZon Logo"
|
| 372 |
+
class="w-24 h-24 mx-auto mb-6 animate-pulse"
|
| 373 |
+
/>
|
| 374 |
+
<p class="mb-4">
|
| 375 |
+
Developed by
|
| 376 |
+
<a href="https://mark-elasfar.web.app/" target="_blank" class="text-emerald-300 hover:underline">Mark Al-Asfar</a>
|
| 377 |
+
| Powered by
|
| 378 |
+
<a href="https://hager-zon.vercel.app/" target="_blank" class="text-emerald-300 hover:underline">MGZon AI</a>
|
| 379 |
+
</p>
|
| 380 |
+
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6">
|
| 381 |
+
<div class="glass p-4 cursor-pointer" onclick="showCardDetails('email')">
|
| 382 |
+
<i class="bx bx-mail-send text-3xl text-emerald-300 mb-2"></i>
|
| 383 |
+
<h4 class="font-semibold mb-1">Email Us</h4>
|
| 384 |
+
<p>
|
| 385 |
+
<a href="mailto:[email protected]" class="text-emerald-300 hover:underline">[email protected]</a>
|
| 386 |
+
</p>
|
| 387 |
+
<div id="email-details" class="hidden mt-4 p-4 bg-gray-700/80 rounded-lg">
|
| 388 |
+
<p>Reach out to our support team for any inquiries or assistance.</p>
|
| 389 |
+
<button onclick="closeCardDetails('email')" class="bg-emerald-500 text-white px-4 py-2 rounded-lg mt-2">Close</button>
|
| 390 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 391 |
</div>
|
| 392 |
+
<div class="glass p-4 cursor-pointer" onclick="showCardDetails('phone')">
|
| 393 |
+
<i class="bx bx-phone text-3xl text-emerald-300 mb-2"></i>
|
| 394 |
+
<h4 class="font-semibold mb-1">Phone Support</h4>
|
| 395 |
+
<p>+1-800-123-4567</p>
|
| 396 |
+
<div id="phone-details" class="hidden mt-4 p-4 bg-gray-700/80 rounded-lg">
|
| 397 |
+
<p>Contact our support team via phone for immediate assistance.</p>
|
| 398 |
+
<button onclick="closeCardDetails('phone')" class="bg-emerald-500 text-white px-4 py-2 rounded-lg mt-2">Close</button>
|
| 399 |
+
</div>
|
| 400 |
+
</div>
|
| 401 |
+
<div class="glass p-4 cursor-pointer" onclick="showCardDetails('community')">
|
| 402 |
+
<i class="bx bx-group text-3xl text-emerald-300 mb-2"></i>
|
| 403 |
+
<h4 class="font-semibold mb-1">Community</h4>
|
| 404 |
+
<p>
|
| 405 |
+
<a href="https://hager-zon.vercel.app/community" class="text-emerald-300 hover:underline">Join us</a>
|
| 406 |
+
</p>
|
| 407 |
+
<div id="community-details" class="hidden mt-4 p-4 bg-gray-700/80 rounded-lg">
|
| 408 |
+
<p>Join our vibrant community to share ideas and collaborate.</p>
|
| 409 |
+
<button onclick="closeCardDetails('community')" class="bg-emerald-500 text-white px-4 py-2 rounded-lg mt-2">Close</button>
|
| 410 |
+
</div>
|
| 411 |
+
</div>
|
| 412 |
+
<div class="glass p-4 cursor-pointer" onclick="showCardDetails('api-docs')">
|
| 413 |
+
<i class="bx bx-code-alt text-3xl text-emerald-300 mb-2"></i>
|
| 414 |
+
<h4 class="font-semibold mb-1">API Docs</h4>
|
| 415 |
+
<p>
|
| 416 |
+
<a href="/docs" class="text-emerald-300 hover:underline">Explore Docs</a>
|
| 417 |
+
</p>
|
| 418 |
+
<div id="api-docs-details" class="hidden mt-4 p-4 bg-gray-700/80 rounded-lg">
|
| 419 |
+
<p>Explore our API documentation for seamless integration.</p>
|
| 420 |
+
<button onclick="closeCardDetails('api-docs')" class="bg-emerald-500 text-white px-4 py-2 rounded-lg mt-2">Close</button>
|
| 421 |
+
</div>
|
| 422 |
+
</div>
|
| 423 |
+
<div class="glass p-4 cursor-pointer" onclick="showCardDetails('faq')">
|
| 424 |
+
<i class="bx bx-help-circle text-3xl text-emerald-300 mb-2"></i>
|
| 425 |
+
<h4 class="font-semibold mb-1">FAQ</h4>
|
| 426 |
+
<p>
|
| 427 |
+
<a href="https://hager-zon.vercel.app/faq" target="_blank" class="text-emerald-300 hover:underline">Read FAQ</a>
|
| 428 |
+
</p>
|
| 429 |
+
<div id="faq-details" class="hidden mt-4 p-4 bg-gray-700/80 rounded-lg">
|
| 430 |
+
<p>Find answers to common questions in our FAQ section.</p>
|
| 431 |
+
<button onclick="closeCardDetails('faq')" class="bg-emerald-500 text-white px-4 py-2 rounded-lg mt-2">Close</button>
|
| 432 |
+
</div>
|
| 433 |
+
</div>
|
| 434 |
+
<div class="glass p-4 cursor-pointer" onclick="showCardDetails('docs')">
|
| 435 |
+
<i class="bx bx-book text-3xl text-emerald-300 mb-2"></i>
|
| 436 |
+
<h4 class="font-semibold mb-1">Documentation</h4>
|
| 437 |
+
<p>
|
| 438 |
+
<a href="/docs" class="text-emerald-300 hover:underline">Full Docs</a>
|
| 439 |
+
</p>
|
| 440 |
+
<div id="docs-details" class="hidden mt-4 p-4 bg-gray-700/80 rounded-lg">
|
| 441 |
+
<p>Access comprehensive documentation for MGZon Chatbot.</p>
|
| 442 |
+
<button onclick="closeCardDetails('docs')" class="bg-emerald-500 text-white px-4 py-2 rounded-lg mt-2">Close</button>
|
| 443 |
+
</div>
|
| 444 |
+
</div>
|
| 445 |
+
</div>
|
| 446 |
+
<div class="flex justify-center gap-6 mt-6">
|
| 447 |
+
<a href="https://github.com/Mark-Lasfar/MGZon" class="text-2xl text-white hover:text-emerald-300 transition">
|
| 448 |
+
<i class="bx bxl-github"></i>
|
| 449 |
+
</a>
|
| 450 |
+
<a href="https://x.com/MGZon" class="text-2xl text-white hover:text-emerald-300 transition">
|
| 451 |
+
<i class="bx bxl-twitter"></i>
|
| 452 |
+
</a>
|
| 453 |
+
<a href="https://www.facebook.com/people/Mark-Al-Asfar/pfbid02GMisUQ8AqWkNZjoKtWFHH1tbdHuVscN1cjcFnZWy9HkRaAsmanBfT6mhySAyqpg4l/" class="text-2xl text-white hover:text-emerald-300 transition">
|
| 454 |
+
<i class="bx bxl-facebook"></i>
|
| 455 |
+
</a>
|
| 456 |
+
</div>
|
| 457 |
+
<p class="mt-6">© 2025 Mark Al-Asfar & MGZon AI. All rights reserved.</p>
|
| 458 |
+
</div>
|
| 459 |
+
</footer>
|
| 460 |
+
|
| 461 |
+
<!-- Scripts -->
|
| 462 |
+
<script>
|
| 463 |
+
// Sidebar toggle
|
| 464 |
+
const sidebar = document.getElementById('sidebar');
|
| 465 |
+
const toggleBtn = document.getElementById('sidebarToggle');
|
| 466 |
+
const closeSidebarBtn = document.getElementById('closeSidebar');
|
| 467 |
+
|
| 468 |
+
toggleBtn.addEventListener('click', () => {
|
| 469 |
+
sidebar.classList.toggle('active');
|
| 470 |
+
sidebar.classList.toggle('-translate-x-full');
|
| 471 |
+
sidebar.classList.toggle('translate-x-0');
|
| 472 |
+
});
|
| 473 |
+
|
| 474 |
+
closeSidebarBtn.addEventListener('click', () => {
|
| 475 |
+
sidebar.classList.remove('active');
|
| 476 |
+
sidebar.classList.add('-translate-x-full');
|
| 477 |
+
sidebar.classList.remove('translate-x-0');
|
| 478 |
+
});
|
| 479 |
+
|
| 480 |
+
document.addEventListener('click', (e) => {
|
| 481 |
+
if (
|
| 482 |
+
!sidebar.contains(e.target) &&
|
| 483 |
+
!toggleBtn.contains(e.target) &&
|
| 484 |
+
window.innerWidth < 768
|
| 485 |
+
) {
|
| 486 |
+
sidebar.classList.remove('active');
|
| 487 |
+
sidebar.classList.add('-translate-x-full');
|
| 488 |
+
sidebar.classList.remove('translate-x-0');
|
| 489 |
+
}
|
| 490 |
+
});
|
| 491 |
+
|
| 492 |
+
// Tab switching
|
| 493 |
+
document.querySelectorAll('.tab-btn').forEach(btn => {
|
| 494 |
+
btn.addEventListener('click', () => {
|
| 495 |
+
document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('bg-emerald-500'));
|
| 496 |
+
btn.classList.add('bg-emerald-500');
|
| 497 |
+
document.querySelectorAll('.tab-content').forEach(tab => tab.classList.remove('active'));
|
| 498 |
+
document.getElementById(btn.dataset.tab).classList.add('active');
|
| 499 |
+
});
|
| 500 |
+
});
|
| 501 |
+
|
| 502 |
+
// Copy button logic
|
| 503 |
+
document.querySelectorAll('.copy-btn').forEach(btn => {
|
| 504 |
+
btn.addEventListener('click', () => {
|
| 505 |
+
const code = btn.previousElementSibling.querySelector('code').textContent;
|
| 506 |
+
navigator.clipboard.writeText(code).then(() => {
|
| 507 |
+
btn.classList.add('copied');
|
| 508 |
+
setTimeout(() => btn.classList.remove('copied'), 2000);
|
| 509 |
});
|
| 510 |
+
});
|
| 511 |
+
});
|
| 512 |
+
|
| 513 |
+
// Card details toggle
|
| 514 |
+
function showCardDetails(cardId) {
|
| 515 |
+
document.getElementById(`${cardId}-details`).classList.remove('hidden');
|
| 516 |
+
}
|
| 517 |
+
function closeCardDetails(cardId) {
|
| 518 |
+
document.getElementById(`${cardId}-details`).classList.add('hidden');
|
| 519 |
+
}
|
| 520 |
+
</script>
|
| 521 |
</body>
|
| 522 |
</html>
|