feat: Implement admin dashboard, login, user management, authentication, and API utilities with port configuration.

This commit is contained in:
pradeepkumar
2025-12-20 19:22:20 +05:30
parent 2e99d8617b
commit aa97e36cfd
10 changed files with 1192 additions and 64 deletions

View File

@@ -0,0 +1,94 @@
'use client';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
const menuItems = [
{
name: 'Dashboard',
href: '/dashboard',
icon: (
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"
/>
</svg>
),
},
{
name: 'Users',
href: '/dashboard/users',
icon: (
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"
/>
</svg>
),
},
];
export default function Sidebar() {
const pathname = usePathname();
return (
<aside className="w-64 bg-gray-900 min-h-screen fixed left-0 top-0">
{/* Logo */}
<div className="p-6 border-b border-gray-800">
<div className="flex items-center">
<div className="w-10 h-10 bg-blue-600 rounded-lg flex items-center justify-center mr-3">
<svg
className="w-6 h-6 text-white"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"
/>
</svg>
</div>
<div>
<h1 className="text-lg font-bold text-white">Re-Quest</h1>
<p className="text-xs text-gray-400">Admin Panel</p>
</div>
</div>
</div>
{/* Navigation */}
<nav className="p-4">
<ul className="space-y-2">
{menuItems.map((item) => {
const isActive = pathname === item.href ||
(item.href !== '/dashboard' && pathname.startsWith(item.href));
return (
<li key={item.name}>
<Link
href={item.href}
className={`flex items-center px-4 py-3 rounded-lg transition-colors ${
isActive
? 'bg-blue-600 text-white'
: 'text-gray-300 hover:bg-gray-800 hover:text-white'
}`}
>
{item.icon}
<span className="ml-3 font-medium">{item.name}</span>
</Link>
</li>
);
})}
</ul>
</nav>
</aside>
);
}