first commit
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { getDemoBySlug, demos } from "@/data/demos";
|
||||
import KlinikTemplate from "@/components/templates/KlinikTemplate";
|
||||
import RestoranTemplate from "@/components/templates/RestoranTemplate";
|
||||
import KurumsalTemplate from "@/components/templates/KurumsalTemplate";
|
||||
import DentalTemplate from "@/components/templates/DentalTemplate";
|
||||
import RestoranTemplate2 from "@/components/templates/RestoranTemplate2";
|
||||
import { notFound } from "next/navigation";
|
||||
import { i18n, Locale } from "@/i18n-config";
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const paths: Array<{ lang: Locale; slug: string }> = [];
|
||||
const demoList = Object.keys(demos);
|
||||
for (const lang of i18n.locales) {
|
||||
for (const slug of demoList) {
|
||||
paths.push({ lang, slug });
|
||||
}
|
||||
}
|
||||
return paths;
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale; slug: string }> }) {
|
||||
const { slug } = await params;
|
||||
const data = getDemoBySlug(slug);
|
||||
if (!data) return { title: "Demo Bulunamadı | Ayris Tech" };
|
||||
return {
|
||||
title: `${data.firma.adi} — Premium Arayüz Demosu`,
|
||||
description: data.firma.slogan,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function DemoPage({ params }: { params: Promise<{ lang: Locale; slug: string }> }) {
|
||||
const { slug } = await params;
|
||||
const data = getDemoBySlug(slug);
|
||||
if (!data) notFound();
|
||||
|
||||
if (data.template === "klinik") return <KlinikTemplate data={data} />;
|
||||
if (data.template === "restoran") return <RestoranTemplate data={data} />;
|
||||
if (data.template === "kurumsal") return <KurumsalTemplate data={data} />;
|
||||
if (data.template === "dental") return <DentalTemplate data={data} />;
|
||||
if (data.template === "restoran2") return <RestoranTemplate2 data={data} />;
|
||||
notFound();
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
"use client";
|
||||
|
||||
import * as React from "react";
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { motion, AnimatePresence } from "framer-motion";
|
||||
import { adminLoginAction } from "@/app/actions";
|
||||
import Link from "next/link";
|
||||
|
||||
const expo = [0.16, 1, 0.3, 1] as [number, number, number, number];
|
||||
|
||||
interface Props {
|
||||
params: Promise<{ lang: string }>;
|
||||
}
|
||||
|
||||
export default function AdminLoginPage({ params }: Props) {
|
||||
const router = useRouter();
|
||||
|
||||
// Unpack params Promise natively using React 19 use() hook
|
||||
const { lang } = React.use(params);
|
||||
|
||||
const [username, setUsername] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
if (!username.trim() || !password.trim()) {
|
||||
setError("Kullanıcı adı ve şifre zorunludur!");
|
||||
return;
|
||||
}
|
||||
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
|
||||
const res = await adminLoginAction({ username: username.trim(), password: password.trim() });
|
||||
if (res.success) {
|
||||
router.push(`/${lang}/admin`);
|
||||
} else {
|
||||
setError(res.error || "Giriş başarısız!");
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="bg-[#F4F0E8] text-[#0A0A0A] font-body min-h-screen flex items-center justify-center p-6 relative overflow-hidden">
|
||||
{/* Dynamic Background Pattern */}
|
||||
<div
|
||||
className="absolute inset-0 opacity-[0.03] pointer-events-none select-none"
|
||||
style={{
|
||||
backgroundImage: "radial-gradient(#000 1px, transparent 1px)",
|
||||
backgroundSize: "20px 20px"
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Decorative Floating Block */}
|
||||
<div className="absolute top-1/4 left-1/4 w-32 h-32 bg-[#FFE600] opacity-10 blur-2xl rounded-full pointer-events-none" />
|
||||
<div className="absolute bottom-1/4 right-1/4 w-48 h-48 bg-[#FF4500] opacity-5 blur-3xl rounded-full pointer-events-none" />
|
||||
|
||||
<main className="relative z-10 w-full max-w-md">
|
||||
{/* Back to Home Link */}
|
||||
<div className="mb-6 flex justify-start">
|
||||
<Link
|
||||
href={`/${lang}`}
|
||||
className="inline-flex items-center gap-2 font-mono text-[10px] tracking-[0.25em] uppercase text-[#A0998E] hover:text-[#0A0A0A] transition-colors"
|
||||
>
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round">
|
||||
<line x1="19" y1="12" x2="5" y2="12" />
|
||||
<polyline points="12 19 5 12 12 5" />
|
||||
</svg>
|
||||
ANA SAYFAYA DÖN
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 30 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ duration: 0.8, ease: expo }}
|
||||
className="bg-[#F4F0E8] border-2 border-[#0A0A0A] p-10 relative shadow-[8px_8px_0px_0px_#0A0A0A]"
|
||||
>
|
||||
{/* Accent Ribbon */}
|
||||
<div className="absolute top-0 left-0 right-0 h-2 bg-[#FFE600]" />
|
||||
|
||||
{/* Logo Monogram */}
|
||||
<div className="w-16 h-16 border-2 border-[#0A0A0A] bg-[#FFE600] text-[#0A0A0A] font-display font-black text-xl flex items-center justify-center select-none mx-auto mb-8 shadow-[4px_4px_0px_0px_#0A0A0A]">
|
||||
AYR
|
||||
</div>
|
||||
|
||||
<div className="text-center mb-8">
|
||||
<h1 className="font-display font-black text-3xl uppercase tracking-tight text-[#0A0A0A] mb-2 leading-none">
|
||||
YÖNETİCİ GİRİŞİ
|
||||
</h1>
|
||||
<p className="font-mono text-[9px] uppercase tracking-[0.2em] text-[#A0998E]">
|
||||
AYRİS TECH YÖNETİM MERKEZİ
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form onSubmit={handleSubmit} className="space-y-6">
|
||||
{/* Error Message */}
|
||||
<AnimatePresence mode="wait">
|
||||
{error && (
|
||||
<motion.div
|
||||
initial={{ opacity: 0, x: -10 }}
|
||||
animate={{ opacity: 1, x: 0 }}
|
||||
exit={{ opacity: 0, x: 10 }}
|
||||
className="bg-[#FFF0F0] border border-[#FF4500] text-[#FF4500] p-4 font-mono text-[10px] tracking-wide uppercase flex items-center gap-3"
|
||||
>
|
||||
<div className="w-2.5 h-2.5 bg-[#FF4500] shrink-0 animate-ping" />
|
||||
<span className="flex-grow">{error}</span>
|
||||
</motion.div>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
|
||||
{/* Username Input */}
|
||||
<div className="space-y-2">
|
||||
<label className="block font-mono text-[9px] uppercase tracking-[0.2em] text-[#6A6460]">
|
||||
KULLANICI ADI
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
required
|
||||
value={username}
|
||||
onChange={(e) => setUsername(e.target.value)}
|
||||
disabled={loading}
|
||||
className="w-full font-mono text-xs bg-[#EDE8E0] border border-[#C8C2B8] hover:border-[#0A0A0A] focus:border-[#0A0A0A] focus:bg-[#EDE8E0] outline-none px-4 py-3.5 text-[#0A0A0A] transition-all"
|
||||
placeholder="Örn: admin"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Password Input */}
|
||||
<div className="space-y-2">
|
||||
<label className="block font-mono text-[9px] uppercase tracking-[0.2em] text-[#6A6460]">
|
||||
ŞİFRE
|
||||
</label>
|
||||
<input
|
||||
type="password"
|
||||
required
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
disabled={loading}
|
||||
className="w-full font-mono text-xs bg-[#EDE8E0] border border-[#C8C2B8] hover:border-[#0A0A0A] focus:border-[#0A0A0A] focus:bg-[#EDE8E0] outline-none px-4 py-3.5 text-[#0A0A0A] transition-all"
|
||||
placeholder="••••••••"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Submit Button */}
|
||||
<button
|
||||
type="submit"
|
||||
disabled={loading}
|
||||
className="w-full border-2 border-[#0A0A0A] bg-[#FFE600] hover:bg-[#FFE600] text-[#0A0A0A] py-4 font-display font-black text-xs tracking-[0.2em] uppercase transition-all shadow-[4px_4px_0px_0px_#0A0A0A] hover:shadow-[2px_2px_0px_0px_#0A0A0A] hover:translate-x-[2px] hover:translate-y-[2px] active:translate-x-[4px] active:translate-y-[4px] active:shadow-none cursor-pointer flex items-center justify-center gap-2"
|
||||
>
|
||||
{loading ? (
|
||||
<>
|
||||
<div className="w-3.5 h-3.5 border-2 border-[#0A0A0A] border-t-transparent rounded-full animate-spin shrink-0" />
|
||||
BAĞLANIYOR...
|
||||
</>
|
||||
) : (
|
||||
"SİSTEME GİRİŞ YAP"
|
||||
)}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
{/* Decorative Security Footer */}
|
||||
<div className="mt-8 pt-6 border-t border-[#C8C2B8] flex justify-between items-center text-[#A0998E] font-mono text-[8px] tracking-widest uppercase">
|
||||
<span>SECURE SHELL v2.4</span>
|
||||
<span className="text-[#00CC77] font-bold">● ONLINE</span>
|
||||
</div>
|
||||
</motion.div>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import AdminClient from "@/components/AdminClient";
|
||||
import { getProjects, getBlogPosts, getAdminSession, getPartners } from "@/app/actions";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export async function generateStaticParams() {
|
||||
return [{ lang: "tr" }, { lang: "en" }];
|
||||
}
|
||||
|
||||
export async function generateMetadata() {
|
||||
return {
|
||||
title: "Yönetim Paneli | Ayris Tech",
|
||||
description: "Ayris Tech sistem, proje ve site ayarları yönetim merkezi.",
|
||||
};
|
||||
}
|
||||
|
||||
export default async function AdminPage({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
|
||||
// Guard dashboard route against unauthenticated users
|
||||
const session = await getAdminSession();
|
||||
if (!session) {
|
||||
redirect(`/${lang}/admin/login`);
|
||||
}
|
||||
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
const initialDbProjects = await getProjects();
|
||||
const initialDbBlogPosts = await getBlogPosts();
|
||||
const initialDbPartners = await getPartners();
|
||||
|
||||
// Convert DB format to expected BlogPost format
|
||||
const initialBlogPosts = initialDbBlogPosts.map((dbPost) => ({
|
||||
id: dbPost.id,
|
||||
slug: dbPost.slug,
|
||||
date: dbPost.date,
|
||||
author: dbPost.author,
|
||||
authorRole: dbPost.authorRole,
|
||||
image: dbPost.image,
|
||||
tr: {
|
||||
title: dbPost.trTitle,
|
||||
excerpt: dbPost.trExcerpt,
|
||||
readingTime: dbPost.trReadingTime,
|
||||
category: dbPost.trCategory,
|
||||
tags: dbPost.trTags,
|
||||
content: dbPost.trContent,
|
||||
},
|
||||
en: {
|
||||
title: dbPost.enTitle,
|
||||
excerpt: dbPost.enExcerpt,
|
||||
readingTime: dbPost.enReadingTime,
|
||||
category: dbPost.enCategory,
|
||||
tags: dbPost.enTags,
|
||||
content: dbPost.enContent,
|
||||
}
|
||||
}));
|
||||
|
||||
// Convert DB Project format to standard ProjectData format (mapping fields properly)
|
||||
const initialProjects = initialDbProjects.map((p) => ({
|
||||
id: p.id,
|
||||
num: p.num,
|
||||
slug: p.slug,
|
||||
title: p.title,
|
||||
tag: p.tag,
|
||||
desc: p.desc,
|
||||
spec: p.spec,
|
||||
year: p.year,
|
||||
client: p.client,
|
||||
duration: p.duration,
|
||||
tech: p.tech,
|
||||
challenge: p.challenge,
|
||||
solution: p.solution,
|
||||
results: p.results,
|
||||
image: p.image,
|
||||
gallery: p.gallery,
|
||||
website: p.website,
|
||||
}));
|
||||
|
||||
// Map database Partners
|
||||
const initialPartners = initialDbPartners.map((p) => ({
|
||||
id: p.id,
|
||||
name: p.name,
|
||||
tag: p.tag,
|
||||
mono: p.mono,
|
||||
year: p.year,
|
||||
desc: p.desc,
|
||||
}));
|
||||
|
||||
return (
|
||||
<AdminClient
|
||||
lang={lang}
|
||||
dict={dict}
|
||||
initialProjects={initialProjects}
|
||||
initialBlogPosts={initialBlogPosts}
|
||||
initialPartners={initialPartners}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import { getBlogPosts } from "@/app/actions";
|
||||
import BlogDetailClient from "@/components/BlogDetailClient";
|
||||
import { notFound } from "next/navigation";
|
||||
|
||||
// Convert DB format to expected BlogPost format
|
||||
function mapBlogPost(dbPost: any) {
|
||||
return {
|
||||
id: dbPost.id,
|
||||
slug: dbPost.slug,
|
||||
date: dbPost.date,
|
||||
author: dbPost.author,
|
||||
authorRole: dbPost.authorRole,
|
||||
image: dbPost.image,
|
||||
tr: {
|
||||
title: dbPost.trTitle,
|
||||
excerpt: dbPost.trExcerpt,
|
||||
readingTime: dbPost.trReadingTime,
|
||||
category: dbPost.trCategory,
|
||||
tags: dbPost.trTags,
|
||||
content: dbPost.trContent,
|
||||
},
|
||||
en: {
|
||||
title: dbPost.enTitle,
|
||||
excerpt: dbPost.enExcerpt,
|
||||
readingTime: dbPost.enReadingTime,
|
||||
category: dbPost.enCategory,
|
||||
tags: dbPost.enTags,
|
||||
content: dbPost.enContent,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const langs: Locale[] = ["en", "tr"];
|
||||
const dbPosts = await getBlogPosts();
|
||||
|
||||
const slugs = dbPosts.length > 0
|
||||
? dbPosts.map((p) => p.slug)
|
||||
: [
|
||||
"real-time-anomaly-detection-ai",
|
||||
"web3-consortium-networks-logistics",
|
||||
"headless-ecommerce-conversion-rates",
|
||||
];
|
||||
|
||||
return langs.flatMap((lang) =>
|
||||
slugs.map((slug) => ({ lang, slug }))
|
||||
);
|
||||
}
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ lang: Locale; slug: string }>;
|
||||
}) {
|
||||
const { lang, slug } = await params;
|
||||
const dbPosts = await getBlogPosts();
|
||||
|
||||
const dbPost = dbPosts.find((p) => p.slug === slug);
|
||||
if (!dbPost) return { title: "Not Found" };
|
||||
|
||||
const post = mapBlogPost(dbPost);
|
||||
const content = post[lang] || post.en;
|
||||
return {
|
||||
title: `${content.title} | Ayris Tech`,
|
||||
description: content.excerpt,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function BlogPostPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ lang: Locale; slug: string }>;
|
||||
}) {
|
||||
const { lang, slug } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
const dbPosts = await getBlogPosts();
|
||||
const dbPost = dbPosts.find((p) => p.slug === slug);
|
||||
|
||||
if (!dbPost) notFound();
|
||||
|
||||
const post = mapBlogPost(dbPost);
|
||||
|
||||
return <BlogDetailClient lang={lang} dict={dict} post={post} />;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import BlogClient from "@/components/BlogClient";
|
||||
import { getBlogPosts } from "@/app/actions";
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
return {
|
||||
title: `${dict.blog.title} | ${dict.nav.brandName}${dict.nav.brandSub}`,
|
||||
description: dict.blog.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function BlogPage({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
const dbPosts = await getBlogPosts();
|
||||
|
||||
const initialPosts = dbPosts.map((dbPost) => ({
|
||||
id: dbPost.id,
|
||||
slug: dbPost.slug,
|
||||
date: dbPost.date,
|
||||
author: dbPost.author,
|
||||
authorRole: dbPost.authorRole,
|
||||
image: dbPost.image,
|
||||
tr: {
|
||||
title: dbPost.trTitle,
|
||||
excerpt: dbPost.trExcerpt,
|
||||
readingTime: dbPost.trReadingTime,
|
||||
category: dbPost.trCategory,
|
||||
tags: dbPost.trTags,
|
||||
content: dbPost.trContent,
|
||||
},
|
||||
en: {
|
||||
title: dbPost.enTitle,
|
||||
excerpt: dbPost.enExcerpt,
|
||||
readingTime: dbPost.enReadingTime,
|
||||
category: dbPost.enCategory,
|
||||
tags: dbPost.enTags,
|
||||
content: dbPost.enContent,
|
||||
}
|
||||
}));
|
||||
|
||||
return <BlogClient lang={lang} dict={dict} initialPosts={initialPosts} />;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import ContactClient from "@/components/ContactClient";
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
return {
|
||||
title: `${dict.contact.title} | ${dict.nav.brandName}${dict.nav.brandSub}`,
|
||||
description: dict.contact.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function ContactPage({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
return <ContactClient lang={lang} dict={dict} />;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import FAQClient from "@/components/FAQClient";
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
return {
|
||||
title: `${dict.faq.title} | ${dict.nav.brandName}${dict.nav.brandSub}`,
|
||||
description: dict.faq.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function FAQPage({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
return <FAQClient lang={lang} dict={dict} />;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Archivo, Space_Grotesk, IBM_Plex_Mono } from "next/font/google";
|
||||
import "../globals.css";
|
||||
import { Locale, i18n } from "@/i18n-config";
|
||||
|
||||
const archivo = Archivo({
|
||||
subsets: ["latin"],
|
||||
weight: ["300", "400", "500", "600", "700", "900"],
|
||||
variable: "--font-archivo",
|
||||
});
|
||||
|
||||
const spaceGrotesk = Space_Grotesk({
|
||||
subsets: ["latin"],
|
||||
weight: ["300", "400", "500", "600", "700"],
|
||||
variable: "--font-space-grotesk",
|
||||
});
|
||||
|
||||
const ibmPlexMono = IBM_Plex_Mono({
|
||||
subsets: ["latin"],
|
||||
weight: ["300", "400", "500", "600", "700"],
|
||||
variable: "--font-ibm-plex-mono",
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Ayris Tech | Forging the Future with AI & Blockchain",
|
||||
description: "Ayris Tech delivers enterprise-grade digital transformation. We build the impossible for the next generation of business using AI, Blockchain, and modern web technologies.",
|
||||
keywords: ["AI Solutions", "Blockchain Development", "Mobile App", "Web Development", "Digital Transformation"],
|
||||
};
|
||||
|
||||
export async function generateStaticParams() {
|
||||
return i18n.locales.map((locale) => ({ lang: locale }));
|
||||
}
|
||||
|
||||
export default async function RootLayout({
|
||||
children,
|
||||
params,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
params: Promise<{ lang: string }>;
|
||||
}) {
|
||||
const { lang } = await params;
|
||||
return (
|
||||
<html lang={lang} className="scroll-smooth">
|
||||
<body className={`${archivo.variable} ${spaceGrotesk.variable} ${ibmPlexMono.variable} font-body bg-[#F4F0E8] text-[#0A0A0A] antialiased`}>
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import HomeClient from "@/components/HomeClient";
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
return {
|
||||
title: `${dict.nav.brandName}${dict.nav.brandSub} | ${dict.hero.badge}`,
|
||||
description: dict.hero.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function Page({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
return <HomeClient lang={lang} dict={dict} />;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import PartnersClient from "@/components/PartnersClient";
|
||||
import { getPartners } from "@/app/actions";
|
||||
|
||||
export async function generateStaticParams() {
|
||||
return [{ lang: "tr" }, { lang: "en" }];
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
return {
|
||||
title: `${dict.partners.title} | ${dict.nav.brandName}${dict.nav.brandSub}`,
|
||||
description: dict.partners.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function PartnersPage({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
const partners = await getPartners();
|
||||
|
||||
return <PartnersClient lang={lang} dict={dict} initialPartners={partners} />;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import ProcessClient from "@/components/ProcessClient";
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
return {
|
||||
title: `${dict.process.title} | ${dict.nav.brandName}${dict.nav.brandSub}`,
|
||||
description: dict.process.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function ProcessPage({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
return <ProcessClient lang={lang} dict={dict} />;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import ServicesClient from "@/components/ServicesClient";
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
return {
|
||||
title: `${dict.services.title} | ${dict.nav.brandName}${dict.nav.brandSub}`,
|
||||
description: dict.services.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function ServicesPage({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
return <ServicesClient lang={lang} dict={dict} />;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import WorkDetailClient from "@/components/WorkDetailClient";
|
||||
import { notFound } from "next/navigation";
|
||||
import { getProjects } from "@/app/actions";
|
||||
|
||||
// ── Static params for all slug × lang combinations ──
|
||||
export async function generateStaticParams() {
|
||||
const langs: Locale[] = ["en", "tr"];
|
||||
const dbProjects = await getProjects();
|
||||
|
||||
const slugs = dbProjects.length > 0
|
||||
? dbProjects.map((p) => p.slug)
|
||||
: [
|
||||
"financeai-dashboard",
|
||||
"chainsupply-network",
|
||||
"meditrack-mobile",
|
||||
"novamart-platform",
|
||||
];
|
||||
|
||||
return langs.flatMap((lang) =>
|
||||
slugs.map((slug) => ({ lang, slug }))
|
||||
);
|
||||
}
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ lang: Locale; slug: string }>;
|
||||
}) {
|
||||
const { lang, slug } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
const dbProjects = await getProjects();
|
||||
const items = dbProjects.length > 0 ? dbProjects : (dict.work.items as any[]);
|
||||
const project = items.find((p: any) => p.slug === slug);
|
||||
if (!project) return { title: "Not Found" };
|
||||
|
||||
return {
|
||||
title: `${project.title} — ${dict.nav.brandName}${dict.nav.brandSub}`,
|
||||
description: project.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function WorkDetailPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ lang: Locale; slug: string }>;
|
||||
}) {
|
||||
const { lang, slug } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
|
||||
const dbProjects = await getProjects();
|
||||
const items = dbProjects.length > 0 ? dbProjects : (dict.work.items as any[]);
|
||||
const project = items.find((p: any) => p.slug === slug);
|
||||
|
||||
if (!project) notFound();
|
||||
|
||||
// Determine prev/next
|
||||
const currentIdx = items.findIndex((p: any) => p.slug === slug);
|
||||
const prev = currentIdx > 0 ? items[currentIdx - 1] : null;
|
||||
const next = currentIdx < items.length - 1 ? items[currentIdx + 1] : null;
|
||||
|
||||
return (
|
||||
<WorkDetailClient
|
||||
lang={lang}
|
||||
dict={dict}
|
||||
project={project}
|
||||
prev={prev}
|
||||
next={next}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { getDictionary } from "@/get-dictionary";
|
||||
import type { Locale } from "@/i18n-config";
|
||||
import WorkClient from "@/components/WorkClient";
|
||||
import { getProjects } from "@/app/actions";
|
||||
|
||||
export async function generateMetadata({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
return {
|
||||
title: `${dict.work.title} | ${dict.nav.brandName}${dict.nav.brandSub}`,
|
||||
description: dict.work.desc,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function WorkPage({ params }: { params: Promise<{ lang: Locale }> }) {
|
||||
const { lang } = await params;
|
||||
const dict = await getDictionary(lang);
|
||||
const projects = await getProjects();
|
||||
|
||||
return <WorkClient lang={lang} dict={dict} initialProjects={projects} />;
|
||||
}
|
||||
+352
@@ -0,0 +1,352 @@
|
||||
"use server";
|
||||
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { verifyPassword, signToken, verifyToken } from "@/lib/auth";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
// ── PROJECTS ACTIONS ──
|
||||
|
||||
export async function getProjects() {
|
||||
try {
|
||||
return await prisma.project.findMany({
|
||||
orderBy: { num: "asc" },
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Error fetching projects:", error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
export async function saveProject(data: any) {
|
||||
try {
|
||||
const { id, num, slug, title, tag, desc, spec, year, client, duration, tech, challenge, solution, results, image, gallery, website } = data;
|
||||
|
||||
let project;
|
||||
if (id) {
|
||||
// Update
|
||||
project = await prisma.project.update({
|
||||
where: { id: Number(id) },
|
||||
data: {
|
||||
num,
|
||||
slug,
|
||||
title,
|
||||
tag,
|
||||
desc,
|
||||
spec,
|
||||
year,
|
||||
client,
|
||||
duration,
|
||||
tech,
|
||||
challenge,
|
||||
solution,
|
||||
results,
|
||||
image: image || "",
|
||||
gallery: gallery || [],
|
||||
website: website || "",
|
||||
},
|
||||
});
|
||||
} else {
|
||||
// Create
|
||||
// Ensure slug is unique
|
||||
const existing = await prisma.project.findFirst({ where: { slug } });
|
||||
if (existing) {
|
||||
throw new Error("A project with this slug already exists.");
|
||||
}
|
||||
|
||||
project = await prisma.project.create({
|
||||
data: {
|
||||
num,
|
||||
slug,
|
||||
title,
|
||||
tag,
|
||||
desc,
|
||||
spec,
|
||||
year,
|
||||
client,
|
||||
duration,
|
||||
tech,
|
||||
challenge,
|
||||
solution,
|
||||
results,
|
||||
image: image || "",
|
||||
gallery: gallery || [],
|
||||
website: website || "",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
revalidatePath("/[lang]/work", "layout");
|
||||
revalidatePath("/[lang]/admin", "page");
|
||||
return { success: true, project };
|
||||
} catch (error: any) {
|
||||
console.error("Error saving project:", error);
|
||||
return { success: false, error: error.message };
|
||||
}
|
||||
}
|
||||
|
||||
export async function deleteProject(id: number) {
|
||||
try {
|
||||
await prisma.project.delete({
|
||||
where: { id },
|
||||
});
|
||||
revalidatePath("/[lang]/work", "layout");
|
||||
revalidatePath("/[lang]/admin", "page");
|
||||
return { success: true };
|
||||
} catch (error: any) {
|
||||
console.error("Error deleting project:", error);
|
||||
return { success: false, error: error.message };
|
||||
}
|
||||
}
|
||||
|
||||
// ── BLOG POSTS ACTIONS ──
|
||||
|
||||
export async function getBlogPosts() {
|
||||
try {
|
||||
const posts = await prisma.blogPost.findMany({
|
||||
orderBy: { date: "desc" },
|
||||
});
|
||||
return posts;
|
||||
} catch (error) {
|
||||
console.error("Error fetching blog posts:", error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
export async function saveBlogPost(data: any) {
|
||||
try {
|
||||
const {
|
||||
id,
|
||||
slug,
|
||||
date,
|
||||
author,
|
||||
authorRole,
|
||||
image,
|
||||
trTitle,
|
||||
trExcerpt,
|
||||
trReadingTime,
|
||||
trCategory,
|
||||
trTags,
|
||||
trContent,
|
||||
enTitle,
|
||||
enExcerpt,
|
||||
enReadingTime,
|
||||
enCategory,
|
||||
enTags,
|
||||
enContent,
|
||||
} = data;
|
||||
|
||||
let post;
|
||||
if (id) {
|
||||
// Update
|
||||
post = await prisma.blogPost.update({
|
||||
where: { id: Number(id) },
|
||||
data: {
|
||||
slug,
|
||||
date,
|
||||
author,
|
||||
authorRole,
|
||||
image,
|
||||
trTitle,
|
||||
trExcerpt,
|
||||
trReadingTime,
|
||||
trCategory,
|
||||
trTags,
|
||||
trContent,
|
||||
enTitle,
|
||||
enExcerpt,
|
||||
enReadingTime,
|
||||
enCategory,
|
||||
enTags,
|
||||
enContent,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
// Create
|
||||
const existing = await prisma.blogPost.findFirst({ where: { slug } });
|
||||
if (existing) {
|
||||
throw new Error("A blog post with this slug already exists.");
|
||||
}
|
||||
|
||||
post = await prisma.blogPost.create({
|
||||
data: {
|
||||
slug,
|
||||
date,
|
||||
author,
|
||||
authorRole,
|
||||
image,
|
||||
trTitle,
|
||||
trExcerpt,
|
||||
trReadingTime,
|
||||
trCategory,
|
||||
trTags,
|
||||
trContent,
|
||||
enTitle,
|
||||
enExcerpt,
|
||||
enReadingTime,
|
||||
enCategory,
|
||||
enTags,
|
||||
enContent,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
revalidatePath("/[lang]/blog", "layout");
|
||||
revalidatePath("/[lang]/admin", "page");
|
||||
return { success: true, post };
|
||||
} catch (error: any) {
|
||||
console.error("Error saving blog post:", error);
|
||||
return { success: false, error: error.message };
|
||||
}
|
||||
}
|
||||
|
||||
export async function deleteBlogPost(id: number) {
|
||||
try {
|
||||
await prisma.blogPost.delete({
|
||||
where: { id },
|
||||
});
|
||||
revalidatePath("/[lang]/blog", "layout");
|
||||
revalidatePath("/[lang]/admin", "page");
|
||||
return { success: true };
|
||||
} catch (error: any) {
|
||||
console.error("Error deleting blog post:", error);
|
||||
return { success: false, error: error.message };
|
||||
}
|
||||
}
|
||||
|
||||
// ── PARTNERS ACTIONS ──
|
||||
|
||||
export async function getPartners() {
|
||||
try {
|
||||
return await prisma.partner.findMany({
|
||||
orderBy: { id: "asc" },
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Error fetching partners:", error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
export async function savePartner(data: any) {
|
||||
try {
|
||||
const { id, name, tag, mono, year, desc } = data;
|
||||
|
||||
let partner;
|
||||
if (id) {
|
||||
// Update
|
||||
partner = await prisma.partner.update({
|
||||
where: { id: Number(id) },
|
||||
data: {
|
||||
name,
|
||||
tag,
|
||||
mono,
|
||||
year,
|
||||
desc,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
// Create
|
||||
// Ensure name is unique
|
||||
const existing = await prisma.partner.findFirst({ where: { name } });
|
||||
if (existing) {
|
||||
throw new Error("Bu isimde bir partner zaten mevcut.");
|
||||
}
|
||||
|
||||
partner = await prisma.partner.create({
|
||||
data: {
|
||||
name,
|
||||
tag,
|
||||
mono,
|
||||
year,
|
||||
desc,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
revalidatePath("/[lang]/partners", "layout");
|
||||
revalidatePath("/[lang]/admin", "page");
|
||||
return { success: true, partner };
|
||||
} catch (error: any) {
|
||||
console.error("Error saving partner:", error);
|
||||
return { success: false, error: error.message };
|
||||
}
|
||||
}
|
||||
|
||||
export async function deletePartner(id: number) {
|
||||
try {
|
||||
await prisma.partner.delete({
|
||||
where: { id },
|
||||
});
|
||||
revalidatePath("/[lang]/partners", "layout");
|
||||
revalidatePath("/[lang]/admin", "page");
|
||||
return { success: true };
|
||||
} catch (error: any) {
|
||||
console.error("Error deleting partner:", error);
|
||||
return { success: false, error: error.message };
|
||||
}
|
||||
}
|
||||
|
||||
// ── AUTHENTICATION ACTIONS ──
|
||||
|
||||
const COOKIE_NAME = "ayris_session";
|
||||
|
||||
export async function getAdminSession() {
|
||||
try {
|
||||
const cookieStore = await cookies();
|
||||
const token = cookieStore.get(COOKIE_NAME)?.value;
|
||||
if (!token) return null;
|
||||
return verifyToken(token);
|
||||
} catch (error) {
|
||||
console.error("Error reading admin session:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export async function adminLoginAction(data: any) {
|
||||
try {
|
||||
const { username, password } = data;
|
||||
if (!username || !password) {
|
||||
return { success: false, error: "Kullanıcı adı ve şifre zorunludur!" };
|
||||
}
|
||||
|
||||
const user = await prisma.user.findUnique({
|
||||
where: { username },
|
||||
});
|
||||
|
||||
if (!user) {
|
||||
return { success: false, error: "Geçersiz kullanıcı adı veya şifre!" };
|
||||
}
|
||||
|
||||
const isValid = verifyPassword(password, user.password);
|
||||
if (!isValid) {
|
||||
return { success: false, error: "Geçersiz kullanıcı adı veya şifre!" };
|
||||
}
|
||||
|
||||
const token = signToken({ userId: user.id, username: user.username });
|
||||
|
||||
const cookieStore = await cookies();
|
||||
cookieStore.set(COOKIE_NAME, token, {
|
||||
httpOnly: true,
|
||||
secure: process.env.NODE_ENV === "production",
|
||||
sameSite: "strict",
|
||||
maxAge: 24 * 60 * 60, // 24 hours
|
||||
path: "/",
|
||||
});
|
||||
|
||||
return { success: true };
|
||||
} catch (error: any) {
|
||||
console.error("Login action error:", error);
|
||||
return { success: false, error: "Giriş yapılırken beklenmedik bir hata oluştu!" };
|
||||
}
|
||||
}
|
||||
|
||||
export async function adminLogoutAction() {
|
||||
try {
|
||||
const cookieStore = await cookies();
|
||||
cookieStore.delete(COOKIE_NAME);
|
||||
return { success: true };
|
||||
} catch (error: any) {
|
||||
console.error("Logout action error:", error);
|
||||
return { success: false, error: "Çıkış yapılırken bir hata oluştu!" };
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
+145
@@ -0,0 +1,145 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
@theme {
|
||||
--font-display: var(--font-archivo), sans-serif;
|
||||
--font-body: var(--font-space-grotesk), sans-serif;
|
||||
--font-mono: var(--font-ibm-plex-mono), monospace;
|
||||
}
|
||||
|
||||
/* ── RESET & BASE ── */
|
||||
*, *::before, *::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
scroll-padding-top: 80px;
|
||||
background: #F4F0E8;
|
||||
}
|
||||
|
||||
body {
|
||||
background: #F4F0E8;
|
||||
color: #0A0A0A;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background-color: #FFE600;
|
||||
color: #0A0A0A;
|
||||
}
|
||||
|
||||
/* ── SCROLLBAR ── */
|
||||
::-webkit-scrollbar { width: 4px; }
|
||||
::-webkit-scrollbar-track { background: #F4F0E8; }
|
||||
::-webkit-scrollbar-thumb { background: #0A0A0A; border-radius: 0; }
|
||||
::-webkit-scrollbar-thumb:hover { background: #FF4500; }
|
||||
|
||||
/* ── NOISE OVERLAY ── */
|
||||
.noise-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
pointer-events: none;
|
||||
z-index: 9999;
|
||||
opacity: 0.03;
|
||||
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
|
||||
background-repeat: repeat;
|
||||
background-size: 150px 150px;
|
||||
}
|
||||
|
||||
/* ── STROKE TEXT ── */
|
||||
.text-stroke {
|
||||
-webkit-text-stroke: 2px #0A0A0A;
|
||||
color: transparent;
|
||||
}
|
||||
.text-stroke-yellow {
|
||||
-webkit-text-stroke: 2px #FFE600;
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
/* ── MARQUEE ── */
|
||||
.marquee-wrapper {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
}
|
||||
.marquee-track {
|
||||
display: flex;
|
||||
animation: marqueeScroll 18s linear infinite;
|
||||
}
|
||||
.marquee-track-reverse {
|
||||
display: flex;
|
||||
animation: marqueeScrollReverse 22s linear infinite;
|
||||
}
|
||||
@keyframes marqueeScroll {
|
||||
from { transform: translateX(0); }
|
||||
to { transform: translateX(-50%); }
|
||||
}
|
||||
@keyframes marqueeScrollReverse {
|
||||
from { transform: translateX(-50%); }
|
||||
to { transform: translateX(0); }
|
||||
}
|
||||
|
||||
/* ── DOT GRID ── */
|
||||
.dot-grid {
|
||||
background-image: radial-gradient(#C8C2B8 1px, transparent 1px);
|
||||
background-size: 24px 24px;
|
||||
}
|
||||
|
||||
/* ── YELLOW STRIKE ── */
|
||||
.yellow-strike {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
.yellow-strike::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 4px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 6px;
|
||||
background: #FFE600;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
/* ── BRUTAL BUTTON ── */
|
||||
.btn-brutal {
|
||||
position: relative;
|
||||
border: 2px solid #0A0A0A;
|
||||
transition: transform 0.1s ease, box-shadow 0.1s ease;
|
||||
background: transparent;
|
||||
color: #0A0A0A;
|
||||
}
|
||||
.btn-brutal::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -5px;
|
||||
right: -5px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 2px solid #0A0A0A;
|
||||
z-index: -1;
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
.btn-brutal:hover {
|
||||
transform: translate(-3px, -3px);
|
||||
box-shadow: 6px 6px 0 #FFE600;
|
||||
}
|
||||
.btn-brutal:hover::after {
|
||||
transform: translate(3px, 3px);
|
||||
}
|
||||
.btn-brutal:active {
|
||||
transform: translate(0, 0);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.btn-brutal-yellow {
|
||||
background: #FFE600;
|
||||
color: #0A0A0A;
|
||||
border: 2px solid #0A0A0A;
|
||||
}
|
||||
.btn-brutal-yellow::after {
|
||||
border-color: #0A0A0A;
|
||||
}
|
||||
.btn-brutal-yellow:hover {
|
||||
box-shadow: 6px 6px 0 #FF4500;
|
||||
}
|
||||
Reference in New Issue
Block a user