27 Commits

Author SHA1 Message Date
d979132189 Merge version_6 into main
Merge version_6 into main
2026-06-09 15:45:59 +00:00
214230b937 Add src/hooks/useAuth.ts 2026-06-09 15:45:56 +00:00
273e74a1b8 Update src/app/superadmin/page.tsx 2026-06-09 15:45:55 +00:00
a7ae5367f5 Update src/app/reports/page.tsx 2026-06-09 15:45:55 +00:00
7b109762fc Update src/app/recipes/page.tsx 2026-06-09 15:45:54 +00:00
24d1f2d208 Update src/app/production/page.tsx 2026-06-09 15:45:54 +00:00
d2d65b50b4 Update src/app/product-variations/page.tsx 2026-06-09 15:45:53 +00:00
63a7bcb8b5 Update src/app/page.tsx 2026-06-09 15:45:53 +00:00
bb1b3b9ec2 Update src/app/movements/page.tsx 2026-06-09 15:45:52 +00:00
327d77f3ff Update src/app/logs/page.tsx 2026-06-09 15:45:52 +00:00
d246763078 Update src/app/login/page.tsx 2026-06-09 15:45:51 +00:00
8f18881cdf Update src/app/dashboard/page.tsx 2026-06-09 15:45:50 +00:00
04ee63c157 Merge version_5 into main
Merge version_5 into main
2026-06-09 14:37:50 +00:00
f674d27f0d Update src/app/page.tsx 2026-06-09 14:37:47 +00:00
a6dd38e420 Update src/app/movements/page.tsx 2026-06-09 14:37:46 +00:00
a4e9ee617b Update src/app/logs/page.tsx 2026-06-09 14:37:46 +00:00
036da8d014 Update src/app/login/page.tsx 2026-06-09 14:37:45 +00:00
e619251ca9 Update src/app/dashboard/page.tsx 2026-06-09 14:37:45 +00:00
a4a765a673 Add src/app/AuthGuard.tsx 2026-06-09 14:37:44 +00:00
05477d34bc Merge version_4 into main
Merge version_4 into main
2026-06-09 14:30:10 +00:00
808a732b6d Add src/app/reports/page.tsx 2026-06-09 14:30:07 +00:00
c03eec7b77 Update src/app/page.tsx 2026-06-09 14:30:06 +00:00
513e6a962f Add src/app/movements/page.tsx 2026-06-09 14:30:06 +00:00
01083e4afc Add src/app/logs/page.tsx 2026-06-09 14:30:05 +00:00
4b5fc6dddd Add src/app/login/page.tsx 2026-06-09 14:30:05 +00:00
a6609a58e4 Add src/app/dashboard/page.tsx 2026-06-09 14:30:04 +00:00
e19e719bcc Merge version_3 into main
Merge version_3 into main
2026-06-09 11:11:25 +00:00
12 changed files with 387 additions and 300 deletions

39
src/app/AuthGuard.tsx Normal file
View File

@@ -0,0 +1,39 @@
"use client";
import { useEffect } from 'react';
import { useRouter, usePathname } from 'next/navigation';
interface AuthGuardProps {
children: React.ReactNode;
}
export default function AuthGuard({ children }: AuthGuardProps) {
const router = useRouter();
const pathname = usePathname();
useEffect(() => {
const isAuthenticated = localStorage.getItem('isAuthenticated') === 'true';
// Allow access to login page regardless of authentication status
if (pathname === '/login') {
// If user is already authenticated and tries to go to login, redirect to dashboard
if (isAuthenticated) {
router.replace('/dashboard');
}
return;
}
// Protect all other pages except home (/) and login (/login)
if (pathname !== '/' && !isAuthenticated) {
router.replace('/login');
}
}, [pathname, router]);
// If on a protected route and not authenticated, we're redirecting, so don't render children yet.
// If on home page, or on login page, or on protected page AND authenticated, render children.
if (pathname !== '/' && pathname !== '/login' && localStorage.getItem('isAuthenticated') !== 'true') {
return null; // Don't render content until redirected
}
return <>{children}</>;
}

View File

@@ -0,0 +1,38 @@
"use client";
import { useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { useAuth } from '@/hooks/useAuth';
export default function DashboardPage() {
const { isAuthenticated, isLoading, logout } = useAuth();
const router = useRouter();
useEffect(() => {
if (!isLoading && !isAuthenticated) {
router.push('/login');
}
}, [isAuthenticated, isLoading, router]);
if (isLoading) {
return <div className="flex items-center justify-center min-h-screen text-xl">Yükleniyor...</div>;
}
if (!isAuthenticated) {
return null; // Or a loading spinner, as the redirect will happen soon
}
return (
<div className="flex flex-col items-center justify-center min-h-screen p-4 bg-background-accent text-foreground">
<h1 className="text-5xl font-extrabold mb-4">Gösterge Paneli</h1>
<p className="text-xl text-center mb-8">Hoş geldiniz! Burası size özel gösterge paneliniz.</p>
<button
onClick={logout}
className="px-6 py-3 bg-secondary-cta text-white rounded-full text-lg font-semibold shadow-lg hover:bg-opacity-90 transition-all duration-300"
>
Çıkış Yap
</button>
<p className="text-md text-gray-400 mt-4">Yalnızca yetkili kullanıcılar erişebilir.</p>
</div>
);
}

34
src/app/login/page.tsx Normal file
View File

@@ -0,0 +1,34 @@
"use client";
import { useAuth } from '@/hooks/useAuth';
import { useEffect } from 'react';
import { useRouter } from 'next/navigation';
export default function LoginPage() {
const { isAuthenticated, isLoading, login } = useAuth();
const router = useRouter();
useEffect(() => {
if (!isLoading && isAuthenticated) {
router.push('/dashboard'); // Redirect if already authenticated
}
}, [isAuthenticated, isLoading, router]);
if (isLoading) {
return <div className="flex items-center justify-center min-h-screen text-xl">Yükleniyor...</div>;
}
return (
<div className="flex flex-col items-center justify-center min-h-screen p-4">
<h1 className="text-4xl font-bold mb-6">Giriş Yap</h1>
<p className="text-lg text-center mb-8">Panel sayfalarına erişmek için lütfen giriş yapın.</p>
<button
onClick={login}
className="px-8 py-4 bg-primary-cta text-white rounded-full text-lg font-semibold shadow-lg hover:bg-opacity-90 transition-all duration-300"
>
Giriş Yap (Demo)
</button>
<p className="mt-4 text-sm text-gray-500">Bu demo için basit bir giriş simülasyonudur.</p>
</div>
);
}

32
src/app/logs/page.tsx Normal file
View File

@@ -0,0 +1,32 @@
"use client";
import { useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { useAuth } from '@/hooks/useAuth';
export default function LogsPage() {
const { isAuthenticated, isLoading } = useAuth();
const router = useRouter();
useEffect(() => {
if (!isLoading && !isAuthenticated) {
router.push('/login');
}
}, [isAuthenticated, isLoading, router]);
if (isLoading) {
return <div className="flex items-center justify-center min-h-screen text-xl">Yükleniyor...</div>;
}
if (!isAuthenticated) {
return null; // Or a loading spinner, as the redirect will happen soon
}
return (
<div className="flex flex-col items-center justify-center min-h-screen p-4 bg-background-accent text-foreground">
<h1 className="text-5xl font-extrabold mb-4">Günlükler Paneli</h1>
<p className="text-xl text-center mb-8">Burada tüm sistem günlüklerini görüntüleyebilirsiniz.</p>
<p className="text-md text-gray-400">Yalnızca yetkili kullanıcılar erişebilir.</p>
</div>
);
}

View File

@@ -0,0 +1,32 @@
"use client";
import { useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { useAuth } from '@/hooks/useAuth';
export default function MovementsPage() {
const { isAuthenticated, isLoading } = useAuth();
const router = useRouter();
useEffect(() => {
if (!isLoading && !isAuthenticated) {
router.push('/login');
}
}, [isAuthenticated, isLoading, router]);
if (isLoading) {
return <div className="flex items-center justify-center min-h-screen text-xl">Yükleniyor...</div>;
}
if (!isAuthenticated) {
return null; // Or a loading spinner, as the redirect will happen soon
}
return (
<div className="flex flex-col items-center justify-center min-h-screen p-4 bg-background-accent text-foreground">
<h1 className="text-5xl font-extrabold mb-4">Hareketler Paneli</h1>
<p className="text-xl text-center mb-8">Ürünlerin tüm hareket geçmişini buradan takip edebilirsiniz.</p>
<p className="text-md text-gray-400">Yalnızca yetkili kullanıcılar erişebilir.</p>
</div>
);
}

View File

@@ -19,10 +19,6 @@ export default function SaasTemplatePage() {
{ name: "Fiyatlandırma", id: "pricing" },
{ name: "İzlenebilirlik", id: "traceability" },
{ name: "Hakkımızda", id: "about" },
{ name: "Varyasyonlar", id: "/product-variations" },
{ name: "Üretim", id: "/production" },
{ name: "Reçeteler", id: "/recipes" },
{ name: "Yönetim Paneli", id: "/superadmin" },
{ name: "İletişim", id: "contact" }
];
@@ -35,11 +31,13 @@ export default function SaasTemplatePage() {
const features: FeatureCard[] = [
{
bentoComponent: "globe", title: "Kapsamlı Envanter Kontrolü", description: "Tüm ürünlerinizi, depo konumlarını ve stok seviyelerini tek bir yerden yönetin."},
bentoComponent: "globe", title: "Kapsamlı Envanter Kontrolü", description: "Tüm ürünlerinizi, depo konumlarını ve stok seviyelerini tek bir yerden yönetin."
},
{
bentoComponent: "marquee", variant: "text", centerIcon: Zap,
texts: ["Gerçek Zamanlı", "Doğru", "Hızlı", "Güvenli"],
title: "Hızlı ve Gerçek Zamanlı Takip", description: "Stok hareketlerini anlık olarak izleyin ve her zaman güncel bilgilere sahip olun."},
title: "Hızlı ve Gerçek Zamanlı Takip", description: "Stok hareketlerini anlık olarak izleyin ve her zaman güncel bilgilere sahip olun."
},
{
bentoComponent: "3d-stack-cards", items: [
{ icon: TrendingUp, title: "Talep Tahmini", subtitle: "Veriye Dayalı", detail: "Gelecek talebi öngörün" },
@@ -66,9 +64,11 @@ export default function SaasTemplatePage() {
description="Stokify ile envanterinizi zahmetsizce yönetin, operasyonel verimliliği artırın ve işinizi büyütün."
buttons={[
{
text: "Ücretsiz Deneyin", href: "#contact"},
text: "Ücretsiz Deneyin", href: "#contact"
},
{
text: "Detaylı Bilgi", href: "#features"},
text: "Detaylı Bilgi", href: "#features"
},
]}
marqueeItems={[
{ type: "text-icon", text: "Envanter Takibi", icon: Layers },
@@ -78,15 +78,17 @@ export default function SaasTemplatePage() {
{ type: "text-icon", text: "Otomatik Raporlama", icon: BarChart3 },
]}
/>
<FeatureBento
features={features}
animationType="none"
tag="Temel Özellikler"
title="Stok Yönetiminde İhtiyacınız Olan Her Şey"
description="Stokify, işletmenizin envanterini kolayca yönetmenizi ve operasyonel verimliliği artırmanızı sağlar."
textboxLayout="default"
useInvertedBackground={false}
/>
<div id="about" data-section="about">
<FeatureBento
features={features}
animationType="none"
tag="Temel Özellikler"
title="Stok Yönetiminde İhtiyacınız Olan Her Şey"
description="Stokify, işletmenizin envanterini kolayca yönetmenizi ve operasyonel verimliliği artırmanızı sağlar."
textboxLayout="default"
useInvertedBackground={false}
/>
</div>
<FeatureBorderGlow
tag="Neden Stokify?"
tagIcon={HelpCircle}
@@ -98,16 +100,20 @@ export default function SaasTemplatePage() {
features={[
{
icon: Package,
title: "Kapsamlı Ürün Yönetimi", description: "Ürünlerinizi barkod, kategori ve diğer detaylarla kolayca yönetin."},
title: "Kapsamlı Ürün Yönetimi", description: "Ürünlerinizi barkod, kategori ve diğer detaylarla kolayca yönetin."
},
{
icon: TrendingUp,
title: "Gelişmiş Raporlama", description: "Stok hareketleri, satış analizleri ve performans raporları ile akıllı kararlar alın."},
title: "Gelişmiş Raporlama", description: "Stok hareketleri, satış analizleri ve performans raporları ile akıllı kararlar alın."
},
{
icon: ShieldCheck,
title: "Güvenli Veri Saklama", description: "Tüm envanter verileriniz güvenli sunucularda saklanır ve yedeklenir."},
title: "Güvenli Veri Saklama", description: "Tüm envanter verileriniz güvenli sunucularda saklanır ve yedeklenir."
},
{
icon: Zap,
title: "Gerçek Zamanlı Envanter Takibi", description: "Stok seviyelerini anlık olarak izleyin ve olası sorunlara hızla müdahale edin."},
title: "Gerçek Zamanlı Envanter Takibi", description: "Stok seviyelerini anlık olarak izleyin ve olası sorunlara hızla müdahale edin."
},
]}
/>
<div id="traceability" data-section="traceability">
@@ -168,7 +174,8 @@ export default function SaasTemplatePage() {
{ text: "Hemen Başla", onClick: () => console.log("Starter clicked") },
],
features: [
"500 Ürüne Kadar", "Temel Stok Takibi", "Manuel Veri Girişi", "E-posta Desteği"],
"500 Ürüne Kadar", "Temel Stok Takibi", "Manuel Veri Girişi", "E-posta Desteği"
],
},
{
id: "pro", badge: "Profesyonel", badgeIcon: BarChart3,
@@ -176,7 +183,8 @@ export default function SaasTemplatePage() {
{ text: "Hemen Başla", onClick: () => console.log("Pro clicked") },
],
features: [
"Sınırsız Ürün", "Otomatik Envanter Güncelleme", "Barkod Entegrasyonu", "Gelişmiş Raporlama", "API Erişimi", "Öncelikli Destek"],
"Sınırsız Ürün", "Otomatik Envanter Güncelleme", "Barkod Entegrasyonu", "Gelişmiş Raporlama", "API Erişimi", "Öncelikli Destek"
],
},
{
id: "enterprise", badge: "Kurumsal", badgeIcon: Building,
@@ -184,7 +192,8 @@ export default function SaasTemplatePage() {
{ text: "Teklif Alın", onClick: () => console.log("Enterprise clicked") },
],
features: [
"Tüm Profesyonel Özellikler", "Özel Hesap Yöneticisi", "Kişiselleştirilmiş Entegrasyonlar", "Eğitim ve Yerinde Destek", "Gelişmiş Güvenlik"],
"Tüm Profesyonel Özellikler", "Özel Hesap Yöneticisi", "Kişiselleştirilmiş Entegrasyonlar", "Eğitim ve Yerinde Destek", "Gelişmiş Güvenlik"
],
},
]}
/>
@@ -206,33 +215,20 @@ export default function SaasTemplatePage() {
title: "Ürün", items: [
{ label: "Özellikler", href: "/#features" },
{ label: "Fiyatlandırma", href: "/#pricing" },
{ label: "İzlenebilirlik", href: "/#traceability" },
{ label: "Entegrasyonlar", href: "#" },
{ label: "Referanslar", href: "#" },
{ label: "İzlenebilirlik", href: "/#traceability" }
],
},
{
title: "Şirket", items: [
{ label: "Hakkımızda", href: "/#about" },
{ label: "Blog", href: "#" },
{ label: "Kariyer", href: "#" },
{ label: "İletişim", href: "/#contact" },
{ label: "İletişim", href: "/#contact" }
],
},
{
title: "Kaynaklar", items: [
{ label: "Dokümantasyon", href: "#" },
{ label: "Yardım Merkezi", href: "#" },
{ label: "Topluluk", href: "#" },
{ label: "Destek", href: "#" },
],
title: "Kaynaklar", items: []
},
{
title: "Yasal", items: [
{ label: "Gizlilik Politikası", href: "#" },
{ label: "Kullanım Koşulları", href: "#" },
{ label: "Çerez Politikası", href: "#" },
],
title: "Yasal", items: []
},
]}
copyrightText="2024 Stokify. Tüm hakları saklıdır."

View File

@@ -1,74 +1,32 @@
"use client";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import ReactLenis from "lenis/react";
import NavbarLayoutFloatingInline from "@/components/navbar/NavbarLayoutFloatingInline";
import TextBox from "@/components/Textbox";
import FooterBaseReveal from "@/components/sections/footer/FooterBaseReveal";
import { useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { useAuth } from '@/hooks/useAuth';
export default function ProductVariationsPage() {
const navItems = [
{ name: "Özellikler", id: "features" },
{ name: "Fiyatlandırma", id: "pricing" },
{ name: "Hakkımızda", id: "about" },
{ name: "İletişim", id: "contact" },
{ name: "Varyasyonlar", id: "/product-variations" }
];
const { isAuthenticated, isLoading } = useAuth();
const router = useRouter();
return (
<ThemeProvider defaultButtonVariant="hover-bubble" defaultTextAnimation="entrance-slide" borderRadius="pill" contentWidth="medium" sizing="medium" background="none" cardStyle="gradient-bordered" primaryButtonStyle="primary-glow" secondaryButtonStyle="layered" headingFontWeight="medium">
<ReactLenis root>
<NavbarLayoutFloatingInline
navItems={navItems}
brandName="Stokify"
button={{ text: "Hemen Başla", href: "#contact" }}
/>
<div className="min-h-screen flex flex-col justify-center items-center py-20 px-4 sm:px-6 lg:px-8">
<TextBox
title="Ürün Varyasyonları Yönetimi"
description="Bu sayfa, ürünlerinizin alt varyasyonlarını, varyant kombinasyonlarını ve varyantlara özel envanter takibini yönetmek için altyapıyı sunar. Renk, boyut, malzeme gibi özelliklere göre varyasyonlar oluşturabilir, stok seviyelerini belirleyebilir ve ürün setlerini yapılandırabilirsiniz."
textboxLayout="default"
center={true}
/>
</div>
<FooterBaseReveal
logoText="Stokify"
columns={[
{
title: "Ürün", items: [
{ label: "Özellikler", href: "#features" },
{ label: "Fiyatlandırma", href: "#pricing" },
{ label: "Entegrasyonlar", href: "#" },
{ label: "Referanslar", href: "#" },
],
},
{
title: "Şirket", items: [
{ label: "Hakkımızda", href: "#about" },
{ label: "Blog", href: "#" },
{ label: "Kariyer", href: "#" },
{ label: "İletişim", href: "#contact" },
],
},
{
title: "Kaynaklar", items: [
{ label: "Dokümantasyon", href: "#" },
{ label: "Yardım Merkezi", href: "#" },
{ label: "Topluluk", href: "#" },
{ label: "Destek", href: "#" },
],
},
{
title: "Yasal", items: [
{ label: "Gizlilik Politikası", href: "#" },
{ label: "Kullanım Koşulları", href: "#" },
{ label: "Çerez Politikası", href: "#" },
],
},
]}
copyrightText="2024 Stokify. Tüm hakları saklıdır."
/>
</ReactLenis>
</ThemeProvider>
);
}
useEffect(() => {
if (!isLoading && !isAuthenticated) {
router.push('/login');
}
}, [isAuthenticated, isLoading, router]);
if (isLoading) {
return <div className="flex items-center justify-center min-h-screen text-xl">Yükleniyor...</div>;
}
if (!isAuthenticated) {
return null; // Or a loading spinner, as the redirect will happen soon
}
return (
<div className="flex flex-col items-center justify-center min-h-screen p-4 bg-background-accent text-foreground">
<h1 className="text-5xl font-extrabold mb-4">Varyasyonlar Paneli</h1>
<p className="text-xl text-center mb-8">Ürün varyasyonlarınızı buradan yönetin.</p>
<p className="text-md text-gray-400">Yalnızca yetkili kullanıcılar erişebilir.</p>
</div>
);
}

View File

@@ -1,57 +1,32 @@
"use client";
import ReactLenis from "lenis/react";
import NavbarLayoutFloatingInline from "@/components/navbar/NavbarLayoutFloatingInline";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import HeroCentered from "@/components/sections/hero/HeroCentered";
import { Wrench, BookOpen, Factory, ShoppingCart, Clock, DollarSign, ListChecks, Database, FlaskConical } from "lucide-react";
import { useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { useAuth } from '@/hooks/useAuth';
export default function ProductionPage() {
const navItems = [
{ name: "Özellikler", id: "features" },
{ name: "Üretim", id: "/production" },
{ name: "Reçeteler", id: "/recipes" },
{ name: "Fiyatlandırma", id: "pricing" },
{ name: "Hakkımızda", id: "about" },
{ name: "İletişim", id: "contact" }
];
const { isAuthenticated, isLoading } = useAuth();
const router = useRouter();
const avatars = [
{ src: "http://img.b2bpic.net/free-photo/cheerful-middle-aged-businesswoman_1262-21005.jpg", alt: "İşletme Sahibi 1" },
{ src: "http://img.b2bpic.net/free-photo/smiling-man-his-work-time-office-job_23-2149571041.jpg", alt: "İşletme Sahibi 2" },
{ src: "http://img.b2bpic.net/free-photo/medium-shot-woman-working-as-lawyer_23-2151202451.jpg", alt: "İşletme Sahibi 3" },
{ src: "http://img.b2bpic.net/free-photo/happy-afroamerican-employee-portrait_23-2148508904.jpg", alt: "İşletme Sahibi 4" },
];
useEffect(() => {
if (!isLoading && !isAuthenticated) {
router.push('/login');
}
}, [isAuthenticated, isLoading, router]);
return (
<ThemeProvider defaultButtonVariant="hover-bubble" defaultTextAnimation="entrance-slide" borderRadius="pill" contentWidth="medium" sizing="medium" background="none" cardStyle="gradient-bordered" primaryButtonStyle="primary-glow" secondaryButtonStyle="layered" headingFontWeight="medium">
<ReactLenis root>
<NavbarLayoutFloatingInline
navItems={navItems}
brandName="Stokify"
button={{ text: "Hemen Başla", href: "/#contact" }}
/>
<HeroCentered
background={{ variant: "rotated-rays-animated-grid" }}
avatars={avatars}
avatarText="Üretiminizi Otomatikleştirin"
title="Üretim ve Reçete Yönetimi ile Verimliliği Artırın"
description="Stokify'ın üretim motoru ile hammadde takibinden üretim siparişlerine kadar tüm süreçleri yönetin."
buttons={[
{
text: "Detayları Keşfet", href: "#"},
{
text: "Reçeteleri Yönet", href: "/recipes"},
]}
marqueeItems={[
{ type: "text-icon", text: "Üretim Takibi", icon: Factory },
{ type: "text-icon", text: "Reçete Oluşturma", icon: BookOpen },
{ type: "text-icon", text: "Hammadde Dedu", icon: Wrench },
{ type: "text-icon", text: "Sipariş Yönetimi", icon: ShoppingCart },
{ type: "text-icon", text: "Gerçek Zamanlı", icon: Clock },
]}
/>
</ReactLenis>
</ThemeProvider>
);
}
if (isLoading) {
return <div className="flex items-center justify-center min-h-screen text-xl">Yükleniyor...</div>;
}
if (!isAuthenticated) {
return null; // Or a loading spinner, as the redirect will happen soon
}
return (
<div className="flex flex-col items-center justify-center min-h-screen p-4 bg-background-accent text-foreground">
<h1 className="text-5xl font-extrabold mb-4">Üretim Paneli</h1>
<p className="text-xl text-center mb-8">Üretim süreçlerinizi ve operasyonlarınızı buradan yönetebilirsiniz.</p>
<p className="text-md text-gray-400">Yalnızca yetkili kullanıcılar erişebilir.</p>
</div>
);
}

View File

@@ -1,57 +1,32 @@
"use client";
import ReactLenis from "lenis/react";
import NavbarLayoutFloatingInline from "@/components/navbar/NavbarLayoutFloatingInline";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import HeroCentered from "@/components/sections/hero/HeroCentered";
import { FlaskConical, ListChecks, Database, DollarSign, Clock, Wrench, BookOpen, Factory, ShoppingCart } from "lucide-react";
import { useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { useAuth } from '@/hooks/useAuth';
export default function RecipesPage() {
const navItems = [
{ name: "Özellikler", id: "features" },
{ name: "Üretim", id: "/production" },
{ name: "Reçeteler", id: "/recipes" },
{ name: "Fiyatlandırma", id: "pricing" },
{ name: "Hakkımızda", id: "about" },
{ name: "İletişim", id: "contact" }
];
const { isAuthenticated, isLoading } = useAuth();
const router = useRouter();
const avatars = [
{ src: "http://img.b2bpic.net/free-photo/cheerful-middle-aged-businesswoman_1262-21005.jpg", alt: "İşletme Sahibi 1" },
{ src: "http://img.b2bpic.net/free-photo/smiling-man-his-work-time-office-job_23-2149571041.jpg", alt: "İşletme Sahibi 2" },
{ src: "http://img.b2bpic.net/free-photo/medium-shot-woman-working-as-lawyer_23-2151202451.jpg", alt: "İşletme Sahibi 3" },
{ src: "http://img.b2bpic.net/free-photo/happy-afroamerican-employee-portrait_23-2148508904.jpg", alt: "İşletme Sahibi 4" },
];
useEffect(() => {
if (!isLoading && !isAuthenticated) {
router.push('/login');
}
}, [isAuthenticated, isLoading, router]);
return (
<ThemeProvider defaultButtonVariant="hover-bubble" defaultTextAnimation="entrance-slide" borderRadius="pill" contentWidth="medium" sizing="medium" background="none" cardStyle="gradient-bordered" primaryButtonStyle="primary-glow" secondaryButtonStyle="layered" headingFontWeight="medium">
<ReactLenis root>
<NavbarLayoutFloatingInline
navItems={navItems}
brandName="Stokify"
button={{ text: "Hemen Başla", href: "/#contact" }}
/>
<HeroCentered
background={{ variant: "rotated-rays-animated-grid" }}
avatars={avatars}
avatarText="Reçetelerinizi Kolayca Oluşturun"
title="Detaylı Reçete Yönetimi ve BOM Oluşturma"
description="Ürünlerinizin tüm bileşenlerini, maliyetlerini ve üretim adımlarını kolayca tanımlayın ve yönetin."
buttons={[
{
text: "Yeni Reçete Oluştur", href: "#"},
{
text: "Üretim Siparişleri", href: "/production"},
]}
marqueeItems={[
{ type: "text-icon", text: "BOM Yönetimi", icon: ListChecks },
{ type: "text-icon", text: "Hammadde Takibi", icon: Database },
{ type: "text-icon", text: "Maliyet Analizi", icon: DollarSign },
{ type: "text-icon", text: "Sürüm Kontrolü", icon: Clock },
{ type: "text-icon", text: "Ürün Varyantları", icon: FlaskConical },
]}
/>
</ReactLenis>
</ThemeProvider>
);
}
if (isLoading) {
return <div className="flex items-center justify-center min-h-screen text-xl">Yükleniyor...</div>;
}
if (!isAuthenticated) {
return null; // Or a loading spinner, as the redirect will happen soon
}
return (
<div className="flex flex-col items-center justify-center min-h-screen p-4 bg-background-accent text-foreground">
<h1 className="text-5xl font-extrabold mb-4">Reçeteler Paneli</h1>
<p className="text-xl text-center mb-8">Ürün reçetelerinizi ve içeriklerini buradan yönetin.</p>
<p className="text-md text-gray-400">Yalnızca yetkili kullanıcılar erişebilir.</p>
</div>
);
}

32
src/app/reports/page.tsx Normal file
View File

@@ -0,0 +1,32 @@
"use client";
import { useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { useAuth } from '@/hooks/useAuth';
export default function ReportsPage() {
const { isAuthenticated, isLoading } = useAuth();
const router = useRouter();
useEffect(() => {
if (!isLoading && !isAuthenticated) {
router.push('/login');
}
}, [isAuthenticated, isLoading, router]);
if (isLoading) {
return <div className="flex items-center justify-center min-h-screen text-xl">Yükleniyor...</div>;
}
if (!isAuthenticated) {
return null; // Or a loading spinner, as the redirect will happen soon
}
return (
<div className="flex flex-col items-center justify-center min-h-screen p-4 bg-background-accent text-foreground">
<h1 className="text-5xl font-extrabold mb-4">Raporlar Paneli</h1>
<p className="text-xl text-center mb-8">İşletmenize özel detaylı raporlara buradan ulaşabilirsiniz.</p>
<p className="text-md text-gray-400">Yalnızca yetkili kullanıcılar erişebilir.</p>
</div>
);
}

View File

@@ -1,94 +1,32 @@
"use client";
import ReactLenis from "lenis/react";
import NavbarLayoutFloatingInline from "@/components/navbar/NavbarLayoutFloatingInline";
import FooterBaseReveal from "@/components/sections/footer/FooterBaseReveal";
import FeatureCardTwentyNine from "@/components/sections/feature/featureCardTwentyNine/FeatureCardTwentyNine";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import { Building, Users, Settings, Key, Shield, ListChecks } from "lucide-react";
import { useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { useAuth } from '@/hooks/useAuth';
export default function SuperadminPage() {
const navItems = [
{ name: "Özellikler", id: "features" },
{ name: "Fiyatlandırma", id: "pricing" },
{ name: "Hakkımızda", id: "about" },
{ name: "İletişim", id: "contact" },
{ name: "Yönetim Paneli", id: "/superadmin" }
];
const { isAuthenticated, isLoading } = useAuth();
const router = useRouter();
const managementFeatures = [
{
title: "Şirket Yönetimi", description: "Sistemdeki tüm şirket hesaplarını görüntüleyin, düzenleyin ve yönetin.", imageSrc: "https://images.unsplash.com/photo-1596526131083-ef1524376527?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w0NTYwMDR8MHwxfHNlYXJjaHw3fHxjb21wYW55JTIwbWFuYWdlbWVudHxlbnwwfHx8fDE3MTc4NTM0MTl8MA&ixlib=rb-4.0.3&q=80&w=1080", imageAlt: "Company Management", titleImageSrc: "", buttonText: "Detaylar", buttonHref: "#"
},
{
title: "Modül Yetkilendirme", description: "Farklı özellik modüllerine erişim yetkilerini kullanıcı rolleri bazında atayın.", imageSrc: "https://images.unsplash.com/photo-1522071820081-009f0129c71c?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w0NTYwMDR8MHwxfHNlYXJjaHw3fHxleHBhbmRpbmclMjBzZXJ2aWNlc3xlbnwwfHx8fDE3MTc4NTM0Mzh8MA&ixlib=rb-4.0.3&q=80&w=1080", imageAlt: "Module Authorization", titleImageSrc: "", buttonText: "Detaylar", buttonHref: "#"
},
{
title: "Kullanıcı Rol Yönetimi", description: "Kullanıcı rollerini (admin, çalışan, vb.) tanımlayın ve yetkilerini özelleştirin.", imageSrc: "https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w0NTYwMDR8MHwxfHNlYXJjaHw3fHx1c2VyJTIwcm9sZXMlMjBtYW5hZ2VtZW50fGVufDB8fHx8MTcxNzg1MzQ0OHww&ixlib=rb-4.0.3&q=80&w=1080", imageAlt: "User Role Management", titleImageSrc: "", buttonText: "Detaylar", buttonHref: "#"
},
{
title: "Sistem Ayarları", description: "Sistem çapında genel ayarları yapılandırın ve platform davranışlarını belirleyin.", imageSrc: "https://images.unsplash.com/photo-1627398242470-f47117e1893c?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3w0NTYwMDR8MHwxfHNlYXJjaHw3fHxzeXN0ZW0lMjBzZXR0aW5nc3xlbnwwfHx8fDE3MTc4NTM0NjR8MA&ixlib=rb-403&q=80&w=1080", imageAlt: "System-wide Settings", titleImageSrc: "", buttonText: "Detaylar", buttonHref: "#"
}
];
useEffect(() => {
if (!isLoading && !isAuthenticated) {
router.push('/login');
}
}, [isAuthenticated, isLoading, router]);
return (
<ThemeProvider defaultButtonVariant="hover-bubble" defaultTextAnimation="entrance-slide" borderRadius="pill" contentWidth="medium" sizing="medium" background="none" cardStyle="gradient-bordered" primaryButtonStyle="primary-glow" secondaryButtonStyle="layered" headingFontWeight="medium">
<ReactLenis root>
<NavbarLayoutFloatingInline
navItems={navItems}
brandName="Stokify"
button={{ text: "Hemen Başla", href: "/#contact" }}
/>
<div id="superadmin-panel" data-section="superadmin-panel" className="pt-20">
<FeatureCardTwentyNine
features={managementFeatures}
animationType="slide-up"
gridVariant="four-items-2x2-equal-grid"
tag="Yönetim Paneli"
title="Süper Yönetici Kontrol Paneli"
description="Stokify platformunun temel yönetim özelliklerine buradan erişin ve kontrol edin."
textboxLayout="default"
useInvertedBackground={false}
/>
</div>
<FooterBaseReveal
logoText="Stokify"
columns={[
{
title: "Ürün", items: [
{ label: "Özellikler", href: "/#features" },
{ label: "Fiyatlandırma", href: "/#pricing" },
{ label: "Entegrasyonlar", href: "#" },
{ label: "Referanslar", href: "#" },
],
},
{
title: "Şirket", items: [
{ label: "Hakkımızda", href: "/#about" },
{ label: "Blog", href: "#" },
{ label: "Kariyer", href: "#" },
{ label: "İletişim", href: "/#contact" },
],
},
{
title: "Kaynaklar", items: [
{ label: "Dokümantasyon", href: "#" },
{ label: "Yardım Merkezi", href: "#" },
{ label: "Topluluk", href: "#" },
{ label: "Destek", href: "#" },
],
},
{
title: "Yasal", items: [
{ label: "Gizlilik Politikası", href: "#" },
{ label: "Kullanım Koşulları", href: "#" },
{ label: "Çerez Politikası", href: "#" },
],
},
]}
copyrightText="2024 Stokify. Tüm hakları saklıdır."
/>
</ReactLenis>
</ThemeProvider>
);
}
if (isLoading) {
return <div className="flex items-center justify-center min-h-screen text-xl">Yükleniyor...</div>;
}
if (!isAuthenticated) {
return null; // Or a loading spinner, as the redirect will happen soon
}
return (
<div className="flex flex-col items-center justify-center min-h-screen p-4 bg-background-accent text-foreground">
<h1 className="text-5xl font-extrabold mb-4">Yönetim Paneli</h1>
<p className="text-xl text-center mb-8">Tüm sistem ayarlarını ve kullanıcılarını buradan yönetin.</p>
<p className="text-md text-red-500 font-semibold">YALNIZCA SÜPER YÖNETİCİLER İÇİN</p>
</div>
);
}

38
src/hooks/useAuth.ts Normal file
View File

@@ -0,0 +1,38 @@
import { useState, useEffect } from 'react';
import { useRouter } from 'next/navigation';
// This is a placeholder for actual authentication logic.
// In a real application, this would interact with an authentication service,
// check tokens, manage sessions, etc.
export const useAuth = () => {
const [isAuthenticated, setIsAuthenticated] = useState(false);
const [isLoading, setIsLoading] = useState(true);
const router = useRouter();
useEffect(() => {
// Simulate checking for a token or session
const token = localStorage.getItem('authToken');
if (token === 'valid-token') {
setIsAuthenticated(true);
} else {
setIsAuthenticated(false);
}
setIsLoading(false);
}, []);
const login = () => {
// Simulate successful login
localStorage.setItem('authToken', 'valid-token');
setIsAuthenticated(true);
router.push('/dashboard'); // Redirect to dashboard after login
};
const logout = () => {
// Simulate logout
localStorage.removeItem('authToken');
setIsAuthenticated(false);
router.push('/login'); // Redirect to login page after logout
};
return { isAuthenticated, isLoading, login, logout };
};