Althafas commited on
Commit
65428bf
·
verified ·
1 Parent(s): d9a2a16

remove mock data and fetch from db? - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +790 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Clms
3
- emoji: 📉
4
- colorFrom: blue
5
- colorTo: green
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: clms
3
+ emoji: 🐳
4
+ colorFrom: green
5
+ colorTo: gray
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,790 @@
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>Computron LMS</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
+ <style>
10
+ .sidebar {
11
+ transition: all 0.3s ease;
12
+ }
13
+ .sidebar.collapsed {
14
+ width: 70px;
15
+ }
16
+ .sidebar.collapsed .sidebar-text {
17
+ display: none;
18
+ }
19
+ .sidebar.collapsed .logo-text {
20
+ display: none;
21
+ }
22
+ .sidebar.collapsed .expand-icon {
23
+ transform: rotate(180deg);
24
+ }
25
+ .main-content {
26
+ transition: all 0.3s ease;
27
+ }
28
+ .sidebar.collapsed + .main-content {
29
+ margin-left: 70px;
30
+ }
31
+ .course-card:hover {
32
+ transform: translateY(-5px);
33
+ box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
34
+ }
35
+ .progress-ring {
36
+ transform: rotate(-90deg);
37
+ }
38
+ .progress-ring-circle {
39
+ transition: stroke-dashoffset 0.5s ease;
40
+ }
41
+ .tab-content {
42
+ display: none;
43
+ }
44
+ .tab-content.active {
45
+ display: block;
46
+ animation: fadeIn 0.5s ease;
47
+ }
48
+ @keyframes fadeIn {
49
+ from { opacity: 0; }
50
+ to { opacity: 1; }
51
+ }
52
+ .dropdown-content {
53
+ display: none;
54
+ position: absolute;
55
+ right: 0;
56
+ min-width: 200px;
57
+ z-index: 1;
58
+ }
59
+ .dropdown:hover .dropdown-content {
60
+ display: block;
61
+ }
62
+ .mobile-menu {
63
+ display: none;
64
+ }
65
+ @media (max-width: 768px) {
66
+ .sidebar {
67
+ position: fixed;
68
+ z-index: 50;
69
+ left: -100%;
70
+ }
71
+ .sidebar.active {
72
+ left: 0;
73
+ }
74
+ .main-content {
75
+ margin-left: 0 !important;
76
+ }
77
+ .mobile-menu {
78
+ display: block;
79
+ }
80
+ }
81
+ </style>
82
+ </head>
83
+ <body class="bg-gray-50">
84
+ <div class="flex h-screen overflow-hidden">
85
+ <!-- Sidebar -->
86
+ <div class="sidebar bg-indigo-800 text-white w-64 flex-shrink-0 flex flex-col h-full">
87
+ <div class="p-4 flex items-center justify-between border-b border-indigo-700">
88
+ <div class="flex items-center">
89
+ <i class="fas fa-laptop-code text-2xl mr-3"></i>
90
+ <span class="logo-text font-bold text-xl">Computron LMS</span>
91
+ </div>
92
+ <button id="toggleSidebar" class="text-white focus:outline-none">
93
+ <i class="fas fa-chevron-left expand-icon"></i>
94
+ </button>
95
+ </div>
96
+ <div class="p-4 border-b border-indigo-700 flex items-center">
97
+ <div class="relative">
98
+ <img src="https://randomuser.me/api/portraits/men/32.jpg" alt="User" class="w-10 h-10 rounded-full border-2 border-white">
99
+ <span class="absolute bottom-0 right-0 w-3 h-3 bg-green-500 rounded-full border-2 border-white"></span>
100
+ </div>
101
+ <div class="ml-3 sidebar-text">
102
+ <div class="font-medium">John Doe</div>
103
+ <div class="text-xs text-indigo-200">Admin</div>
104
+ </div>
105
+ </div>
106
+ <nav class="flex-1 overflow-y-auto">
107
+ <div class="p-2">
108
+ <a href="#" class="flex items-center p-2 rounded hover:bg-indigo-700 text-white">
109
+ <i class="fas fa-tachometer-alt mr-3"></i>
110
+ <span class="sidebar-text">Dashboard</span>
111
+ </a>
112
+ <a href="#" class="flex items-center p-2 rounded hover:bg-indigo-700 text-white">
113
+ <i class="fas fa-book mr-3"></i>
114
+ <span class="sidebar-text">Courses</span>
115
+ </a>
116
+ <a href="#" class="flex items-center p-2 rounded hover:bg-indigo-700 text-white">
117
+ <i class="fas fa-users mr-3"></i>
118
+ <span class="sidebar-text">Students</span>
119
+ </a>
120
+ <a href="#" class="flex items-center p-2 rounded hover:bg-indigo-700 text-white">
121
+ <i class="fas fa-chalkboard-teacher mr-3"></i>
122
+ <span class="sidebar-text">Instructors</span>
123
+ </a>
124
+ <a href="#" class="flex items-center p-2 rounded hover:bg-indigo-700 text-white">
125
+ <i class="fas fa-calendar-alt mr-3"></i>
126
+ <span class="sidebar-text">Batches</span>
127
+ </a>
128
+ <a href="#" class="flex items-center p-2 rounded hover:bg-indigo-700 text-white">
129
+ <i class="fas fa-video mr-3"></i>
130
+ <span class="sidebar-text">Sessions</span>
131
+ </a>
132
+ <a href="#" class="flex items-center p-2 rounded hover:bg-indigo-700 text-white">
133
+ <i class="fas fa-file-invoice-dollar mr-3"></i>
134
+ <span class="sidebar-text">Payments</span>
135
+ </a>
136
+ <a href="#" class="flex items-center p-2 rounded hover:bg-indigo-700 text-white">
137
+ <i class="fas fa-cog mr-3"></i>
138
+ <span class="sidebar-text">Settings</span>
139
+ </a>
140
+ </div>
141
+ </nav>
142
+ <div class="p-4 border-t border-indigo-700">
143
+ <a href="#" class="flex items-center p-2 rounded hover:bg-indigo-700 text-white">
144
+ <i class="fas fa-sign-out-alt mr-3"></i>
145
+ <span class="sidebar-text">Logout</span>
146
+ </a>
147
+ </div>
148
+ </div>
149
+
150
+ <!-- Main Content -->
151
+ <div class="main-content flex-1 flex flex-col overflow-hidden">
152
+ <!-- Top Navigation -->
153
+ <header class="bg-white shadow-sm">
154
+ <div class="px-4 py-3 flex items-center justify-between">
155
+ <div class="flex items-center">
156
+ <button id="mobileMenuToggle" class="mobile-menu mr-4 text-gray-600 focus:outline-none">
157
+ <i class="fas fa-bars text-xl"></i>
158
+ </button>
159
+ <h1 class="text-xl font-semibold text-gray-800">Dashboard</h1>
160
+ </div>
161
+ <div class="flex items-center space-x-4">
162
+ <div class="relative">
163
+ <button class="text-gray-600 focus:outline-none">
164
+ <i class="fas fa-bell text-xl"></i>
165
+ <span class="absolute top-0 right-0 w-2 h-2 bg-red-500 rounded-full"></span>
166
+ </button>
167
+ </div>
168
+ <div class="dropdown relative">
169
+ <button class="flex items-center focus:outline-none">
170
+ <img src="https://randomuser.me/api/portraits/men/32.jpg" alt="User" class="w-8 h-8 rounded-full">
171
+ <span class="ml-2 hidden md:inline">John Doe</span>
172
+ <i class="fas fa-chevron-down ml-1 text-xs hidden md:inline"></i>
173
+ </button>
174
+ <div class="dropdown-content mt-2 bg-white rounded shadow-lg py-2">
175
+ <a href="#" class="block px-4 py-2 text-gray-800 hover:bg-gray-100">Profile</a>
176
+ <a href="#" class="block px-4 py-2 text-gray-800 hover:bg-gray-100">Settings</a>
177
+ <a href="#" class="block px-4 py-2 text-gray-800 hover:bg-gray-100">Logout</a>
178
+ </div>
179
+ </div>
180
+ </div>
181
+ </div>
182
+ </header>
183
+
184
+ <!-- Main Content Area -->
185
+ <main class="flex-1 overflow-y-auto p-4 md:p-6 relative">
186
+ <!-- Loader -->
187
+ <div id="loader" class="hidden absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center z-50">
188
+ <div class="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-indigo-500"></div>
189
+ </div>
190
+
191
+ <!-- Error Container -->
192
+ <div id="error-container" class="hidden fixed top-4 right-4 bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded z-50"></div>
193
+ <!-- Stats Cards -->
194
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
195
+ <div class="bg-white rounded-lg shadow p-4">
196
+ <div class="flex items-center">
197
+ <div class="p-3 rounded-full bg-indigo-100 text-indigo-600">
198
+ <i class="fas fa-users text-xl"></i>
199
+ </div>
200
+ <div class="ml-4">
201
+ <p class="text-sm font-medium text-gray-500">Total Students</p>
202
+ <p class="text-2xl font-semibold text-gray-800" data-stat="students">0</p>
203
+ </div>
204
+ </div>
205
+ <div class="mt-4">
206
+ <span class="text-green-500 text-sm font-medium">+12.5%</span>
207
+ <span class="text-gray-500 text-sm ml-2">from last month</span>
208
+ </div>
209
+ </div>
210
+ <div class="bg-white rounded-lg shadow p-4">
211
+ <div class="flex items-center">
212
+ <div class="p-3 rounded-full bg-blue-100 text-blue-600">
213
+ <i class="fas fa-chalkboard-teacher text-xl"></i>
214
+ </div>
215
+ <div class="ml-4">
216
+ <p class="text-sm font-medium text-gray-500">Active Instructors</p>
217
+ <p class="text-2xl font-semibold text-gray-800" data-stat="instructors">0</p>
218
+ </div>
219
+ </div>
220
+ <div class="mt-4">
221
+ <span class="text-green-500 text-sm font-medium">+3.2%</span>
222
+ <span class="text-gray-500 text-sm ml-2">from last month</span>
223
+ </div>
224
+ </div>
225
+ <div class="bg-white rounded-lg shadow p-4">
226
+ <div class="flex items-center">
227
+ <div class="p-3 rounded-full bg-green-100 text-green-600">
228
+ <i class="fas fa-book text-xl"></i>
229
+ </div>
230
+ <div class="ml-4">
231
+ <p class="text-sm font-medium text-gray-500">Courses</p>
232
+ <p class="text-2xl font-semibold text-gray-800" data-stat="courses">0</p>
233
+ </div>
234
+ </div>
235
+ <div class="mt-4">
236
+ <span class="text-green-500 text-sm font-medium">+5.7%</span>
237
+ <span class="text-gray-500 text-sm ml-2">from last month</span>
238
+ </div>
239
+ </div>
240
+ <div class="bg-white rounded-lg shadow p-4">
241
+ <div class="flex items-center">
242
+ <div class="p-3 rounded-full bg-purple-100 text-purple-600">
243
+ <i class="fas fa-dollar-sign text-xl"></i>
244
+ </div>
245
+ <div class="ml-4">
246
+ <p class="text-sm font-medium text-gray-500">Revenue</p>
247
+ <p class="text-2xl font-semibold text-gray-800" data-stat="revenue">$0</p>
248
+ </div>
249
+ </div>
250
+ <div class="mt-4">
251
+ <span class="text-green-500 text-sm font-medium">+8.1%</span>
252
+ <span class="text-gray-500 text-sm ml-2">from last month</span>
253
+ </div>
254
+ </div>
255
+ </div>
256
+
257
+ <!-- Recent Activity and Progress -->
258
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6">
259
+ <div class="lg:col-span-2 bg-white rounded-lg shadow p-6">
260
+ <div class="flex justify-between items-center mb-4">
261
+ <h2 class="text-lg font-semibold text-gray-800">Recent Activity</h2>
262
+ <a href="#" class="text-sm text-indigo-600 hover:text-indigo-800">View All</a>
263
+ </div>
264
+ <div class="space-y-4">
265
+ <div class="flex items-start">
266
+ <div class="p-2 rounded-full bg-indigo-100 text-indigo-600">
267
+ <i class="fas fa-user-plus"></i>
268
+ </div>
269
+ <div class="ml-3">
270
+ <p class="text-sm font-medium text-gray-800">New student registered</p>
271
+ <p class="text-xs text-gray-500">Sarah Johnson enrolled in "Advanced JavaScript"</p>
272
+ <p class="text-xs text-gray-400 mt-1">10 minutes ago</p>
273
+ </div>
274
+ </div>
275
+ <div class="flex items-start">
276
+ <div class="p-2 rounded-full bg-blue-100 text-blue-600">
277
+ <i class="fas fa-video"></i>
278
+ </div>
279
+ <div class="ml-3">
280
+ <p class="text-sm font-medium text-gray-800">New session uploaded</p>
281
+ <p class="text-xs text-gray-500">Prof. Smith uploaded "React Hooks Deep Dive" for Batch #42</p>
282
+ <p class="text-xs text-gray-400 mt-1">2 hours ago</p>
283
+ </div>
284
+ </div>
285
+ <div class="flex items-start">
286
+ <div class="p-2 rounded-full bg-green-100 text-green-600">
287
+ <i class="fas fa-check-circle"></i>
288
+ </div>
289
+ <div class="ml-3">
290
+ <p class="text-sm font-medium text-gray-800">Payment received</p>
291
+ <p class="text-xs text-gray-500">Michael Brown completed payment for "Full Stack Development"</p>
292
+ <p class="text-xs text-gray-400 mt-1">5 hours ago</p>
293
+ </div>
294
+ </div>
295
+ <div class="flex items-start">
296
+ <div class="p-2 rounded-full bg-purple-100 text-purple-600">
297
+ <i class="fas fa-comment"></i>
298
+ </div>
299
+ <div class="ml-3">
300
+ <p class="text-sm font-medium text-gray-800">New feedback received</p>
301
+ <p class="text-xs text-gray-500">Lisa Wong rated "Python for Beginners" 5 stars</p>
302
+ <p class="text-xs text-gray-400 mt-1">1 day ago</p>
303
+ </div>
304
+ </div>
305
+ </div>
306
+ </div>
307
+ <div class="bg-white rounded-lg shadow p-6">
308
+ <h2 class="text-lg font-semibold text-gray-800 mb-4">Course Completion</h2>
309
+ <div class="flex justify-center mb-6">
310
+ <div class="relative w-32 h-32">
311
+ <svg class="progress-ring w-full h-full" viewBox="0 0 100 100">
312
+ <circle class="progress-ring-circle stroke-indigo-100" stroke-width="8" fill="transparent" r="40" cx="50" cy="50"></circle>
313
+ <circle class="progress-ring-circle stroke-indigo-600" stroke-width="8" stroke-dasharray="251.2" stroke-dashoffset="75.36" stroke-linecap="round" fill="transparent" r="40" cx="50" cy="50"></circle>
314
+ </svg>
315
+ <div class="absolute inset-0 flex items-center justify-center">
316
+ <span class="text-2xl font-bold text-indigo-600">70%</span>
317
+ </div>
318
+ </div>
319
+ </div>
320
+ <div class="space-y-3">
321
+ <div>
322
+ <div class="flex justify-between mb-1">
323
+ <span class="text-sm font-medium text-gray-700">Web Development</span>
324
+ <span class="text-sm text-gray-500">85%</span>
325
+ </div>
326
+ <div class="w-full bg-gray-200 rounded-full h-2">
327
+ <div class="bg-blue-600 h-2 rounded-full" style="width: 85%"></div>
328
+ </div>
329
+ </div>
330
+ <div>
331
+ <div class="flex justify-between mb-1">
332
+ <span class="text-sm font-medium text-gray-700">Data Science</span>
333
+ <span class="text-sm text-gray-500">65%</span>
334
+ </div>
335
+ <div class="w-full bg-gray-200 rounded-full h-2">
336
+ <div class="bg-green-600 h-2 rounded-full" style="width: 65%"></div>
337
+ </div>
338
+ </div>
339
+ <div>
340
+ <div class="flex justify-between mb-1">
341
+ <span class="text-sm font-medium text-gray-700">DevOps</span>
342
+ <span class="text-sm text-gray-500">45%</span>
343
+ </div>
344
+ <div class="w-full bg-gray-200 rounded-full h-2">
345
+ <div class="bg-purple-600 h-2 rounded-full" style="width: 45%"></div>
346
+ </div>
347
+ </div>
348
+ </div>
349
+ </div>
350
+ </div>
351
+
352
+ <!-- Courses Section -->
353
+ <div class="bg-white rounded-lg shadow p-6 mb-6">
354
+ <div class="flex justify-between items-center mb-6">
355
+ <h2 class="text-lg font-semibold text-gray-800">Popular Courses</h2>
356
+ <div class="flex space-x-1">
357
+ <button class="px-3 py-1 text-sm rounded-md bg-indigo-600 text-white">All</button>
358
+ <button class="px-3 py-1 text-sm rounded-md bg-gray-200 text-gray-700 hover:bg-gray-300">Individual</button>
359
+ <button class="px-3 py-1 text-sm rounded-md bg-gray-200 text-gray-700 hover:bg-gray-300">Bundles</button>
360
+ </div>
361
+ </div>
362
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
363
+ <div class="course-card bg-white border border-gray-200 rounded-lg overflow-hidden transition duration-300">
364
+ <div class="relative">
365
+ <img src="https://images.unsplash.com/photo-1555066931-4365d14bab8c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Course" class="w-full h-40 object-cover">
366
+ <div class="absolute top-2 right-2 bg-indigo-600 text-white text-xs px-2 py-1 rounded">NEW</div>
367
+ </div>
368
+ <div class="p-4">
369
+ <div class="flex justify-between items-start">
370
+ <div>
371
+ <h3 class="font-semibold text-gray-800 mb-1">Full Stack Development</h3>
372
+ <p class="text-sm text-gray-600">Learn MERN stack from scratch</p>
373
+ </div>
374
+ <span class="bg-indigo-100 text-indigo-800 text-xs px-2 py-1 rounded">Bundle</span>
375
+ </div>
376
+ <div class="mt-4 flex justify-between items-center">
377
+ <div class="flex items-center">
378
+ <i class="fas fa-star text-yellow-400 mr-1"></i>
379
+ <span class="text-sm text-gray-700">4.8</span>
380
+ <span class="text-sm text-gray-500 mx-1">•</span>
381
+ <span class="text-sm text-gray-500">256 students</span>
382
+ </div>
383
+ <span class="font-semibold text-gray-800">$199</span>
384
+ </div>
385
+ </div>
386
+ </div>
387
+ <div class="course-card bg-white border border-gray-200 rounded-lg overflow-hidden transition duration-300">
388
+ <div class="relative">
389
+ <img src="https://images.unsplash.com/photo-1547658719-da2b51169166?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1528&q=80" alt="Course" class="w-full h-40 object-cover">
390
+ </div>
391
+ <div class="p-4">
392
+ <div class="flex justify-between items-start">
393
+ <div>
394
+ <h3 class="font-semibold text-gray-800 mb-1">Advanced JavaScript</h3>
395
+ <p class="text-sm text-gray-600">Master modern JavaScript concepts</p>
396
+ </div>
397
+ <span class="bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded">Individual</span>
398
+ </div>
399
+ <div class="mt-4 flex justify-between items-center">
400
+ <div class="flex items-center">
401
+ <i class="fas fa-star text-yellow-400 mr-1"></i>
402
+ <span class="text-sm text-gray-700">4.9</span>
403
+ <span class="text-sm text-gray-500 mx-1">•</span>
404
+ <span class="text-sm text-gray-500">189 students</span>
405
+ </div>
406
+ <span class="font-semibold text-gray-800">$89</span>
407
+ </div>
408
+ </div>
409
+ </div>
410
+ <div class="course-card bg-white border border-gray-200 rounded-lg overflow-hidden transition duration-300">
411
+ <div class="relative">
412
+ <img src="https://images.unsplash.com/photo-1551288049-bebda4e38f71?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80" alt="Course" class="w-full h-40 object-cover">
413
+ <div class="absolute top-2 right-2 bg-green-600 text-white text-xs px-2 py-1 rounded">BESTSELLER</div>
414
+ </div>
415
+ <div class="p-4">
416
+ <div class="flex justify-between items-start">
417
+ <div>
418
+ <h3 class="font-semibold text-gray-800 mb-1">Python for Data Science</h3>
419
+ <p class="text-sm text-gray-600">Data analysis with Pandas & NumPy</p>
420
+ </div>
421
+ <span class="bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded">Individual</span>
422
+ </div>
423
+ <div class="mt-4 flex justify-between items-center">
424
+ <div class="flex items-center">
425
+ <i class="fas fa-star text-yellow-400 mr-1"></i>
426
+ <span class="text-sm text-gray-700">4.7</span>
427
+ <span class="text-sm text-gray-500 mx-1">•</span>
428
+ <span class="text-sm text-gray-500">312 students</span>
429
+ </div>
430
+ <span class="font-semibold text-gray-800">$129</span>
431
+ </div>
432
+ </div>
433
+ </div>
434
+ </div>
435
+ <div class="mt-6 text-center">
436
+ <button class="px-4 py-2 border border-indigo-600 text-indigo-600 rounded-md hover:bg-indigo-50 transition duration-300">
437
+ View All Courses
438
+ </button>
439
+ </div>
440
+ </div>
441
+
442
+ <!-- Upcoming Batches -->
443
+ <div class="bg-white rounded-lg shadow p-6">
444
+ <div class="flex justify-between items-center mb-6">
445
+ <h2 class="text-lg font-semibold text-gray-800">Upcoming Batches</h2>
446
+ <a href="#" class="text-sm text-indigo-600 hover:text-indigo-800">View All</a>
447
+ </div>
448
+ <div class="overflow-x-auto">
449
+ <table class="min-w-full divide-y divide-gray-200">
450
+ <thead class="bg-gray-50">
451
+ <tr>
452
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Batch</th>
453
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Course</th>
454
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Instructor</th>
455
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Start Date</th>
456
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Students</th>
457
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
458
+ <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Action</th>
459
+ </tr>
460
+ </thead>
461
+ <tbody class="bg-white divide-y divide-gray-200">
462
+ <tr>
463
+ <td class="px-6 py-4 whitespace-nowrap">
464
+ <div class="font-medium text-gray-900">Batch #42</div>
465
+ </td>
466
+ <td class="px-6 py-4 whitespace-nowrap">
467
+ <div class="text-sm text-gray-900">Full Stack Development</div>
468
+ </td>
469
+ <td class="px-6 py-4 whitespace-nowrap">
470
+ <div class="flex items-center">
471
+ <img src="https://randomuser.me/api/portraits/men/41.jpg" alt="Instructor" class="w-8 h-8 rounded-full mr-2">
472
+ <span>Prof. Smith</span>
473
+ </div>
474
+ </td>
475
+ <td class="px-6 py-4 whitespace-nowrap">
476
+ <div class="text-sm text-gray-500">15 Jun 2023</div>
477
+ </td>
478
+ <td class="px-6 py-4 whitespace-nowrap">
479
+ <div class="text-sm text-gray-900">24/30</div>
480
+ </td>
481
+ <td class="px-6 py-4 whitespace-nowrap">
482
+ <span class="px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800">Upcoming</span>
483
+ </td>
484
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
485
+ <button class="text-indigo-600 hover:text-indigo-900">Manage</button>
486
+ </td>
487
+ </tr>
488
+ <tr>
489
+ <td class="px-6 py-4 whitespace-nowrap">
490
+ <div class="font-medium text-gray-900">Batch #43</div>
491
+ </td>
492
+ <td class="px-6 py-4 whitespace-nowrap">
493
+ <div class="text-sm text-gray-900">Advanced JavaScript</div>
494
+ </td>
495
+ <td class="px-6 py-4 whitespace-nowrap">
496
+ <div class="flex items-center">
497
+ <img src="https://randomuser.me/api/portraits/women/44.jpg" alt="Instructor" class="w-8 h-8 rounded-full mr-2">
498
+ <span>Dr. Johnson</span>
499
+ </div>
500
+ </td>
501
+ <td class="px-6 py-4 whitespace-nowrap">
502
+ <div class="text-sm text-gray-500">20 Jun 2023</div>
503
+ </td>
504
+ <td class="px-6 py-4 whitespace-nowrap">
505
+ <div class="text-sm text-gray-900">18/25</div>
506
+ </td>
507
+ <td class="px-6 py-4 whitespace-nowrap">
508
+ <span class="px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800">Upcoming</span>
509
+ </td>
510
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
511
+ <button class="text-indigo-600 hover:text-indigo-900">Manage</button>
512
+ </td>
513
+ </tr>
514
+ <tr>
515
+ <td class="px-6 py-4 whitespace-nowrap">
516
+ <div class="font-medium text-gray-900">Batch #44</div>
517
+ </td>
518
+ <td class="px-6 py-4 whitespace-nowrap">
519
+ <div class="text-sm text-gray-900">Python for Data Science</div>
520
+ </td>
521
+ <td class="px-6 py-4 whitespace-nowrap">
522
+ <div class="flex items-center">
523
+ <img src="https://randomuser.me/api/portraits/men/32.jpg" alt="Instructor" class="w-8 h-8 rounded-full mr-2">
524
+ <span>Prof. Williams</span>
525
+ </div>
526
+ </td>
527
+ <td class="px-6 py-4 whitespace-nowrap">
528
+ <div class="text-sm text-gray-500">25 Jun 2023</div>
529
+ </td>
530
+ <td class="px-6 py-4 whitespace-nowrap">
531
+ <div class="text-sm text-gray-900">15/20</div>
532
+ </td>
533
+ <td class="px-6 py-4 whitespace-nowrap">
534
+ <span class="px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800">Upcoming</span>
535
+ </td>
536
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
537
+ <button class="text-indigo-600 hover:text-indigo-900">Manage</button>
538
+ </td>
539
+ </tr>
540
+ </tbody>
541
+ </table>
542
+ </div>
543
+ </div>
544
+ </main>
545
+ </div>
546
+ </div>
547
+
548
+ <script>
549
+ // Enhanced API Service with error handling
550
+ const apiService = {
551
+ async request(method, url, data = null) {
552
+ const config = {
553
+ method,
554
+ headers: {
555
+ 'Content-Type': 'application/json',
556
+ 'Authorization': `Bearer ${localStorage.getItem('token')}`
557
+ }
558
+ };
559
+
560
+ if (data) {
561
+ config.body = JSON.stringify(data);
562
+ }
563
+
564
+ const response = await fetch(`/api${url}`, config);
565
+
566
+ if (!response.ok) {
567
+ const error = await response.json();
568
+ throw new Error(error.message || 'Request failed');
569
+ }
570
+
571
+ return await response.json();
572
+ },
573
+
574
+ get(url) {
575
+ return this.request('GET', url);
576
+ },
577
+
578
+ post(url, data) {
579
+ return this.request('POST', url, data);
580
+ },
581
+
582
+ put(url, data) {
583
+ return this.request('PUT', url, data);
584
+ },
585
+
586
+ delete(url) {
587
+ return this.request('DELETE', url);
588
+ }
589
+ };
590
+
591
+ // Toggle sidebar
592
+ const toggleSidebar = document.getElementById('toggleSidebar');
593
+ const sidebar = document.querySelector('.sidebar');
594
+ const mainContent = document.querySelector('.main-content');
595
+
596
+ toggleSidebar.addEventListener('click', () => {
597
+ sidebar.classList.toggle('collapsed');
598
+ });
599
+
600
+ // Mobile menu toggle
601
+ const mobileMenuToggle = document.getElementById('mobileMenuToggle');
602
+ mobileMenuToggle.addEventListener('click', () => {
603
+ sidebar.classList.toggle('active');
604
+ });
605
+
606
+ // Tab functionality
607
+ const tabs = document.querySelectorAll('.tab-button');
608
+ const tabContents = document.querySelectorAll('.tab-content');
609
+
610
+ tabs.forEach(tab => {
611
+ tab.addEventListener('click', () => {
612
+ // Remove active class from all tabs and contents
613
+ tabs.forEach(t => t.classList.remove('active'));
614
+ tabContents.forEach(c => c.classList.remove('active'));
615
+
616
+ // Add active class to clicked tab and corresponding content
617
+ tab.classList.add('active');
618
+ const tabId = tab.getAttribute('data-tab');
619
+ document.getElementById(tabId).classList.add('active');
620
+ });
621
+ });
622
+
623
+ // Authentication handling
624
+ function checkAuth() {
625
+ const token = localStorage.getItem('token');
626
+ if (!token) {
627
+ window.location.href = '/login';
628
+ }
629
+ }
630
+
631
+ // Logout functionality
632
+ document.querySelector('.logout-btn').addEventListener('click', () => {
633
+ localStorage.removeItem('token');
634
+ window.location.href = '/login';
635
+ });
636
+
637
+ // Initialize first tab as active
638
+ if (tabs.length > 0) {
639
+ tabs[0].classList.add('active');
640
+ const firstTabId = tabs[0].getAttribute('data-tab');
641
+ document.getElementById(firstTabId).classList.add('active');
642
+ }
643
+
644
+ // Course card hover effect
645
+ const courseCards = document.querySelectorAll('.course-card');
646
+ courseCards.forEach(card => {
647
+ card.addEventListener('mouseenter', () => {
648
+ card.classList.add('hover:shadow-lg');
649
+ });
650
+ card.addEventListener('mouseleave', () => {
651
+ card.classList.remove('hover:shadow-lg');
652
+ });
653
+ });
654
+
655
+ // Load real data from APIs with loading states
656
+ async function loadDashboardData() {
657
+ try {
658
+ showLoading(true);
659
+
660
+ // Get user data first
661
+ const [userData, stats, activity, courses, batches] = await Promise.all([
662
+ apiService.get('/auth/me'),
663
+ apiService.get('/admin/dashboard/stats'),
664
+ apiService.get('/admin/activity?limit=4'),
665
+ apiService.get('/courses?sort=popularity&limit=3'),
666
+ apiService.get('/batches?status=UPCOMING&limit=3')
667
+ ]);
668
+
669
+ // Update user info in sidebar
670
+ document.querySelector('.user-avatar').src = userData.avatar || 'https://randomuser.me/api/portraits/men/32.jpg';
671
+ document.querySelector('.user-name').textContent = userData.name;
672
+ document.querySelector('.user-role').textContent = userData.role;
673
+
674
+ updateStats(stats);
675
+ updateActivity(activity);
676
+ updateCourses(courses);
677
+ updateBatches(batches);
678
+
679
+ } catch (error) {
680
+ showError('Failed to load dashboard data: ' + error.message);
681
+ } finally {
682
+ showLoading(false);
683
+ }
684
+ }
685
+
686
+ function showLoading(loading) {
687
+ const loader = document.getElementById('loader');
688
+ if (loading) {
689
+ loader.classList.remove('hidden');
690
+ } else {
691
+ loader.classList.add('hidden');
692
+ }
693
+ }
694
+
695
+ function showError(message) {
696
+ const errorContainer = document.getElementById('error-container');
697
+ errorContainer.textContent = message;
698
+ errorContainer.classList.remove('hidden');
699
+ setTimeout(() => errorContainer.classList.add('hidden'), 5000);
700
+ }
701
+
702
+ // Update stats with proper formatting
703
+ function updateStats(stats) {
704
+ document.querySelector('[data-stat="students"]').textContent = stats.totalStudents.toLocaleString();
705
+ document.querySelector('[data-stat="instructors"]').textContent = stats.activeInstructors.toLocaleString();
706
+ document.querySelector('[data-stat="courses"]').textContent = stats.totalCourses.toLocaleString();
707
+ document.querySelector('[data-stat="revenue"]').textContent =
708
+ new Intl.NumberFormat('en-US', {
709
+ style: 'currency',
710
+ currency: 'USD'
711
+ }).format(stats.revenue);
712
+
713
+ // Update percentage changes
714
+ updatePercentageChange('students-change', stats.studentsChange);
715
+ updatePercentageChange('instructors-change', stats.instructorsChange);
716
+ updatePercentageChange('courses-change', stats.coursesChange);
717
+ updatePercentageChange('revenue-change', stats.revenueChange);
718
+ }
719
+
720
+ function updatePercentageChange(elementClass, change) {
721
+ const element = document.querySelector(`.${elementClass}`);
722
+ if (!element) return;
723
+
724
+ element.textContent = `${change > 0 ? '+' : ''}${change.toFixed(1)}%`;
725
+ element.className = `${elementClass} text-sm font-medium ${change >= 0 ? 'text-green-500' : 'text-red-500'}`;
726
+ }
727
+
728
+ function updateActivity(activities) {
729
+ const activityContainer = document.querySelector('.activity-container');
730
+ if (!activities || activities.length === 0) {
731
+ activityContainer.innerHTML = `
732
+ <div class="text-center py-4 text-gray-500">
733
+ No recent activity found
734
+ </div>
735
+ `;
736
+ return;
737
+ }
738
+
739
+ activityContainer.innerHTML = activities.map(activity => {
740
+ const { icon, color } = getActivityMeta(activity.type);
741
+ const formattedTime = formatTime(activity.timestamp);
742
+
743
+ return `
744
+ <div class="flex items-start">
745
+ <div class="p-2 rounded-full ${color}">
746
+ <i class="${icon}"></i>
747
+ </div>
748
+ <div class="ml-3">
749
+ <p class="text-sm font-medium text-gray-800">${activity.title}</p>
750
+ <p class="text-xs text-gray-500">${activity.details}</p>
751
+ <p class="text-xs text-gray-400 mt-1">${formattedTime}</p>
752
+ </div>
753
+ </div>
754
+ `;
755
+ }).join('');
756
+ }
757
+
758
+ function getActivityMeta(type) {
759
+ const types = {
760
+ 'enrollment': { icon: 'fas fa-user-plus', color: 'bg-indigo-100 text-indigo-600' },
761
+ 'payment': { icon: 'fas fa-dollar-sign', color: 'bg-green-100 text-green-600' },
762
+ 'session': { icon: 'fas fa-video', color: 'bg-blue-100 text-blue-600' },
763
+ 'feedback': { icon: 'fas fa-comment', color: 'bg-purple-100 text-purple-600' },
764
+ 'default': { icon: 'fas fa-info-circle', color: 'bg-gray-100 text-gray-600' }
765
+ };
766
+
767
+ return types[type] || types.default;
768
+ }
769
+
770
+ function formatTime(timestamp) {
771
+ const now = new Date();
772
+ const date = new Date(timestamp);
773
+ const diffInHours = Math.abs(now - date) / 36e5;
774
+
775
+ if (diffInHours < 24) {
776
+ return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
777
+ } else if (diffInHours < 48) {
778
+ return 'Yesterday';
779
+ } else {
780
+ return date.toLocaleDateString([], { month: 'short', day: 'numeric' });
781
+ }
782
+ }
783
+
784
+ // Initialize the dashboard
785
+ document.addEventListener('DOMContentLoaded', () => {
786
+ loadDashboardData();
787
+ });
788
+ </script>
789
+ <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=Althafas/clms" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
790
+ </html>