36 Commits

Author SHA1 Message Date
aefd57463f Merge version_4 into main
Merge version_4 into main
2026-06-10 16:35:27 +00:00
5f9f880b8a Update src/app/dashboard/page.tsx 2026-06-10 16:35:24 +00:00
b7c870c8f0 Merge version_4 into main
Merge version_4 into main
2026-06-10 16:34:50 +00:00
dbbf377f91 Update src/app/orders/page.tsx 2026-06-10 16:34:47 +00:00
b33fe499d6 Update src/app/dashboard/page.tsx 2026-06-10 16:34:46 +00:00
fd253c28cc Update src/app/admin/dashboard/overview/page.tsx 2026-06-10 16:34:46 +00:00
99e19c8acf Merge version_4 into main
Merge version_4 into main
2026-06-10 16:33:57 +00:00
e978564303 Add src/app/profile/page.tsx 2026-06-10 16:33:53 +00:00
39c65cd683 Update src/app/orders/page.tsx 2026-06-10 16:33:53 +00:00
d75f91c959 Add src/app/new-order/page.tsx 2026-06-10 16:33:52 +00:00
d4bc645c66 Add src/app/my-orders/page.tsx 2026-06-10 16:33:52 +00:00
eea9b7f5d8 Add src/app/dashboard/page.tsx 2026-06-10 16:33:51 +00:00
b03652126c Update src/app/admin/login/page.tsx 2026-06-10 16:33:50 +00:00
09a4a6affc Add src/app/admin/dashboard/overview/page.tsx 2026-06-10 16:33:50 +00:00
7d747ad29a Add src/app/admin/dashboard/layout.tsx 2026-06-10 16:33:49 +00:00
b176c95021 Add src/app/add-funds/page.tsx 2026-06-10 16:33:49 +00:00
f7f51e2cf2 Merge version_3 into main
Merge version_3 into main
2026-06-10 15:40:49 +00:00
e0f284b23f Add src/middleware.ts 2026-06-10 15:40:46 +00:00
5004ccbdf4 Add src/app/users/page.tsx 2026-06-10 15:40:45 +00:00
74c374219f Update src/app/page.tsx 2026-06-10 15:40:45 +00:00
415d8f97fd Add src/app/orders/page.tsx 2026-06-10 15:40:44 +00:00
3b3c0d5037 Add src/app/api/admin/logout/route.ts 2026-06-10 15:40:44 +00:00
83d4cfc0e0 Add src/app/api/admin/login/route.ts 2026-06-10 15:40:43 +00:00
85487b2fb1 Add src/app/api/admin/check-auth/route.ts 2026-06-10 15:40:43 +00:00
3e7fd3f25b Add src/app/admin/users/page.tsx 2026-06-10 15:40:42 +00:00
729a34e66e Add src/app/admin/transactions/page.tsx 2026-06-10 15:40:42 +00:00
59a10d04f2 Add src/app/admin/settings/page.tsx 2026-06-10 15:40:41 +00:00
70807a4acf Add src/app/admin/services/page.tsx 2026-06-10 15:40:41 +00:00
cf7b085154 Add src/app/admin/page.tsx 2026-06-10 15:40:40 +00:00
294e837c81 Add src/app/admin/orders/page.tsx 2026-06-10 15:40:40 +00:00
d38fb170e8 Add src/app/admin/login/page.tsx 2026-06-10 15:40:39 +00:00
ac8f05d064 Add src/app/admin/layout.tsx 2026-06-10 15:40:39 +00:00
09df4a1bf1 Add src/app/admin/dashboard/page.tsx 2026-06-10 15:40:38 +00:00
520937d194 Add src/app/admin/categories/page.tsx 2026-06-10 15:40:38 +00:00
c7c3272caa Merge version_2 into main
Merge version_2 into main
2026-06-10 15:34:23 +00:00
d185af8207 Merge version_2 into main
Merge version_2 into main
2026-06-10 15:34:00 +00:00
24 changed files with 1787 additions and 1 deletions

137
src/app/add-funds/page.tsx Normal file
View File

@@ -0,0 +1,137 @@
"use client";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import ReactLenis from "lenis/react";
import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
import FooterBase from '@/components/sections/footer/FooterBase';
export default function AddFundsPage() {
return (
<ThemeProvider
defaultButtonVariant="icon-arrow"
defaultTextAnimation="background-highlight"
borderRadius="soft"
contentWidth="medium"
sizing="large"
background="grid"
cardStyle="solid"
primaryButtonStyle="gradient"
secondaryButtonStyle="glass"
headingFontWeight="normal"
>
<ReactLenis root>
<div id="nav" data-section="nav">
<NavbarStyleFullscreen
navItems={[
{ name: "Home", id: "/" },
{ name: "Services", id: "/services" },
{ name: "Pricing", id: "/pricing" },
{ name: "My Orders", id: "/my-orders" },
{ name: "Add Funds", id: "/add-funds" },
{ name: "Profile", id: "/profile" },
{ name: "FAQ", id: "/faq" },
{ name: "Contact", id: "/contact" }
]}
logoSrc="http://img.b2bpic.net/free-photo/isolated-white-house-silhouette-minimal-black-landscape_1194-641505.jpg"
logoAlt="SocBoost Logo"
brandName="SocBoost"
button={{
text: "Register", href: "/register"
}}
/>
</div>
<div className="min-h-screen py-16 px-4 sm:px-6 lg:px-8 bg-background flex items-center justify-center">
<div className="max-w-md w-full bg-card p-8 rounded-lg shadow-md border border-border">
<h1 className="text-3xl font-bold text-foreground text-center mb-4">Add Funds</h1>
<p className="text-md text-muted-foreground text-center mb-8">Top up your account balance securely.</p>
<form className="space-y-6">
<div>
<label htmlFor="amount" className="block text-sm font-medium text-foreground">Amount</label>
<div className="mt-1">
<input
type="number"
id="amount"
name="amount"
placeholder="Minimum $10.00"
className="block w-full px-3 py-2 border border-border rounded-md shadow-sm bg-background text-foreground placeholder-muted-foreground focus:outline-none focus:ring-primary-cta focus:border-primary-cta sm:text-sm"
required
min="10"
/>
</div>
</div>
<div>
<label htmlFor="paymentMethod" className="block text-sm font-medium text-foreground">Payment Method</label>
<div className="mt-1">
<select
id="paymentMethod"
name="paymentMethod"
className="block w-full px-3 py-2 border border-border rounded-md shadow-sm bg-background text-foreground focus:outline-none focus:ring-primary-cta focus:border-primary-cta sm:text-sm"
required
>
<option value="">Select a method</option>
<option value="creditCard">Credit Card</option>
<option value="paypal">PayPal</option>
<option value="crypto">Crypto</option>
</select>
</div>
</div>
<div>
<button
type="submit"
className="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-primary-cta hover:bg-primary-cta-hover focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-cta"
>
Add Funds
</button>
</div>
</form>
</div>
</div>
<div id="footer" data-section="footer">
<FooterBase
columns={[
{
title: "Services", items: [
{ label: "Instagram", href: "/services#instagram" },
{ label: "YouTube", href: "/services#youtube" },
{ label: "TikTok", href: "/services#tiktok" },
{ label: "Twitter", href: "/services#twitter" },
{ label: "Facebook", href: "/services#facebook" },
{ label: "Telegram", href: "/services#telegram" },
],
},
{
title: "Company", items: [
{ label: "About Us", href: "/#features" },
{ label: "Pricing", href: "/pricing" },
{ label: "FAQ", href: "/faq" },
{ label: "Contact", href: "/contact" },
],
},
{
title: "Legal", items: [
{ label: "Terms of Service", href: "/terms" },
{ label: "Privacy Policy", href: "/privacy" },
],
},
{
title: "Resources", items: [
{ label: "Blog", href: "#" },
{ label: "API Docs", href: "#" },
],
},
]}
logoSrc="http://img.b2bpic.net/free-photo/isolated-white-house-silhouette-minimal-black-landscape_1194-641505.jpg"
logoAlt="SocBoost Logo"
logoText="SocBoost"
copyrightText="© 2024 SocBoost. All rights reserved."
/>
</div>
</ReactLenis>
</ThemeProvider>
);
}

View File

@@ -0,0 +1,10 @@
"use client";
export default function AdminCategoriesPage() {
return (
<div className="p-4">
<h2 className="text-4xl font-bold text-white mb-8">Categories Management</h2>
<p className="text-neutral-300">Content for managing categories will go here.</p>
</div>
);
}

View File

@@ -0,0 +1,101 @@
"use client";
import { useState, useEffect } from "react";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
import { Home, ShoppingCart, Users, Settings, Package } from "lucide-react";
// Mock authentication check
const isAuthenticated = () => {
// In a real app, this would check tokens, sessions, etc.
// For this exercise, we'll simulate a logged-in state.
return typeof window !== "undefined" && localStorage.getItem("admin_logged_in") === "true";
};
const logout = () => {
if (typeof window !== "undefined") {
localStorage.removeItem("admin_logged_in");
}
};
const adminNavItems = [
{ name: "Overview", href: "/admin/dashboard/overview", icon: Home },
{ name: "Services", href: "/admin/dashboard/services", icon: Package },
{ name: "Orders", href: "/admin/dashboard/orders", icon: ShoppingCart },
{ name: "Users", href: "/admin/dashboard/users", icon: Users },
{ name: "Settings", href: "/admin/dashboard/settings", icon: Settings },
];
export default function AdminDashboardLayout({
children,
}: {
children: React.ReactNode;
}) {
const router = useRouter();
const pathname = usePathname();
const [isAuth, setIsAuth] = useState(false);
useEffect(() => {
if (!isAuthenticated()) {
router.push("/admin/login");
} else {
setIsAuth(true);
}
}, [router]);
const handleLogout = () => {
logout();
router.push("/admin/login");
};
if (!isAuth) {
return (
<div className="flex min-h-screen items-center justify-center bg-gray-100 dark:bg-gray-900">
<p className="text-gray-700 dark:text-gray-300">Redirecting to login...</p>
</div>
);
}
return (
<div className="flex min-h-screen bg-gray-100 dark:bg-gray-900">
{/* Sidebar */}
<aside className="w-64 bg-white p-4 shadow-md dark:bg-gray-800">
<div className="mb-8 text-2xl font-bold text-gray-900 dark:text-white">
Admin Panel
</div>
<nav>
<ul>
{adminNavItems.map((item) => {
const Icon = item.icon;
const isActive = pathname.startsWith(item.href);
return (
<li key={item.name} className="mb-2">
<Link
href={item.href}
className={`flex items-center rounded-md px-4 py-2 text-gray-700 hover:bg-gray-200 dark:text-gray-300 dark:hover:bg-gray-700 ${
isActive ? "bg-indigo-100 text-indigo-700 dark:bg-indigo-900 dark:text-indigo-300" : ""
}`}
>
<Icon className="mr-3 h-5 w-5" />
{item.name}
</Link>
</li>
);
})}
</ul>
</nav>
<div className="mt-auto pt-8">
<button
onClick={handleLogout}
className="flex w-full items-center rounded-md px-4 py-2 text-red-600 hover:bg-red-100 dark:text-red-400 dark:hover:bg-red-900"
>
Logout
</button>
</div>
</aside>
{/* Main Content */}
<main className="flex-1 p-8">{children}</main>
</div>
);
}

View File

@@ -0,0 +1,141 @@
"use client";
import { DollarSign, ShoppingCart, Users, TrendingUp } from "lucide-react";
import MetricCardThree from "@/components/sections/metrics/MetricCardThree"; // Re-using existing component
export default function AdminOverviewPage() {
const revenueMetrics = [
{
id: "total_revenue", icon: DollarSign,
title: "Total Revenue", value: "$1,234,567"},
{
id: "monthly_revenue", icon: TrendingUp,
title: "Monthly Revenue", value: "$89,123"},
{
id: "total_orders", icon: ShoppingCart,
title: "Total Orders", value: "15,678"},
{
id: "new_users", icon: Users,
title: "New Users (Last 30 Days)", value: "450"}
];
const recentOrders = [
{
id: "ORD001", customer: "John Doe", service: "Instagram Likes", amount: "$15.00", status: "Completed", date: "2023-10-26"},
{
id: "ORD002", customer: "Jane Smith", service: "YouTube Subscribers", amount: "$50.00", status: "Pending", date: "2023-10-25"},
{
id: "ORD003", customer: "Alice Johnson", service: "TikTok Views", amount: "$10.50", status: "Completed", date: "2023-10-25"},
{
id: "ORD004", customer: "Bob Brown", service: "Twitter Retweets", amount: "$5.00", status: "Processing", date: "2023-10-24"},
{
id: "ORD005", customer: "Charlie Green", service: "Facebook Page Likes", amount: "$20.00", status: "Completed", date: "2023-10-24"}
];
return (
<div className="space-y-8">
<h1 className="text-4xl font-bold text-gray-900 dark:text-white">Dashboard Overview</h1>
<div className="rounded-lg bg-white p-6 shadow-md dark:bg-gray-800">
<h2 className="mb-4 text-2xl font-semibold text-gray-900 dark:text-white">Revenue Statistics</h2>
<MetricCardThree
animationType="none" // No animation needed for a static admin view
textboxLayout="default"
useInvertedBackground={false} // Adjust as needed for admin theme
title="Revenue Statistics" // Added required prop
description="Overview of key financial metrics for the platform." // Added required prop
metrics={revenueMetrics}
className="!p-0" // Override padding from default section styling
containerClassName="!p-0" // Override padding from default section styling
gridClassName="grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4" // Ensure grid layout
cardClassName="p-4 bg-gray-50 dark:bg-gray-700 border border-gray-200 dark:border-gray-700"
valueClassName="text-3xl font-bold text-indigo-600 dark:text-indigo-400"
metricTitleClassName="text-lg text-gray-600 dark:text-gray-400"
iconContainerClassName="text-indigo-500 dark:text-indigo-300"
/>
</div>
<div className="rounded-lg bg-white p-6 shadow-md dark:bg-gray-800">
<h2 className="mb-4 text-2xl font-semibold text-gray-900 dark:text-white">Recent Orders</h2>
<div className="overflow-x-auto">
<table className="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
<thead className="bg-gray-50 dark:bg-gray-700">
<tr>
<th
scope="col"
className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300"
>
Order ID
</th>
<th
scope="col"
className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300"
>
Customer
</th>
<th
scope="col"
className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300"
>
Service
</th>
<th
scope="col"
className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300"
>
Amount
</th>
<th
scope="col"
className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300"
>
Status
</th>
<th
scope="col"
className="px-6 py-3 text-left text-xs font-medium uppercase tracking-wider text-gray-500 dark:text-gray-300"
>
Date
</th>
</tr>
</thead>
<tbody className="divide-y divide-gray-200 bg-white dark:divide-gray-700 dark:bg-gray-800">
{recentOrders.map((order) => (
<tr key={order.id}>
<td className="whitespace-nowrap px-6 py-4 text-sm font-medium text-gray-900 dark:text-white">
{order.id}
</td>
<td className="whitespace-nowrap px-6 py-4 text-sm text-gray-500 dark:text-gray-300">
{order.customer}
</td>
<td className="whitespace-nowrap px-6 py-4 text-sm text-gray-500 dark:text-gray-300">
{order.service}
</td>
<td className="whitespace-nowrap px-6 py-4 text-sm text-gray-500 dark:text-gray-300">
{order.amount}
</td>
<td className="whitespace-nowrap px-6 py-4 text-sm text-gray-500 dark:text-gray-300">
<span
className={`inline-flex rounded-full px-2 text-xs font-semibold leading-5 ${
order.status === "Completed"
? "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-300"
: order.status === "Pending"
? "bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-300"
: "bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300"
}`}
>
{order.status}
</span>
</td>
<td className="whitespace-nowrap px-6 py-4 text-sm text-gray-500 dark:text-gray-300">
{order.date}
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
</div>
);
}

View File

@@ -0,0 +1,111 @@
"use client";
import { useEffect, useState } from 'react';
import { useRouter } from 'next/navigation';
import { ThemeProvider } from '@/providers/themeProvider/ThemeProvider';
import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
export default function AdminDashboardPage() {
const router = useRouter();
const [isAdmin, setIsAdmin] = useState(false);
const [loading, setLoading] = useState(true);
useEffect(() => {
const token = localStorage.getItem('adminToken');
const cookieToken = document.cookie.split('; ').find(row => row.startsWith('adminToken='))?.split('=')[1];
if (token === 'mock-admin-token' && cookieToken === 'mock-admin-token') {
setIsAdmin(true);
} else {
router.push('/admin/login?message=Unauthorized');
}
setLoading(false);
}, [router]);
const handleLogout = () => {
localStorage.removeItem('adminToken');
document.cookie = 'adminToken=; path=/; max-age=0;';
router.push('/admin/login');
};
const navItems = [
{ name: "Home", id: "/" },
{ name: "Services", id: "/services" },
{ name: "Pricing", id: "/pricing" },
{ name: "FAQ", id: "/faq" },
{ name: "Contact", id: "/contact" },
{ name: "Admin Login", id: "/admin/login" }
];
if (loading) {
return (
<ThemeProvider
defaultButtonVariant="icon-arrow"
defaultTextAnimation="background-highlight"
borderRadius="soft"
contentWidth="medium"
sizing="large"
background="grid"
cardStyle="solid"
primaryButtonStyle="gradient"
secondaryButtonStyle="glass"
headingFontWeight="normal"
>
<div id="nav" data-section="nav">
<NavbarStyleFullscreen
navItems={navItems}
logoSrc="http://img.b2bpic.net/free-photo/isolated-white-house-silhouette-minimal-black-landscape_1194-641505.jpg"
logoAlt="SocBoost Logo"
brandName="SocBoost"
button={{ text: "Register", href: "/register" }}
/>
</div>
<div className="flex min-h-[calc(100vh-80px)] items-center justify-center p-4 sm:p-6 lg:p-8">
<p className="text-foreground">Loading...</p>
</div>
</ThemeProvider>
);
}
if (!isAdmin) {
return null;
}
return (
<ThemeProvider
defaultButtonVariant="icon-arrow"
defaultTextAnimation="background-highlight"
borderRadius="soft"
contentWidth="medium"
sizing="large"
background="grid"
cardStyle="solid"
primaryButtonStyle="gradient"
secondaryButtonStyle="glass"
headingFontWeight="normal"
>
<div id="nav" data-section="nav">
<NavbarStyleFullscreen
navItems={navItems}
logoSrc="http://img.b2bpic.net/free-photo/isolated-white-house-silhouette-minimal-black-landscape_1194-641505.jpg"
logoAlt="SocBoost Logo"
brandName="SocBoost"
button={{ text: "Register", href: "/register" }}
/>
</div>
<div className="flex min-h-[calc(100vh-80px)] items-center justify-center p-4 sm:p-6 lg:p-8">
<div className="w-full max-w-2xl p-8 space-y-6 bg-card rounded-lg shadow-lg text-center">
<h2 className="text-3xl font-bold text-foreground">Welcome to Admin Dashboard!</h2>
<p className="text-lg text-foreground-lighter">This is a protected route, accessible only to authenticated administrators.</p>
<button
onClick={handleLogout}
className="mt-6 py-2 px-6 border border-transparent rounded-md shadow-sm text-base font-medium text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500"
>
Logout
</button>
</div>
</div>
</ThemeProvider>
);
}

69
src/app/admin/layout.tsx Normal file
View File

@@ -0,0 +1,69 @@
"use client";
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import { Home, Package, LayoutGrid, ShoppingCart, Users, ReceiptText, Settings, Menu } from 'lucide-react';
import React, { useState } from 'react';
const adminNavItems = [
{ href: '/admin', label: 'Overview', icon: Home },
{ href: '/admin/services', label: 'Services', icon: Package },
{ href: '/admin/categories', label: 'Categories', icon: LayoutGrid },
{ href: '/admin/orders', label: 'Orders', icon: ShoppingCart },
{ href: '/admin/users', label: 'Users', icon: Users },
{ href: '/admin/transactions', label: 'Transactions', icon: ReceiptText },
{ href: '/admin/settings', label: 'Settings', icon: Settings },
];
export default function AdminLayout({ children }: { children: React.ReactNode }) {
const pathname = usePathname();
const [isSidebarOpen, setIsSidebarOpen] = useState(false);
return (
<div className="flex min-h-screen bg-neutral-950 text-white">
{/* Mobile Menu Button */}
<button
className="fixed top-4 left-4 z-50 p-2 rounded-md bg-neutral-800 lg:hidden focus:outline-none focus:ring-2 focus:ring-primary-cta"
onClick={() => setIsSidebarOpen(!isSidebarOpen)}
aria-label="Toggle sidebar"
>
<Menu className="h-6 w-6" />
</button>
{/* Sidebar */}
<aside
className={`fixed inset-y-0 left-0 z-40 w-64 bg-neutral-900 shadow-lg transform ${isSidebarOpen ? 'translate-x-0' : '-translate-x-full'} lg:translate-x-0 transition-transform duration-300 ease-in-out`}
>
<div className="p-6 border-b border-neutral-800">
<h1 className="text-2xl font-bold text-primary-cta">Admin Panel</h1>
</div>
<nav className="mt-6">
<ul>
{adminNavItems.map((item) => {
const isActive = pathname === item.href || (item.href !== '/admin' && pathname.startsWith(item.href));
return (
<li key={item.href}>
<Link
href={item.href}
className={`flex items-center gap-3 px-6 py-3 text-lg font-medium transition-colors duration-200 ${isActive ? 'bg-primary-cta text-white' : 'text-neutral-300 hover:bg-neutral-800 hover:text-white'}`}
onClick={() => setIsSidebarOpen(false)} // Close sidebar on nav item click
>
<item.icon className="h-5 w-5" />
{item.label}
</Link>
</li>
);
})}
</ul>
</nav>
</aside>
{/* Main Content */}
<main className={`flex-1 transition-all duration-300 ease-in-out ${isSidebarOpen ? 'lg:ml-64 ml-0' : 'lg:ml-64 ml-0'} p-8 pt-16 lg:pt-8`}>
<div className="max-w-7xl mx-auto">
{children}
</div>
</main>
</div>
);
}

View File

@@ -0,0 +1,92 @@
"use client";
import { useState } from "react";
import Link from "next/link";
export default function AdminLoginPage() {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [error, setError] = useState("");
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
setError("");
// In a real application, you would send these credentials to an API route
// for authentication. For this exercise, we'll simulate a basic check.
if (email === "admin@example.com" && password === "password") {
if (typeof window !== "undefined") {
localStorage.setItem("admin_logged_in", "true");
}
alert("Login successful! Redirecting to dashboard...");
// Simulate redirect to admin dashboard
window.location.href = "/admin/dashboard/overview";
} else {
setError("Invalid email or password.");
}
};
return (
<div className="flex min-h-screen items-center justify-center bg-gray-100 dark:bg-gray-900">
<div className="w-full max-w-md rounded-lg bg-white p-8 shadow-md dark:bg-gray-800">
<h2 className="mb-6 text-center text-3xl font-bold text-gray-900 dark:text-white">
Admin Login
</h2>
<form onSubmit={handleSubmit} className="space-y-6">
<div>
<label
htmlFor="email"
className="block text-sm font-medium text-gray-700 dark:text-gray-300"
>
Email address
</label>
<input
id="email"
name="email"
type="email"
autoComplete="email"
required
className="mt-1 block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-500"
value={email}
onChange={(e) => setEmail(e.target.value)}
/>
</div>
<div>
<label
htmlFor="password"
className="block text-sm font-medium text-gray-700 dark:text-gray-300"
>
Password
</label>
<input
id="password"
name="password"
type="password"
autoComplete="current-password"
required
className="mt-1 block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-500"
value={password}
onChange={(e) => setPassword(e.target.value)}
/>
</div>
{error && <p className="text-sm text-red-500">{error}</p>}
<div>
<button
type="submit"
className="relative flex w-full justify-center rounded-md border border-transparent bg-indigo-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
>
Sign in
</button>
</div>
</form>
<div className="mt-6 text-center text-sm">
<Link
href="/"
className="font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400 dark:hover:text-indigo-300"
>
Back to homepage
</Link>
</div>
</div>
</div>
);
}

View File

@@ -0,0 +1,10 @@
"use client";
export default function AdminOrdersPage() {
return (
<div className="p-4">
<h2 className="text-4xl font-bold text-white mb-8">Orders Management</h2>
<p className="text-neutral-300">Content for managing orders will go here.</p>
</div>
);
}

100
src/app/admin/page.tsx Normal file
View File

@@ -0,0 +1,100 @@
"use client";
import { BarChart, CreditCard, DollarSign, Package } from 'lucide-react';
import Link from 'next/link';
const revenueData = [
{ date: 'Jan 1', revenue: 1000 }, { date: 'Jan 5', revenue: 1200 }, { date: 'Jan 10', revenue: 1500 },
{ date: 'Jan 15', revenue: 1300 }, { date: 'Jan 20', revenue: 1700 }, { date: 'Jan 25', revenue: 1600 },
{ date: 'Jan 30', revenue: 2000 },
];
const recentOrders = [
{ id: '1001', customer: 'John Doe', amount: '$150.00', status: 'Completed', date: '2024-03-01' },
{ id: '1002', customer: 'Jane Smith', amount: '$230.50', status: 'Pending', date: '2024-03-01' },
{ id: '1003', customer: 'Alice Brown', amount: '$75.25', status: 'Completed', date: '2024-02-29' },
{ id: '1004', customer: 'Bob White', amount: '$400.00', status: 'Processing', date: '2024-02-28' },
{ id: '1005', customer: 'Charlie Green', amount: '$110.00', status: 'Completed', date: '2024-02-28' },
];
export default function AdminOverviewPage() {
return (
<div className="space-y-8">
<h2 className="text-4xl font-bold text-white mb-8">Overview</h2>
{/* Revenue Stats Display */}
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<div className="bg-neutral-900 p-6 rounded-lg shadow-md flex items-center justify-between">
<div>
<p className="text-neutral-400 text-sm">Total Revenue</p>
<p className="text-3xl font-semibold text-white">$12,450</p>
</div>
<DollarSign className="h-8 w-8 text-primary-cta" />
</div>
<div className="bg-neutral-900 p-6 rounded-lg shadow-md flex items-center justify-between">
<div>
<p className="text-neutral-400 text-sm">Total Orders</p>
<p className="text-3xl font-semibold text-white">850</p>
</div>
<Package className="h-8 w-8 text-primary-cta" />
</div>
<div className="bg-neutral-900 p-6 rounded-lg shadow-md flex items-center justify-between">
<div>
<p className="text-neutral-400 text-sm">Pending Orders</p>
<p className="text-3xl font-semibold text-white">32</p>
</div>
<CreditCard className="h-8 w-8 text-primary-cta" />
</div>
<div className="bg-neutral-900 p-6 rounded-lg shadow-md flex items-center justify-between">
<div>
<p className="text-neutral-400 text-sm">New Users</p>
<p className="text-3xl font-semibold text-white">120</p>
</div>
<BarChart className="h-8 w-8 text-primary-cta" />
</div>
</div>
{/* Orders Chart (Last 30 Days) */}
<div className="bg-neutral-900 p-6 rounded-lg shadow-md">
<h3 className="text-2xl font-semibold text-white mb-4">Orders Chart (Last 30 Days)</h3>
<div className="h-64 flex items-center justify-center bg-neutral-800 rounded-md text-neutral-500">
<p>Placeholder for a chart library (e.g., Recharts, Chart.js)</p>
</div>
</div>
{/* Recent Orders Table */}
<div className="bg-neutral-900 p-6 rounded-lg shadow-md">
<h3 className="text-2xl font-semibold text-white mb-4">Recent Orders</h3>
<div className="overflow-x-auto">
<table className="min-w-full divide-y divide-neutral-800">
<thead>
<tr>
<th className="px-6 py-3 text-left text-xs font-medium text-neutral-400 uppercase tracking-wider">Order ID</th>
<th className="px-6 py-3 text-left text-xs font-medium text-neutral-400 uppercase tracking-wider">Customer</th>
<th className="px-6 py-3 text-left text-xs font-medium text-neutral-400 uppercase tracking-wider">Amount</th>
<th className="px-6 py-3 text-left text-xs font-medium text-neutral-400 uppercase tracking-wider">Status</th>
<th className="px-6 py-3 text-left text-xs font-medium text-neutral-400 uppercase tracking-wider">Date</th>
</tr>
</thead>
<tbody className="divide-y divide-neutral-800">
{recentOrders.map((order) => (
<tr key={order.id}>
<td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-white">{order.id}</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-neutral-300">{order.customer}</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-neutral-300">{order.amount}</td>
<td className={`px-6 py-4 whitespace-nowrap text-sm ${order.status === 'Completed' ? 'text-green-500' : order.status === 'Pending' ? 'text-yellow-500' : 'text-blue-500'}`}>{order.status}</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-neutral-300">{order.date}</td>
</tr>
))}
</tbody>
</table>
</div>
<div className="mt-4 text-right">
<Link href="/admin/orders" className="text-primary-cta hover:underline">
View All Orders
</Link>
</div>
</div>
</div>
);
}

View File

@@ -0,0 +1,10 @@
"use client";
export default function AdminServicesPage() {
return (
<div className="p-4">
<h2 className="text-4xl font-bold text-white mb-8">Services Management</h2>
<p className="text-neutral-300">Content for managing services will go here.</p>
</div>
);
}

View File

@@ -0,0 +1,10 @@
"use client";
export default function AdminSettingsPage() {
return (
<div className="p-4">
<h2 className="text-4xl font-bold text-white mb-8">Settings</h2>
<p className="text-neutral-300">Content for managing settings will go here.</p>
</div>
);
}

View File

@@ -0,0 +1,10 @@
"use client";
export default function AdminTransactionsPage() {
return (
<div className="p-4">
<h2 className="text-4xl font-bold text-white mb-8">Transactions Management</h2>
<p className="text-neutral-300">Content for managing transactions will go here.</p>
</div>
);
}

View File

@@ -0,0 +1,10 @@
"use client";
export default function AdminUsersPage() {
return (
<div className="p-4">
<h2 className="text-4xl font-bold text-white mb-8">Users Management</h2>
<p className="text-neutral-300">Content for managing users will go here.</p>
</div>
);
}

View File

@@ -0,0 +1,14 @@
import { NextRequest, NextResponse } from 'next/server';
export async function GET(req: NextRequest) {
// In a real app, this would verify the JWT token from headers or session cookie.
// For this mock, we assume the middleware handled the primary check,
// or a client component sends a token to be verified.
const token = req.cookies.get('adminToken')?.value || req.headers.get('Authorization')?.split(' ')[1];
if (token === 'mock-admin-token') {
return NextResponse.json({ isAuthenticated: true, role: 'admin' }, { status: 200 });
} else {
return NextResponse.json({ isAuthenticated: false }, { status: 401 });
}
}

View File

@@ -0,0 +1,13 @@
import { NextRequest, NextResponse } from 'next/server';
export async function POST(req: NextRequest) {
const { email, password } = await req.json();
if (email === 'admin@demo.com' && password === 'Admin@123') {
// In a real app, generate a JWT token or create a session.
// For this mock, we'll just indicate success.
return NextResponse.json({ message: 'Login successful', token: 'mock-admin-token' }, { status: 200 });
} else {
return NextResponse.json({ message: 'Invalid credentials' }, { status: 401 });
}
}

View File

@@ -0,0 +1,7 @@
import { NextRequest, NextResponse } from 'next/server';
export async function POST(req: NextRequest) {
// In a real app, invalidate JWT on server or clear session.
// For this mock, no server-side action is strictly needed as client manages localStorage token and cookie.
return NextResponse.json({ message: 'Logout successful' }, { status: 200 });
}

135
src/app/dashboard/page.tsx Normal file
View File

@@ -0,0 +1,135 @@
"use client";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import ReactLenis from "lenis/react";
import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
import FooterBase from '@/components/sections/footer/FooterBase';
import { Wallet, ShoppingCart, Hourglass, CheckCircle, Settings, LogOut } from "lucide-react";
import Link from "next/link";
export default function UserDashboardPage() {
const stats = [
{ id: "balance", title: "Current Balance", value: "$1,250.50", icon: Wallet },
{ id: "totalOrders", title: "Total Orders", value: "1,234", icon: ShoppingCart },
{ id: "pendingOrders", title: "Pending Orders", value: "42", icon: Hourglass },
{ id: "completedOrders", title: "Completed Orders", value: "1,192", icon: CheckCircle }
];
const navItems = [
{ name: "Home", id: "/" },
{ name: "Dashboard", id: "/dashboard" },
{ name: "New Order", id: "/new-order" },
{ name: "My Orders", id: "/orders" }
];
const footerColumns = [
{
title: "Company", items: [
{ label: "About Us", href: "/#features" },
{ label: "Dashboard", href: "/dashboard" },
{ label: "New Order", href: "/new-order" },
{ label: "My Orders", href: "/orders" }
]
}
];
return (
<ThemeProvider
defaultButtonVariant="icon-arrow"
defaultTextAnimation="background-highlight"
borderRadius="soft"
contentWidth="medium"
sizing="large"
background="grid"
cardStyle="solid"
primaryButtonStyle="gradient"
secondaryButtonStyle="glass"
headingFontWeight="normal"
>
<ReactLenis root>
<div id="nav" data-section="nav">
<NavbarStyleFullscreen
navItems={navItems}
logoSrc="http://img.b2bpic.net/free-photo/isolated-white-house-silhouette-minimal-black-landscape_1194-641505.jpg"
logoAlt="SocBoost Logo"
brandName="SocBoost"
button={{
text: "Register", href: "/register"
}}
/>
</div>
<div className="flex flex-col lg:flex-row min-h-screen pt-20">
{/* Sidebar */}
<aside className="w-full lg:w-64 bg-card p-6 border-r border-border shadow-md">
<h2 className="text-2xl font-semibold mb-6 text-foreground">User Panel</h2>
<nav>
<ul>
<li className="mb-4">
<Link href="/dashboard" className="flex items-center text-foreground hover:text-primary-cta transition-colors">
<Wallet className="mr-2 h-5 w-5" /> Dashboard
</Link>
</li>
<li className="mb-4">
<Link href="/new-order" className="flex items-center text-foreground hover:text-primary-cta transition-colors">
<ShoppingCart className="mr-2 h-5 w-5" /> New Order
</Link>
</li>
<li className="mb-4">
<Link href="/orders" className="flex items-center text-foreground hover:text-primary-cta transition-colors">
<Hourglass className="mr-2 h-5 w-5" /> My Orders
</Link>
</li>
<li className="mb-4">
<Link href="/settings" className="flex items-center text-foreground hover:text-primary-cta transition-colors">
<Settings className="mr-2 h-5 w-5" /> Settings
</Link>
</li>
<li className="mb-4">
<button className="flex items-center text-foreground hover:text-red-500 transition-colors w-full text-left">
<LogOut className="mr-2 h-5 w-5" /> Logout
</button>
</li>
</ul>
</nav>
</aside>
{/* Main Content */}
<main className="flex-1 p-8 bg-background">
<h1 className="text-4xl font-bold mb-8 text-foreground">Dashboard Overview</h1>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
{stats.map((stat) => (
<div key={stat.id} className="bg-card p-6 rounded-lg shadow-lg flex items-center space-x-4">
<div className="p-3 rounded-full bg-primary-cta bg-opacity-20">
<stat.icon className="h-6 w-6 text-primary-cta" />
</div>
<div>
<p className="text-sm font-medium text-foreground-light">{stat.title}</p>
<p className="text-2xl font-bold text-foreground">{stat.value}</p>
</div>
</div>
))}
</div>
{/* Additional Dashboard Content would go here */}
<div className="bg-card p-6 rounded-lg shadow-lg">
<h2 className="text-2xl font-semibold mb-4 text-foreground">Recent Activity</h2>
<p className="text-foreground-light">Your recent orders and transactions will appear here.</p>
</div>
</main>
</div>
<div id="footer" data-section="footer">
<FooterBase
columns={footerColumns}
logoSrc="http://img.b2bpic.net/free-photo/isolated-white-house-silhouette-minimal-black-landscape_1194-641505.jpg"
logoAlt="SocBoost Logo"
logoText="SocBoost"
copyrightText="© 2024 SocBoost. All rights reserved."
/>
</div>
</ReactLenis>
</ThemeProvider>
);
}

146
src/app/my-orders/page.tsx Normal file
View File

@@ -0,0 +1,146 @@
"use client";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import ReactLenis from "lenis/react";
import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
import FooterBase from '@/components/sections/footer/FooterBase';
export default function MyOrdersPage() {
const orders = [
{ id: "#1001", service: "Instagram Likes", quantity: "1000", status: "Completed", date: "2024-07-20" },
{ id: "#1002", service: "YouTube Views", quantity: "5000", status: "Processing", date: "2024-07-21" },
{ id: "#1003", service: "TikTok Followers", quantity: "100", status: "Pending", date: "2024-07-21" },
{ id: "#1004", service: "Twitter Retweets", quantity: "500", status: "Completed", date: "2024-07-19" },
{ id: "#1005", service: "Facebook Comments", quantity: "10", status: "Cancelled", date: "2024-07-18" }
];
return (
<ThemeProvider
defaultButtonVariant="icon-arrow"
defaultTextAnimation="background-highlight"
borderRadius="soft"
contentWidth="medium"
sizing="large"
background="grid"
cardStyle="solid"
primaryButtonStyle="gradient"
secondaryButtonStyle="glass"
headingFontWeight="normal"
>
<ReactLenis root>
<div id="nav" data-section="nav">
<NavbarStyleFullscreen
navItems={[
{ name: "Home", id: "/" },
{ name: "Services", id: "/services" },
{ name: "Pricing", id: "/pricing" },
{ name: "My Orders", id: "/my-orders" },
{ name: "Add Funds", id: "/add-funds" },
{ name: "Profile", id: "/profile" },
{ name: "FAQ", id: "/faq" },
{ name: "Contact", id: "/contact" }
]}
logoSrc="http://img.b2bpic.net/free-photo/isolated-white-house-silhouette-minimal-black-landscape_1194-641505.jpg"
logoAlt="SocBoost Logo"
brandName="SocBoost"
button={{
text: "Register", href: "/register"
}}
/>
</div>
<div className="min-h-screen py-16 px-4 sm:px-6 lg:px-8 bg-background">
<div className="max-w-7xl mx-auto">
<h1 className="text-4xl font-bold text-foreground text-center mb-6">My Orders</h1>
<p className="text-lg text-muted-foreground text-center mb-10">View and manage your recent orders.</p>
<div className="mb-8 flex justify-end">
<select className="p-2 rounded-md bg-card border border-border text-foreground">
<option value="all">All Statuses</option>
<option value="pending">Pending</option>
<option value="processing">Processing</option>
<option value="completed">Completed</option>
<option value="cancelled">Cancelled</option>
</select>
</div>
<div className="overflow-x-auto rounded-lg shadow-md border border-border">
<table className="min-w-full divide-y divide-border">
<thead className="bg-card">
<tr>
<th scope="col" className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider">ID</th>
<th scope="col" className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider">Service</th>
<th scope="col" className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider">Quantity</th>
<th scope="col" className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider">Status</th>
<th scope="col" className="px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider">Date</th>
</tr>
</thead>
<tbody className="bg-background divide-y divide-border">
{orders.map((order) => (
<tr key={order.id}>
<td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-foreground">{order.id}</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-foreground">{order.service}</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-foreground">{order.quantity}</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-foreground">
<span className={`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${
order.status === 'Completed' ? 'bg-green-100 text-green-800' :
order.status === 'Processing' ? 'bg-blue-100 text-blue-800' :
order.status === 'Pending' ? 'bg-yellow-100 text-yellow-800' :
'bg-red-100 text-red-800'
}`}>
{order.status}
</span>
</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-foreground">{order.date}</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
</div>
<div id="footer" data-section="footer">
<FooterBase
columns={[
{
title: "Services", items: [
{ label: "Instagram", href: "/services#instagram" },
{ label: "YouTube", href: "/services#youtube" },
{ label: "TikTok", href: "/services#tiktok" },
{ label: "Twitter", href: "/services#twitter" },
{ label: "Facebook", href: "/services#facebook" },
{ label: "Telegram", href: "/services#telegram" },
],
},
{
title: "Company", items: [
{ label: "About Us", href: "/#features" },
{ label: "Pricing", href: "/pricing" },
{ label: "FAQ", href: "/faq" },
{ label: "Contact", href: "/contact" },
],
},
{
title: "Legal", items: [
{ label: "Terms of Service", href: "/terms" },
{ label: "Privacy Policy", href: "/privacy" },
],
},
{
title: "Resources", items: [
{ label: "Blog", href: "#" },
{ label: "API Docs", href: "#" },
],
},
]}
logoSrc="http://img.b2bpic.net/free-photo/isolated-white-house-silhouette-minimal-black-landscape_1194-641505.jpg"
logoAlt="SocBoost Logo"
logoText="SocBoost"
copyrightText="© 2024 SocBoost. All rights reserved."
/>
</div>
</ReactLenis>
</ThemeProvider>
);
}

152
src/app/new-order/page.tsx Normal file
View File

@@ -0,0 +1,152 @@
"use client";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import ReactLenis from "lenis/react";
import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
import FooterBase from '@/components/sections/footer/FooterBase';
import { ShoppingCart } from "lucide-react";
import { useState, useEffect } from "react";
export default function NewOrderPage() {
const [service, setService] = useState("instagram-likes");
const [link, setLink] = useState("");
const [quantity, setQuantity] = useState(0);
const [price, setPrice] = useState(0);
const serviceRates = {
"instagram-likes": 0.001,
"youtube-views": 0.0005,
"tiktok-followers": 0.004,
};
useEffect(() => {
const rate = serviceRates[service as keyof typeof serviceRates] || 0;
const calculatedPrice = quantity * rate;
setPrice(calculatedPrice);
}, [service, quantity]);
const handleOrderSubmit = (e: React.FormEvent) => {
e.preventDefault();
alert(`Order placed! Service: ${service}, Link: ${link}, Quantity: ${quantity}, Price: $${price.toFixed(2)}`);
// Here you would typically send data to your backend
};
const navItems = [
{ name: "Home", id: "/" },
{ name: "Dashboard", id: "/dashboard" },
{ name: "New Order", id: "/new-order" },
{ name: "My Orders", id: "/orders" }
];
const footerColumns = [
{
title: "Company", items: [
{ label: "About Us", href: "/#features" },
{ label: "Dashboard", href: "/dashboard" },
{ label: "New Order", href: "/new-order" },
{ label: "My Orders", href: "/orders" }
],
},
];
return (
<ThemeProvider
defaultButtonVariant="icon-arrow"
defaultTextAnimation="background-highlight"
borderRadius="soft"
contentWidth="medium"
sizing="large"
background="grid"
cardStyle="solid"
primaryButtonStyle="gradient"
secondaryButtonStyle="glass"
headingFontWeight="normal"
>
<ReactLenis root>
<div id="nav" data-section="nav">
<NavbarStyleFullscreen
navItems={navItems}
logoSrc="http://img.b2bpic.net/free-photo/isolated-white-house-silhouette-minimal-black-landscape_1194-641505.jpg"
logoAlt="SocBoost Logo"
brandName="SocBoost"
button={{
text: "Register", href: "/register"
}}
/>
</div>
<main className="container mx-auto px-4 py-8 pt-20 min-h-[calc(100vh-200px)]">
<h1 className="text-4xl font-bold mb-8 text-foreground">Create New Order</h1>
<div className="bg-card p-8 rounded-lg shadow-lg max-w-2xl mx-auto">
<form onSubmit={handleOrderSubmit} className="space-y-6">
<div>
<label htmlFor="service" className="block text-sm font-medium text-foreground mb-2">Service</label>
<select
id="service"
className="w-full p-3 border border-border rounded-md bg-background-accent text-foreground focus:ring-primary-cta focus:border-primary-cta"
value={service}
onChange={(e) => setService(e.target.value)}
>
<option value="instagram-likes">Instagram Likes</option>
<option value="youtube-views">YouTube Views</option>
<option value="tiktok-followers">TikTok Followers</option>
</select>
</div>
<div>
<label htmlFor="link" className="block text-sm font-medium text-foreground mb-2">Link</label>
<input
type="url"
id="link"
className="w-full p-3 border border-border rounded-md bg-background-accent text-foreground placeholder-foreground-light focus:ring-primary-cta focus:border-primary-cta"
placeholder="Enter link (e.g., Instagram post URL)"
value={link}
onChange={(e) => setLink(e.target.value)}
required
/>
</div>
<div>
<label htmlFor="quantity" className="block text-sm font-medium text-foreground mb-2">Quantity</label>
<input
type="number"
id="quantity"
className="w-full p-3 border border-border rounded-md bg-background-accent text-foreground placeholder-foreground-light focus:ring-primary-cta focus:border-primary-cta"
placeholder="Enter quantity (e.g., 1000)"
min="1"
value={quantity === 0 ? "" : quantity}
onChange={(e) => setQuantity(parseInt(e.target.value) || 0)}
required
/>
</div>
<div className="flex justify-between items-center py-4 border-t border-border-light">
<p className="text-lg font-medium text-foreground">Total Price:</p>
<p className="text-2xl font-bold text-primary-cta">${price.toFixed(2)}</p>
</div>
<button
type="submit"
className="w-full flex items-center justify-center space-x-2 px-5 py-3 bg-primary-cta text-white font-semibold rounded-md hover:opacity-90 transition-opacity"
>
<ShoppingCart className="h-5 w-5" />
<span>Place Order</span>
</button>
</form>
</div>
</main>
<div id="footer" data-section="footer">
<FooterBase
columns={footerColumns}
logoSrc="http://img.b2bpic.net/free-photo/isolated-white-house-silhouette-minimal-black-landscape_1194-641505.jpg"
logoAlt="SocBoost Logo"
logoText="SocBoost"
copyrightText="© 2024 SocBoost. All rights reserved."
/>
</div>
</ReactLenis>
</ThemeProvider>
);
}

140
src/app/orders/page.tsx Normal file
View File

@@ -0,0 +1,140 @@
"use client";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import ReactLenis from "lenis/react";
import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
import FooterBase from '@/components/sections/footer/FooterBase';
import { CheckCircle, XCircle } from "lucide-react";
export default function OrdersManagementPage() {
// Dummy data for orders
const orders = [
{ id: "#1001", user: "John Doe", service: "Instagram Likes", quantity: 1000, status: "Completed", date: "2024-01-15", amount: "$1.00" },
{ id: "#1002", user: "Jane Smith", service: "YouTube Views", quantity: 5000, status: "Pending", date: "2024-01-16", amount: "$5.00" },
{ id: "#1003", user: "Alice Johnson", service: "TikTok Followers", quantity: 200, status: "Processing", date: "2024-01-17", amount: "$0.80" },
{ id: "#1004", user: "Bob Williams", service: "Twitter Retweets", quantity: 100, status: "Cancelled", date: "2024-01-18", amount: "$0.20" },
{ id: "#1005", user: "Charlie Brown", service: "Facebook Shares", quantity: 50, status: "Completed", date: "2024-01-19", amount: "$0.15" }
];
const statuses = ["All", "Completed", "Pending", "Processing", "Cancelled"];
const navItems = [
{ name: "Home", id: "/" },
{ name: "Dashboard", id: "/dashboard" },
{ name: "New Order", id: "/new-order" },
{ name: "My Orders", id: "/orders" }
];
const footerColumns = [
{
title: "Company", items: [
{ label: "About Us", href: "/#features" },
{ label: "Dashboard", href: "/dashboard" },
{ label: "New Order", href: "/new-order" },
{ label: "My Orders", href: "/orders" }
]
}
];
return (
<ThemeProvider
defaultButtonVariant="icon-arrow"
defaultTextAnimation="background-highlight"
borderRadius="soft"
contentWidth="medium"
sizing="large"
background="grid"
cardStyle="solid"
primaryButtonStyle="gradient"
secondaryButtonStyle="glass"
headingFontWeight="normal"
>
<ReactLenis root>
<div id="nav" data-section="nav">
<NavbarStyleFullscreen
navItems={navItems}
logoSrc="http://img.b2bpic.net/free-photo/isolated-white-house-silhouette-minimal-black-landscape_1194-641505.jpg"
logoAlt="SocBoost Logo"
brandName="SocBoost"
button={{
text: "Register", href: "/register"
}}
/>
</div>
<main className="container mx-auto px-4 py-8 pt-20 min-h-[calc(100vh-200px)]">
<h1 className="text-4xl font-bold mb-8 text-foreground">My Orders</h1>
<div className="mb-6 flex justify-between items-center">
<div className="flex items-center space-x-2">
<label htmlFor="status-filter" className="font-medium text-foreground">Filter by Status:</label>
<select id="status-filter" className="p-2 border rounded-md bg-background-accent text-foreground dark:border-border">
{statuses.map(status => (
<option key={status} value={status.toLowerCase()}>{status}</option>
))}
</select>
</div>
<button className="px-4 py-2 bg-primary-cta text-white rounded-md hover:opacity-90 transition-opacity">Refresh Orders</button>
</div>
<div className="overflow-x-auto bg-card rounded-lg shadow-lg p-6">
<table className="min-w-full divide-y divide-border">
<thead className="bg-background-accent">
<tr>
<th className="px-6 py-3 text-left text-xs font-medium text-foreground uppercase tracking-wider">Order ID</th>
<th className="px-6 py-3 text-left text-xs font-medium text-foreground uppercase tracking-wider">User</th>
<th className="px-6 py-3 text-left text-xs font-medium text-foreground uppercase tracking-wider">Service</th>
<th className="px-6 py-3 text-left text-xs font-medium text-foreground uppercase tracking-wider">Quantity</th>
<th className="px-6 py-3 text-left text-xs font-medium text-foreground uppercase tracking-wider">Amount</th>
<th className="px-6 py-3 text-left text-xs font-medium text-foreground uppercase tracking-wider">Date</th>
<th className="px-6 py-3 text-left text-xs font-medium text-foreground uppercase tracking-wider">Status</th>
<th className="px-6 py-3 text-left text-xs font-medium text-foreground uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody className="divide-y divide-border">
{orders.map(order => (
<tr key={order.id} className="hover:bg-background-accent transition-colors">
<td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-foreground">{order.id}</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-foreground">{order.user}</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-foreground">{order.service}</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-foreground">{order.quantity}</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-foreground">{order.amount}</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-foreground">{order.date}</td>
<td className="px-6 py-4 whitespace-nowrap text-sm">
<span className={`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${
order.status === 'Completed' ? 'bg-green-100 text-green-800' :
order.status === 'Pending' ? 'bg-yellow-100 text-yellow-800' :
order.status === 'Processing' ? 'bg-blue-100 text-blue-800' :
'bg-red-100 text-red-800'
}`}>
{order.status}
</span>
</td>
<td className="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<select className="p-1 border rounded-md bg-background-accent text-foreground dark:border-border mr-2">
{statuses.filter(s => s !== 'All').map(status => (
<option key={status} value={status.toLowerCase()} selected={order.status === status}>{status}</option>
))}
</select>
<button className="px-3 py-1 bg-accent text-white rounded-md text-xs hover:opacity-90 transition-opacity">Update</button>
</td>
</tr>
))}
</tbody>
</table>
</div>
</main>
<div id="footer" data-section="footer">
<FooterBase
columns={footerColumns}
logoSrc="http://img.b2bpic.net/free-photo/isolated-white-house-silhouette-minimal-black-landscape_1194-641505.jpg"
logoAlt="SocBoost Logo"
logoText="SocBoost"
copyrightText="© 2024 SocBoost. All rights reserved."
/>
</div>
</ReactLenis>
</ThemeProvider>
);
}

View File

@@ -34,7 +34,9 @@ export default function LandingPage() {
{ name: "Services", id: "/services" },
{ name: "Pricing", id: "/pricing" },
{ name: "FAQ", id: "/faq" },
{ name: "Contact", id: "/contact" }
{ name: "Contact", id: "/contact" },
{ name: "Transactions", id: "/transactions" },
{ name: "Settings", id: "/settings" }
]}
logoSrc="http://img.b2bpic.net/free-photo/isolated-white-house-silhouette-minimal-black-landscape_1194-641505.jpg"
logoAlt="SocBoost Logo"

202
src/app/profile/page.tsx Normal file
View File

@@ -0,0 +1,202 @@
"use client";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import ReactLenis from "lenis/react";
import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
import FooterBase from '@/components/sections/footer/FooterBase';
export default function ProfilePage() {
// Placeholder for API Key. In a real app, this would be fetched or generated.
const apiKey = "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
return (
<ThemeProvider
defaultButtonVariant="icon-arrow"
defaultTextAnimation="background-highlight"
borderRadius="soft"
contentWidth="medium"
sizing="large"
background="grid"
cardStyle="solid"
primaryButtonStyle="gradient"
secondaryButtonStyle="glass"
headingFontWeight="normal"
>
<ReactLenis root>
<div id="nav" data-section="nav">
<NavbarStyleFullscreen
navItems={[
{ name: "Home", id: "/" },
{ name: "Services", id: "/services" },
{ name: "Pricing", id: "/pricing" },
{ name: "My Orders", id: "/my-orders" },
{ name: "Add Funds", id: "/add-funds" },
{ name: "Profile", id: "/profile" },
{ name: "FAQ", id: "/faq" },
{ name: "Contact", id: "/contact" }
]}
logoSrc="http://img.b2bpic.net/free-photo/isolated-white-house-silhouette-minimal-black-landscape_1194-641505.jpg"
logoAlt="SocBoost Logo"
brandName="SocBoost"
button={{
text: "Register", href: "/register"
}}
/>
</div>
<div className="min-h-screen py-16 px-4 sm:px-6 lg:px-8 bg-background">
<div className="max-w-xl mx-auto space-y-10">
<h1 className="text-4xl font-bold text-foreground text-center mb-6">My Profile</h1>
<p className="text-lg text-muted-foreground text-center mb-10">Manage your account details, password, and API keys.</p>
{/* Account Details Form */}
<div className="bg-card p-8 rounded-lg shadow-md border border-border">
<h2 className="text-2xl font-semibold text-foreground mb-6">Account Details</h2>
<form className="space-y-6">
<div>
<label htmlFor="name" className="block text-sm font-medium text-foreground">Name</label>
<input
type="text"
id="name"
name="name"
defaultValue="John Doe" // Placeholder
className="mt-1 block w-full px-3 py-2 border border-border rounded-md shadow-sm bg-background text-foreground focus:outline-none focus:ring-primary-cta focus:border-primary-cta sm:text-sm"
/>
</div>
<div>
<label htmlFor="email" className="block text-sm font-medium text-foreground">Email Address</label>
<input
type="email"
id="email"
name="email"
defaultValue="john.doe@example.com" // Placeholder
className="mt-1 block w-full px-3 py-2 border border-border rounded-md shadow-sm bg-background text-foreground focus:outline-none focus:ring-primary-cta focus:border-primary-cta sm:text-sm"
/>
</div>
<div>
<button
type="submit"
className="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-primary-cta hover:bg-primary-cta-hover focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-cta"
>
Update Profile
</button>
</div>
</form>
</div>
{/* Change Password Form */}
<div className="bg-card p-8 rounded-lg shadow-md border border-border">
<h2 className="text-2xl font-semibold text-foreground mb-6">Change Password</h2>
<form className="space-y-6">
<div>
<label htmlFor="current-password" className="block text-sm font-medium text-foreground">Current Password</label>
<input
type="password"
id="current-password"
name="current-password"
className="mt-1 block w-full px-3 py-2 border border-border rounded-md shadow-sm bg-background text-foreground focus:outline-none focus:ring-primary-cta focus:border-primary-cta sm:text-sm"
/>
</div>
<div>
<label htmlFor="new-password" className="block text-sm font-medium text-foreground">New Password</label>
<input
type="password"
id="new-password"
name="new-password"
className="mt-1 block w-full px-3 py-2 border border-border rounded-md shadow-sm bg-background text-foreground focus:outline-none focus:ring-primary-cta focus:border-primary-cta sm:text-sm"
/>
</div>
<div>
<label htmlFor="confirm-password" className="block text-sm font-medium text-foreground">Confirm New Password</label>
<input
type="password"
id="confirm-password"
name="confirm-password"
className="mt-1 block w-full px-3 py-2 border border-border rounded-md shadow-sm bg-background text-foreground focus:outline-none focus:ring-primary-cta focus:border-primary-cta sm:text-sm"
/>
</div>
<div>
<button
type="submit"
className="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-primary-cta hover:bg-primary-cta-hover focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-cta"
>
Change Password
</button>
</div>
</form>
</div>
{/* API Key Management */}
<div className="bg-card p-8 rounded-lg shadow-md border border-border">
<h2 className="text-2xl font-semibold text-foreground mb-6">API Key</h2>
<p className="text-sm text-muted-foreground mb-4">Your API key allows programmatic access to your account.</p>
<div className="flex items-center space-x-2">
<input
type="text"
readOnly
value={apiKey}
className="flex-grow px-3 py-2 border border-border rounded-md shadow-sm bg-background text-foreground text-sm font-mono"
/>
<button
type="button"
className="inline-flex items-center px-4 py-2 border border-border rounded-md shadow-sm text-sm font-medium text-foreground bg-background hover:bg-muted-background focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-cta"
>
Copy
</button>
<button
type="button"
className="inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500"
>
Revoke
</button>
</div>
<p className="text-xs text-muted-foreground mt-2">Keep your API key secure. Do not share it with anyone.</p>
</div>
</div>
</div>
<div id="footer" data-section="footer">
<FooterBase
columns={[
{
title: "Services", items: [
{ label: "Instagram", href: "/services#instagram" },
{ label: "YouTube", href: "/services#youtube" },
{ label: "TikTok", href: "/services#tiktok" },
{ label: "Twitter", href: "/services#twitter" },
{ label: "Facebook", href: "/services#facebook" },
{ label: "Telegram", href: "/services#telegram" },
],
},
{
title: "Company", items: [
{ label: "About Us", href: "/#features" },
{ label: "Pricing", href: "/pricing" },
{ label: "FAQ", href: "/faq" },
{ label: "Contact", href: "/contact" },
],
},
{
title: "Legal", items: [
{ label: "Terms of Service", href: "/terms" },
{ label: "Privacy Policy", href: "/privacy" },
],
},
{
title: "Resources", items: [
{ label: "Blog", href: "#" },
{ label: "API Docs", href: "#" },
],
},
]}
logoSrc="http://img.b2bpic.net/free-photo/isolated-white-house-silhouette-minimal-black-landscape_1194-641505.jpg"
logoAlt="SocBoost Logo"
logoText="SocBoost"
copyrightText="© 2024 SocBoost. All rights reserved."
/>
</div>
</ReactLenis>
</ThemeProvider>
);
}

138
src/app/users/page.tsx Normal file
View File

@@ -0,0 +1,138 @@
"use client";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import ReactLenis from "lenis/react";
import NavbarStyleFullscreen from '@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen';
import FooterBase from '@/components/sections/footer/FooterBase';
import { Plus, Minus } from "lucide-react";
export default function UsersManagementPage() {
// Dummy data for users
const users = [
{ id: "u1", username: "johndoe", email: "john@example.com", balance: 150.75, status: "Active" },
{ id: "u2", username: "janesmith", email: "jane@example.com", balance: 23.50, status: "Active" },
{ id: "u3", username: "alicej", email: "alice@example.com", balance: 0.00, status: "Inactive" },
{ id: "u4", username: "bobw", email: "bob@example.com", balance: 500.00, status: "Active" },
{ id: "u5", username: "charlieb", email: "charlie@example.com", balance: 12.30, status: "Active" },
];
return (
<ThemeProvider
defaultButtonVariant="icon-arrow"
defaultTextAnimation="background-highlight"
borderRadius="soft"
contentWidth="medium"
sizing="large"
background="grid"
cardStyle="solid"
primaryButtonStyle="gradient"
secondaryButtonStyle="glass"
headingFontWeight="normal"
>
<ReactLenis root>
<div id="nav" data-section="nav">
<NavbarStyleFullscreen
navItems={[
{ name: "Home", id: "/" },
{ name: "Services", id: "/services" },
{ name: "Pricing", id: "/pricing" },
{ name: "FAQ", id: "/faq" },
{ name: "Contact", id: "/contact" },
{ name: "Orders", id: "/orders" },
{ name: "Users", id: "/users" }
]}
logoSrc="http://img.b2bpic.net/free-photo/isolated-white-house-silhouette-minimal-black-landscape_1194-641505.jpg"
logoAlt="SocBoost Logo"
brandName="SocBoost"
button={{
text: "Register", href: "/register"
}}
/>
</div>
<main className="container mx-auto px-4 py-8">
<h1 className="text-4xl font-bold mb-8">Users Management</h1>
<div className="overflow-x-auto bg-card rounded-lg shadow-lg p-6">
<table className="min-w-full divide-y divide-border">
<thead className="bg-background-accent">
<tr>
<th className="px-6 py-3 text-left text-xs font-medium text-foreground uppercase tracking-wider">Username</th>
<th className="px-6 py-3 text-left text-xs font-medium text-foreground uppercase tracking-wider">Email</th>
<th className="px-6 py-3 text-left text-xs font-medium text-foreground uppercase tracking-wider">Balance</th>
<th className="px-6 py-3 text-left text-xs font-medium text-foreground uppercase tracking-wider">Status</th>
<th className="px-6 py-3 text-left text-xs font-medium text-foreground uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody className="divide-y divide-border">
{users.map(user => (
<tr key={user.id} className="hover:bg-background-accent transition-colors">
<td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-foreground">{user.username}</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-foreground">{user.email}</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-foreground">${user.balance.toFixed(2)}</td>
<td className="px-6 py-4 whitespace-nowrap text-sm">
<span className={`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${
user.status === 'Active' ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800'
}`}>
{user.status}
</span>
</td>
<td className="px-6 py-4 whitespace-nowrap text-right text-sm font-medium flex space-x-2">
<button className="px-3 py-1 bg-primary-cta text-white rounded-md text-xs flex items-center hover:opacity-90 transition-opacity">
<Plus size={14} className="mr-1" /> Add Funds
</button>
<button className="px-3 py-1 bg-secondary-cta text-white rounded-md text-xs flex items-center hover:opacity-90 transition-opacity">
<Minus size={14} className="mr-1" /> Deduct Funds
</button>
</td>
</tr>
))}
</tbody>
</table>
</div>
</main>
<div id="footer" data-section="footer">
<FooterBase
columns={[
{
title: "Services", items: [
{ label: "Instagram", href: "/services#instagram" },
{ label: "YouTube", href: "/services#youtube" },
{ label: "TikTok", href: "/services#tiktok" },
{ label: "Twitter", href: "/services#twitter" },
{ label: "Facebook", href: "/services#facebook" },
{ label: "Telegram", href: "/services#telegram" },
],
},
{
title: "Company", items: [
{ label: "About Us", href: "/#features" },
{ label: "Pricing", href: "/pricing" },
{ label: "FAQ", href: "/faq" },
{ label: "Contact", href: "/contact" },
],
},
{
title: "Legal", items: [
{ label: "Terms of Service", href: "/terms" },
{ label: "Privacy Policy", href: "/privacy" },
],
},
{
title: "Resources", items: [
{ label: "Blog", href: "#" },
{ label: "API Docs", href: "#" },
],
},
]}
logoSrc="http://img.b2bpic.net/free-photo/isolated-white-house-silhouette-minimal-black-landscape_1194-641505.jpg"
logoAlt="SocBoost Logo"
logoText="SocBoost"
copyrightText="© 2024 SocBoost. All rights reserved."
/>
</div>
</ReactLenis>
</ThemeProvider>
);
}

26
src/middleware.ts Normal file
View File

@@ -0,0 +1,26 @@
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
export function middleware(request: NextRequest) {
const { pathname } = request.nextUrl;
// Protect /admin routes
if (pathname.startsWith('/admin') && !pathname.startsWith('/admin/login')) {
const adminToken = request.cookies.get('adminToken');
if (adminToken?.value === 'mock-admin-token') {
return NextResponse.next();
}
const url = request.nextUrl.clone();
url.pathname = '/admin/login';
url.searchParams.set('redirected', 'true'); // Optional: Add a query param to indicate redirection
return NextResponse.redirect(url);
}
return NextResponse.next();
}
export const config = {
matcher: ['/admin/:path*'], // Apply middleware to all routes under /admin
};