feat: Wabenhain Honig-Shop Anwendung

Vollstaendige Next.js/Prisma-E-Commerce-Anwendung fuer eine Imkerei:
Shop, Warenkorb, Stripe-Checkout, Kundenkonto mit 2FA, Admin-Bereich
(Produkte, Ernten, Chargen, Bestellungen, Gutscheine, admin-editierbare
Website-Inhalte), i18n (DE/EN), Rate-Limiting/CSP/Audit-Log-Haertung,
PostgreSQL- und MySQL-Unterstuetzung ueber austauschbare Prisma-
Treiber-Adapter, Unit-/Komponenten-/E2E-Tests.
This commit is contained in:
Nick Szaunig committed 2026-08-17 14:30:28 +02:00
1 parent 5c76fcc266
commit c7927f2883
240 files changed
+26096 -137

No files matched your search

+63
View File
@@ -0,0 +1,63 @@
import type { Metadata } from "next";
import Link from "next/link";
import { Container, SectionHeading } from "@/components/ui";
import { PlaceholderImage } from "@/components/placeholder-image";
import { getHarvests } from "@/lib/data";
import { formatMonthYear } from "@/lib/format";
import { getLocale } from "@/i18n/locale";
import { getDictionary } from "@/i18n/get-dictionary";
export const metadata: Metadata = {
title: "Unsere Ernten",
description: "Alle bisherigen Wabenhain-Ernten im Überblick — jede mit eigenem Charakter.",
alternates: { canonical: "/ernten" },
};
// Siehe Begruendung in app/page.tsx.
export const dynamic = "force-dynamic";
export default async function ErntenPage() {
const t = getDictionary(await getLocale());
const harvests = await getHarvests();
const byYear = harvests.reduce<Record<number, typeof harvests>>((acc, h) => {
acc[h.year] = [...(acc[h.year] ?? []), h];
return acc;
}, {});
const years = Object.keys(byYear).map(Number).sort((a, b) => b - a);
return (
<div className="py-20">
<Container>
<SectionHeading level="h1" eyebrow={t.erntenPage.eyebrow} title={t.erntenPage.title} />
<div className="mt-16 space-y-16">
{years.map((year) => (
<div key={year}>
<h2 className="text-2xl text-forest mb-6">{year}</h2>
<div className="grid sm:grid-cols-2 lg:grid-cols-3 gap-8">
{byYear[year].map((harvest) => (
<Link
key={harvest.id}
href={`/ernten/${harvest.year}/${encodeURIComponent(harvest.type)}`}
className="group"
>
<PlaceholderImage
tone="forest"
className="aspect-[4/3] w-full transition-transform duration-500 group-hover:scale-[1.02]"
label={formatMonthYear(harvest.harvestDate)}
/>
<h3 className="mt-4 text-lg text-forest">{harvest.type}</h3>
<p className="text-sm text-ink/65">{t.erntenPage.batchCount(harvest.batches.length)}</p>
</Link>
))}
</div>
</div>
))}
{years.length === 0 ? (
<p className="text-ink/70">{t.erntenPage.emptyText}</p>
) : null}
</div>
</Container>
</div>
);
}