Abdurahmon07's picture
Create a full CRM system for an educational center using modern web technologies. ✔️ Structure: - Frontend: HTML5, Tailwind CSS, JavaScript - Backend: Node.js with Express, MongoDB for database - Authentication: JWT-based login and registration ✔️ Features: - Login and Register pages (JWT auth) - Dashboard with overview stats and charts - Student management (CRUD: add, edit, delete, view) - Payment tracking (monthly/weekly payment status) - Attendance tracking (present/absent toggle with dates) - Admin panel with settings and user management - Responsive design with animations and modals - Navigation sidebar and header bar with dropdown menus ✔️ Technical Requirements: - Use RESTful API architecture - Database models for Student, Payment, Attendance, User - Use dotenv for sensitive data and environment configs - Include .env.sample file - Frontend and backend in separate folders (client / server) - Return code in separate, clearly labeled file blocks ✔️ Output Format: Return all source code files ready to be downloaded and run. Separate each file like this: [client/index.html] [client/style.css] [server/server.js] [server/routes/studentRoutes.js] ... etc ✔️ Do not explain anything — just return working code. - Initial Deployment
55ac124 verified
Raw History Blame Contribute Delete
31.6 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>EduCRM - Dashboard</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.sidebar {
transition: all 0.3s;
}
.sidebar.collapsed {
width: 70px;
}
.sidebar.collapsed .nav-text {
display: none;
}
.main-content {
transition: margin-left 0.3s;
}
.chart-container {
height: 300px;
}
.modal {
transition: opacity 0.3s, transform 0.3s;
}
.modal-enter {
opacity: 0;
transform: scale(0.9);
}
.modal-enter-active {
opacity: 1;
transform: scale(1);
}
</style>
</head>
<body class="bg-gray-100 font-sans">
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div class="sidebar bg-indigo-800 text-white w-64 flex flex-col">
<div class="p-4 flex items-center justify-between border-b border-indigo-700">
<h1 class="text-xl font-bold">EduCRM</h1>
<button id="toggleSidebar" class="text-white focus:outline-none">
<i class="fas fa-bars"></i>
</button>
</div>
<nav class="flex-1 overflow-y-auto">
<div class="p-4">
<div class="mb-6">
<div class="text-indigo-300 uppercase text-xs font-semibold mb-2">Main</div>
<a href="#" class="flex items-center py-2 px-3 rounded bg-indigo-700 text-white mb-1">
<i class="fas fa-tachometer-alt mr-3"></i>
<span class="nav-text">Dashboard</span>
</a>
</div>
<div class="mb-6">
<div class="text-indigo-300 uppercase text-xs font-semibold mb-2">Management</div>
<a href="#" class="flex items-center py-2 px-3 rounded hover:bg-indigo-700 text-white mb-1">
<i class="fas fa-users mr-3"></i>
<span class="nav-text">Students</span>
</a>
<a href="#" class="flex items-center py-2 px-3 rounded hover:bg-indigo-700 text-white mb-1">
<i class="fas fa-calendar-check mr-3"></i>
<span class="nav-text">Attendance</span>
</a>
<a href="#" class="flex items-center py-2 px-3 rounded hover:bg-indigo-700 text-white mb-1">
<i class="fas fa-money-bill-wave mr-3"></i>
<span class="nav-text">Payments</span>
</a>
</div>
<div class="mb-6">
<div class="text-indigo-300 uppercase text-xs font-semibold mb-2">Settings</div>
<a href="#" class="flex items-center py-2 px-3 rounded hover:bg-indigo-700 text-white mb-1">
<i class="fas fa-cog mr-3"></i>
<span class="nav-text">Settings</span>
</a>
<a href="#" class="flex items-center py-2 px-3 rounded hover:bg-indigo-700 text-white mb-1">
<i class="fas fa-user-shield mr-3"></i>
<span class="nav-text">Admin</span>
</a>
</div>
</div>
</nav>
<div class="p-4 border-t border-indigo-700">
<div class="flex items-center">
<img src="https://randomuser.me/api/portraits/men/32.jpg" alt="User" class="w-8 h-8 rounded-full mr-2">
<div>
<div class="text-sm font-medium">John Doe</div>
<div class="text-xs text-indigo-300">Admin</div>
</div>
</div>
</div>
</div>
<!-- Main Content -->
<div class="main-content flex-1 overflow-auto">
<!-- Top Navigation -->
<header class="bg-white shadow-sm py-4 px-6 flex items-center justify-between">
<div class="flex items-center">
<h2 class="text-xl font-semibold text-gray-800">Dashboard</h2>
</div>
<div class="flex items-center space-x-4">
<div class="relative">
<button class="text-gray-600 hover:text-gray-900 focus:outline-none">
<i class="fas fa-bell"></i>
<span class="absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500"></span>
</button>
</div>
<div class="relative">
<button id="userMenuButton" class="flex items-center focus:outline-none">
<span class="mr-2 text-sm font-medium">John Doe</span>
<i class="fas fa-chevron-down text-xs"></i>
</button>
<div id="userMenu" class="hidden absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-10">
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Profile</a>
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Settings</a>
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Logout</a>
</div>
</div>
</div>
</header>
<!-- Dashboard Content -->
<main class="p-6">
<!-- Stats Cards -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="p-3 rounded-full bg-indigo-100 text-indigo-600 mr-4">
<i class="fas fa-users text-xl"></i>
</div>
<div>
<p class="text-sm text-gray-500">Total Students</p>
<h3 class="text-2xl font-bold">245</h3>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="p-3 rounded-full bg-green-100 text-green-600 mr-4">
<i class="fas fa-calendar-check text-xl"></i>
</div>
<div>
<p class="text-sm text-gray-500">Today's Attendance</p>
<h3 class="text-2xl font-bold">85%</h3>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="p-3 rounded-full bg-blue-100 text-blue-600 mr-4">
<i class="fas fa-money-bill-wave text-xl"></i>
</div>
<div>
<p class="text-sm text-gray-500">Monthly Revenue</p>
<h3 class="text-2xl font-bold">$12,450</h3>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="p-3 rounded-full bg-yellow-100 text-yellow-600 mr-4">
<i class="fas fa-exclamation-circle text-xl"></i>
</div>
<div>
<p class="text-sm text-gray-500">Pending Payments</p>
<h3 class="text-2xl font-bold">12</h3>
</div>
</div>
</div>
</div>
<!-- Charts -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
<div class="bg-white rounded-lg shadow p-6">
<h3 class="text-lg font-semibold mb-4">Attendance Overview</h3>
<div class="chart-container">
<canvas id="attendanceChart"></canvas>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<h3 class="text-lg font-semibold mb-4">Revenue Overview</h3>
<div class="chart-container">
<canvas id="revenueChart"></canvas>
</div>
</div>
</div>
<!-- Recent Students -->
<div class="bg-white rounded-lg shadow overflow-hidden mb-6">
<div class="px-6 py-4 border-b border-gray-200">
<h3 class="text-lg font-semibold">Recent Students</h3>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Course</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Join Date</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
<img class="h-10 w-10 rounded-full" src="https://randomuser.me/api/portraits/women/12.jpg" alt="">
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">Sarah Johnson</div>
<div class="text-sm text-gray-500">sarah@example.com</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">Advanced Mathematics</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-500">15 Jan 2023</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Active</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-indigo-600 hover:text-indigo-900 mr-3"><i class="fas fa-edit"></i></button>
<button class="text-red-600 hover:text-red-900"><i class="fas fa-trash"></i></button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
<img class="h-10 w-10 rounded-full" src="https://randomuser.me/api/portraits/men/42.jpg" alt="">
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">Michael Brown</div>
<div class="text-sm text-gray-500">michael@example.com</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">Physics Fundamentals</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-500">10 Feb 2023</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800">Pending</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-indigo-600 hover:text-indigo-900 mr-3"><i class="fas fa-edit"></i></button>
<button class="text-red-600 hover:text-red-900"><i class="fas fa-trash"></i></button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
<img class="h-10 w-10 rounded-full" src="https://randomuser.me/api/portraits/women/33.jpg" alt="">
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">Emily Davis</div>
<div class="text-sm text-gray-500">emily@example.com</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">Chemistry Advanced</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-500">5 Mar 2023</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Active</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-indigo-600 hover:text-indigo-900 mr-3"><i class="fas fa-edit"></i></button>
<button class="text-red-600 hover:text-red-900"><i class="fas fa-trash"></i></button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="px-6 py-4 border-t border-gray-200">
<button class="text-indigo-600 hover:text-indigo-900 font-medium">View All Students</button>
</div>
</div>
<!-- Recent Payments -->
<div class="bg-white rounded-lg shadow overflow-hidden">
<div class="px-6 py-4 border-b border-gray-200">
<h3 class="text-lg font-semibold">Recent Payments</h3>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Student</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Amount</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Invoice</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
<img class="h-10 w-10 rounded-full" src="https://randomuser.me/api/portraits/men/32.jpg" alt="">
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">Robert Wilson</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">$450.00</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-500">12 Apr 2023</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Paid</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-indigo-600 hover:text-indigo-900"><i class="fas fa-file-invoice"></i> View</button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
<img class="h-10 w-10 rounded-full" src="https://randomuser.me/api/portraits/women/44.jpg" alt="">
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">Jennifer Lee</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">$380.00</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-500">8 Apr 2023</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Paid</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-indigo-600 hover:text-indigo-900"><i class="fas fa-file-invoice"></i> View</button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
<img class="h-10 w-10 rounded-full" src="https://randomuser.me/api/portraits/men/19.jpg" alt="">
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">David Miller</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">$520.00</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-500">3 Apr 2023</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">Overdue</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-indigo-600 hover:text-indigo-900"><i class="fas fa-file-invoice"></i> View</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="px-6 py-4 border-t border-gray-200">
<button class="text-indigo-600 hover:text-indigo-900 font-medium">View All Payments</button>
</div>
</div>
</main>
</div>
</div>
<!-- Add Student Modal -->
<div id="addStudentModal" class="modal fixed inset-0 bg-gray-600 bg-opacity-50 flex items-center justify-center hidden">
<div class="bg-white rounded-lg shadow-xl w-full max-w-md">
<div class="px-6 py-4 border-b border-gray-200">
<h3 class="text-lg font-semibold">Add New Student</h3>
</div>
<div class="p-6">
<form>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="name">Full Name</label>
<input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="name" type="text" placeholder="John Doe">
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="email">Email</label>
<input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="email" type="email" placeholder="john@example.com">
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="phone">Phone</label>
<input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="phone" type="tel" placeholder="+1 (555) 123-4567">
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="course">Course</label>
<select class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="course">
<option>Select a course</option>
<option>Mathematics</option>
<option>Physics</option>
<option>Chemistry</option>
<option>Biology</option>
</select>
</div>
</form>
</div>
<div class="px-6 py-4 border-t border-gray-200 flex justify-end">
<button class="bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-2 px-4 rounded mr-2">Cancel</button>
<button class="bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-2 px-4 rounded">Save</button>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
// Toggle sidebar
document.getElementById('toggleSidebar').addEventListener('click', function() {
document.querySelector('.sidebar').classList.toggle('collapsed');
document.querySelector('.main-content').classList.toggle('ml-16');
});
// Toggle user menu
document.getElementById('userMenuButton').addEventListener('click', function() {
document.getElementById('userMenu').classList.toggle('hidden');
});
// Close user menu when clicking outside
document.addEventListener('click', function(event) {
if (!event.target.closest('#userMenuButton') && !event.target.closest('#userMenu')) {
document.getElementById('userMenu').classList.add('hidden');
}
});
// Charts
const attendanceCtx = document.getElementById('attendanceChart').getContext('2d');
const attendanceChart = new Chart(attendanceCtx, {
type: 'line',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
datasets: [{
label: 'Attendance Rate',
data: [85, 78, 90, 88, 92, 95],
backgroundColor: 'rgba(79, 70, 229, 0.1)',
borderColor: 'rgba(79, 70, 229, 1)',
borderWidth: 2,
tension: 0.3,
fill: true
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
beginAtZero: false,
min: 70,
max: 100
}
}
}
});
const revenueCtx = document.getElementById('revenueChart').getContext('2d');
const revenueChart = new Chart(revenueCtx, {
type: 'bar',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
datasets: [{
label: 'Revenue',
data: [8500, 9200, 10200, 11500, 12450, 13200],
backgroundColor: 'rgba(99, 102, 241, 0.7)',
borderColor: 'rgba(99, 102, 241, 1)',
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
beginAtZero: true
}
}
}
});
// Modal handling
function openModal(modalId) {
document.getElementById(modalId).classList.remove('hidden');
}
function closeModal(modalId) {
document.getElementById(modalId).classList.add('hidden');
}
// Example: Open add student modal when clicking "Add Student" button
document.querySelectorAll('[data-modal-target="addStudentModal"]').forEach(button => {
button.addEventListener('click', () => openModal('addStudentModal'));
});
// Close modal when clicking cancel or outside
document.querySelectorAll('.modal').forEach(modal => {
modal.addEventListener('click', function(e) {
if (e.target === modal) {
closeModal(modal.id);
}
});
});
</script>
<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=Abdurahmon07/https-huggingface-co-abdurahmon07" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>