29 Commits

Author SHA1 Message Date
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
5ba808d291 Update src/app/page.tsx 2026-06-09 11:11:22 +00:00
9fe7ed4094 Merge version_2 into main
Merge version_2 into main
2026-06-09 11:07:04 +00:00
20ccdb0fb4 Merge version_2 into main
Merge version_2 into main
2026-06-09 11:06:21 +00:00
12 changed files with 392 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,7 +19,7 @@ export default function SaasTemplatePage() {
{ name: "Fiyatlandırma", id: "pricing" }, { name: "Fiyatlandırma", id: "pricing" },
{ name: "İzlenebilirlik", id: "traceability" }, { name: "İzlenebilirlik", id: "traceability" },
{ name: "Hakkımızda", id: "about" }, { name: "Hakkımızda", id: "about" },
{ name: "İletişim", id: "contact" }, { name: "İletişim", id: "contact" }
]; ];
const avatars = [ const avatars = [
@@ -31,11 +31,13 @@ export default function SaasTemplatePage() {
const features: FeatureCard[] = [ 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, bentoComponent: "marquee", variant: "text", centerIcon: Zap,
texts: ["Gerçek Zamanlı", "Doğru", "Hızlı", "Güvenli"], 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: [ bentoComponent: "3d-stack-cards", items: [
{ icon: TrendingUp, title: "Talep Tahmini", subtitle: "Veriye Dayalı", detail: "Gelecek talebi öngörün" }, { icon: TrendingUp, title: "Talep Tahmini", subtitle: "Veriye Dayalı", detail: "Gelecek talebi öngörün" },
@@ -62,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." description="Stokify ile envanterinizi zahmetsizce yönetin, operasyonel verimliliği artırın ve işinizi büyütün."
buttons={[ buttons={[
{ {
text: "Ücretsiz Deneyin", href: "#contact"}, text: "Ücretsiz Deneyin", href: "#contact"
},
{ {
text: "Detaylı Bilgi", href: "#features"}, text: "Detaylı Bilgi", href: "#features"
},
]} ]}
marqueeItems={[ marqueeItems={[
{ type: "text-icon", text: "Envanter Takibi", icon: Layers }, { type: "text-icon", text: "Envanter Takibi", icon: Layers },
@@ -74,15 +78,17 @@ export default function SaasTemplatePage() {
{ type: "text-icon", text: "Otomatik Raporlama", icon: BarChart3 }, { type: "text-icon", text: "Otomatik Raporlama", icon: BarChart3 },
]} ]}
/> />
<FeatureBento <div id="about" data-section="about">
features={features} <FeatureBento
animationType="none" features={features}
tag="Temel Özellikler" animationType="none"
title="Stok Yönetiminde İhtiyacınız Olan Her Şey" tag="Temel Özellikler"
description="Stokify, işletmenizin envanterini kolayca yönetmenizi ve operasyonel verimliliği artırmanızı sağlar." title="Stok Yönetiminde İhtiyacınız Olan Her Şey"
textboxLayout="default" description="Stokify, işletmenizin envanterini kolayca yönetmenizi ve operasyonel verimliliği artırmanızı sağlar."
useInvertedBackground={false} textboxLayout="default"
/> useInvertedBackground={false}
/>
</div>
<FeatureBorderGlow <FeatureBorderGlow
tag="Neden Stokify?" tag="Neden Stokify?"
tagIcon={HelpCircle} tagIcon={HelpCircle}
@@ -94,16 +100,20 @@ export default function SaasTemplatePage() {
features={[ features={[
{ {
icon: Package, 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, 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, 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, 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"> <div id="traceability" data-section="traceability">
@@ -137,6 +147,7 @@ export default function SaasTemplatePage() {
] ]
} }
]} ]}
buttons={[{ text: "Şimdi Keşfet", href: "#contact" }]}
/> />
</div> </div>
<TestimonialCardFifteen <TestimonialCardFifteen
@@ -163,7 +174,8 @@ export default function SaasTemplatePage() {
{ text: "Hemen Başla", onClick: () => console.log("Starter clicked") }, { text: "Hemen Başla", onClick: () => console.log("Starter clicked") },
], ],
features: [ 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, id: "pro", badge: "Profesyonel", badgeIcon: BarChart3,
@@ -171,7 +183,8 @@ export default function SaasTemplatePage() {
{ text: "Hemen Başla", onClick: () => console.log("Pro clicked") }, { text: "Hemen Başla", onClick: () => console.log("Pro clicked") },
], ],
features: [ 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, id: "enterprise", badge: "Kurumsal", badgeIcon: Building,
@@ -179,7 +192,8 @@ export default function SaasTemplatePage() {
{ text: "Teklif Alın", onClick: () => console.log("Enterprise clicked") }, { text: "Teklif Alın", onClick: () => console.log("Enterprise clicked") },
], ],
features: [ 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"
],
}, },
]} ]}
/> />
@@ -199,35 +213,22 @@ export default function SaasTemplatePage() {
columns={[ columns={[
{ {
title: "Ürün", items: [ title: "Ürün", items: [
{ label: "Özellikler", href: "#features" }, { label: "Özellikler", href: "/#features" },
{ label: "Fiyatlandırma", href: "#pricing" }, { label: "Fiyatlandırma", href: "/#pricing" },
{ label: "İzlenebilirlik", href: "#traceability" }, { label: "İzlenebilirlik", href: "/#traceability" }
{ label: "Entegrasyonlar", href: "#" },
{ label: "Referanslar", href: "#" },
], ],
}, },
{ {
title: "Şirket", items: [ title: "Şirket", items: [
{ label: "Hakkımızda", href: "#about" }, { label: "Hakkımızda", href: "/#about" },
{ label: "Blog", href: "#" }, { label: "İletişim", href: "/#contact" }
{ label: "Kariyer", href: "#" },
{ label: "İletişim", href: "#contact" },
], ],
}, },
{ {
title: "Kaynaklar", items: [ title: "Kaynaklar", items: []
{ label: "Dokümantasyon", href: "#" },
{ label: "Yardım Merkezi", href: "#" },
{ label: "Topluluk", href: "#" },
{ label: "Destek", href: "#" },
],
}, },
{ {
title: "Yasal", items: [ 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." copyrightText="2024 Stokify. Tüm hakları saklıdır."

View File

@@ -1,74 +1,32 @@
"use client"; "use client";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import { useEffect } from 'react';
import ReactLenis from "lenis/react"; import { useRouter } from 'next/navigation';
import NavbarLayoutFloatingInline from "@/components/navbar/NavbarLayoutFloatingInline"; import { useAuth } from '@/hooks/useAuth';
import TextBox from "@/components/Textbox";
import FooterBaseReveal from "@/components/sections/footer/FooterBaseReveal";
export default function ProductVariationsPage() { export default function ProductVariationsPage() {
const navItems = [ const { isAuthenticated, isLoading } = useAuth();
{ name: "Özellikler", id: "features" }, const router = useRouter();
{ name: "Fiyatlandırma", id: "pricing" },
{ name: "Hakkımızda", id: "about" },
{ name: "İletişim", id: "contact" },
{ name: "Varyasyonlar", id: "/product-variations" }
];
return ( useEffect(() => {
<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"> if (!isLoading && !isAuthenticated) {
<ReactLenis root> router.push('/login');
<NavbarLayoutFloatingInline }
navItems={navItems} }, [isAuthenticated, isLoading, router]);
brandName="Stokify"
button={{ text: "Hemen Başla", href: "#contact" }} if (isLoading) {
/> return <div className="flex items-center justify-center min-h-screen text-xl">Yükleniyor...</div>;
<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" if (!isAuthenticated) {
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." return null; // Or a loading spinner, as the redirect will happen soon
textboxLayout="default" }
center={true}
/> return (
</div> <div className="flex flex-col items-center justify-center min-h-screen p-4 bg-background-accent text-foreground">
<FooterBaseReveal <h1 className="text-5xl font-extrabold mb-4">Varyasyonlar Paneli</h1>
logoText="Stokify" <p className="text-xl text-center mb-8">Ürün varyasyonlarınızı buradan yönetin.</p>
columns={[ <p className="text-md text-gray-400">Yalnızca yetkili kullanıcılar erişebilir.</p>
{ </div>
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>
);
}

View File

@@ -1,57 +1,32 @@
"use client"; "use client";
import ReactLenis from "lenis/react"; import { useEffect } from 'react';
import NavbarLayoutFloatingInline from "@/components/navbar/NavbarLayoutFloatingInline"; import { useRouter } from 'next/navigation';
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import { useAuth } from '@/hooks/useAuth';
import HeroCentered from "@/components/sections/hero/HeroCentered";
import { Wrench, BookOpen, Factory, ShoppingCart, Clock, DollarSign, ListChecks, Database, FlaskConical } from "lucide-react";
export default function ProductionPage() { export default function ProductionPage() {
const navItems = [ const { isAuthenticated, isLoading } = useAuth();
{ name: "Özellikler", id: "features" }, const router = useRouter();
{ 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 avatars = [ useEffect(() => {
{ src: "http://img.b2bpic.net/free-photo/cheerful-middle-aged-businesswoman_1262-21005.jpg", alt: "İşletme Sahibi 1" }, if (!isLoading && !isAuthenticated) {
{ src: "http://img.b2bpic.net/free-photo/smiling-man-his-work-time-office-job_23-2149571041.jpg", alt: "İşletme Sahibi 2" }, router.push('/login');
{ 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" }, }, [isAuthenticated, isLoading, router]);
];
return ( if (isLoading) {
<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"> return <div className="flex items-center justify-center min-h-screen text-xl">Yükleniyor...</div>;
<ReactLenis root> }
<NavbarLayoutFloatingInline
navItems={navItems} if (!isAuthenticated) {
brandName="Stokify" return null; // Or a loading spinner, as the redirect will happen soon
button={{ text: "Hemen Başla", href: "/#contact" }} }
/>
<HeroCentered return (
background={{ variant: "rotated-rays-animated-grid" }} <div className="flex flex-col items-center justify-center min-h-screen p-4 bg-background-accent text-foreground">
avatars={avatars} <h1 className="text-5xl font-extrabold mb-4">Üretim Paneli</h1>
avatarText="Üretiminizi Otomatikleştirin" <p className="text-xl text-center mb-8">Üretim süreçlerinizi ve operasyonlarınızı buradan yönetebilirsiniz.</p>
title="Üretim ve Reçete Yönetimi ile Verimliliği Artırın" <p className="text-md text-gray-400">Yalnızca yetkili kullanıcılar erişebilir.</p>
description="Stokify'ın üretim motoru ile hammadde takibinden üretim siparişlerine kadar tüm süreçleri yönetin." </div>
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>
);
}

View File

@@ -1,57 +1,32 @@
"use client"; "use client";
import ReactLenis from "lenis/react"; import { useEffect } from 'react';
import NavbarLayoutFloatingInline from "@/components/navbar/NavbarLayoutFloatingInline"; import { useRouter } from 'next/navigation';
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import { useAuth } from '@/hooks/useAuth';
import HeroCentered from "@/components/sections/hero/HeroCentered";
import { FlaskConical, ListChecks, Database, DollarSign, Clock, Wrench, BookOpen, Factory, ShoppingCart } from "lucide-react";
export default function RecipesPage() { export default function RecipesPage() {
const navItems = [ const { isAuthenticated, isLoading } = useAuth();
{ name: "Özellikler", id: "features" }, const router = useRouter();
{ 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 avatars = [ useEffect(() => {
{ src: "http://img.b2bpic.net/free-photo/cheerful-middle-aged-businesswoman_1262-21005.jpg", alt: "İşletme Sahibi 1" }, if (!isLoading && !isAuthenticated) {
{ src: "http://img.b2bpic.net/free-photo/smiling-man-his-work-time-office-job_23-2149571041.jpg", alt: "İşletme Sahibi 2" }, router.push('/login');
{ 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" }, }, [isAuthenticated, isLoading, router]);
];
return ( if (isLoading) {
<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"> return <div className="flex items-center justify-center min-h-screen text-xl">Yükleniyor...</div>;
<ReactLenis root> }
<NavbarLayoutFloatingInline
navItems={navItems} if (!isAuthenticated) {
brandName="Stokify" return null; // Or a loading spinner, as the redirect will happen soon
button={{ text: "Hemen Başla", href: "/#contact" }} }
/>
<HeroCentered return (
background={{ variant: "rotated-rays-animated-grid" }} <div className="flex flex-col items-center justify-center min-h-screen p-4 bg-background-accent text-foreground">
avatars={avatars} <h1 className="text-5xl font-extrabold mb-4">Reçeteler Paneli</h1>
avatarText="Reçetelerinizi Kolayca Oluşturun" <p className="text-xl text-center mb-8">Ürün reçetelerinizi ve içeriklerini buradan yönetin.</p>
title="Detaylı Reçete Yönetimi ve BOM Oluşturma" <p className="text-md text-gray-400">Yalnızca yetkili kullanıcılar erişebilir.</p>
description="Ürünlerinizin tüm bileşenlerini, maliyetlerini ve üretim adımlarını kolayca tanımlayın ve yönetin." </div>
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>
);
}

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"; "use client";
import ReactLenis from "lenis/react"; import { useEffect } from 'react';
import NavbarLayoutFloatingInline from "@/components/navbar/NavbarLayoutFloatingInline"; import { useRouter } from 'next/navigation';
import FooterBaseReveal from "@/components/sections/footer/FooterBaseReveal"; import { useAuth } from '@/hooks/useAuth';
import FeatureCardTwentyNine from "@/components/sections/feature/featureCardTwentyNine/FeatureCardTwentyNine";
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
import { Building, Users, Settings, Key, Shield, ListChecks } from "lucide-react";
export default function SuperadminPage() { export default function SuperadminPage() {
const navItems = [ const { isAuthenticated, isLoading } = useAuth();
{ name: "Özellikler", id: "features" }, const router = useRouter();
{ name: "Fiyatlandırma", id: "pricing" },
{ name: "Hakkımızda", id: "about" },
{ name: "İletişim", id: "contact" },
{ name: "Yönetim Paneli", id: "/superadmin" }
];
const managementFeatures = [ useEffect(() => {
{ if (!isLoading && !isAuthenticated) {
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: "#" router.push('/login');
}, }
{ }, [isAuthenticated, isLoading, router]);
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: "#"
}
];
return ( if (isLoading) {
<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"> return <div className="flex items-center justify-center min-h-screen text-xl">Yükleniyor...</div>;
<ReactLenis root> }
<NavbarLayoutFloatingInline
navItems={navItems} if (!isAuthenticated) {
brandName="Stokify" return null; // Or a loading spinner, as the redirect will happen soon
button={{ text: "Hemen Başla", href: "/#contact" }} }
/>
<div id="superadmin-panel" data-section="superadmin-panel" className="pt-20"> return (
<FeatureCardTwentyNine <div className="flex flex-col items-center justify-center min-h-screen p-4 bg-background-accent text-foreground">
features={managementFeatures} <h1 className="text-5xl font-extrabold mb-4">Yönetim Paneli</h1>
animationType="slide-up" <p className="text-xl text-center mb-8">Tüm sistem ayarlarını ve kullanıcılarını buradan yönetin.</p>
gridVariant="four-items-2x2-equal-grid" <p className="text-md text-red-500 font-semibold">YALNIZCA SÜPER YÖNETİCİLER İÇİN</p>
tag="Yönetim Paneli" </div>
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>
);
}

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 };
};