commit 6c784e8a30cccc5acd431e247f5fd0c5b1a30b75 Author: Claude Date: Mon Oct 19 13:11:20 2026 +0000 Sanamare Shop: Grundgerüst, Storefront, Kasse, Zahlungen, Admin-Anfang Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01SvuGvHpbAQ4syfuLuRvutL diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..1c848cb --- /dev/null +++ b/.env.example @@ -0,0 +1,9 @@ +# Datenbank +DATABASE_URL="postgresql://sanamare:CHANGE_ME@db:5432/sanamare" +# Öffentliche Adresse des Shops (für Zahlungs-Rückleitungen) +APP_URL="https://sanamare.maaxxs-coding.de" +# Ordner für hochgeladene Bilder +UPLOAD_DIR="/app/uploads" +# Erster Inhaber-Zugang (nur beim ersten Seed) +ADMIN_EMAIL="admin@sanamare.de" +ADMIN_PASSWORD="CHANGE_ME" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..845d30c --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +node_modules +.next +.env +uploads/* +!uploads/.gitkeep +*.tsbuildinfo +next-env.d.ts diff --git a/design/README.md b/design/README.md new file mode 100644 index 0000000..790dcd0 --- /dev/null +++ b/design/README.md @@ -0,0 +1,61 @@ +Sanamare ist ein Online-Shop rund um Pilates – ruhig, edel, präzise. Das Logo gibt die Richtung vor: eine goldene Linie auf Schwarz, eine Figur in der Hundred-Position, Lotusblätter, ein Schriftzug mit viel Luft. Der Shop übersetzt das in **Elfenbein, Schwarz und Gold**, eine Serif für Überschriften und eine geometrische Sans für alles Bedienbare. + +Die Reihenfolge der Prioritäten ist festgelegt: **1. Bedienbarkeit, 2. Klarheit, 3. Eleganz.** Wo Eleganz die Bedienung verschlechtern würde (hellgraue Schrift, winzige Buttons, Versalien im Fließtext, Icons ohne Beschriftung), gewinnt die Bedienung. + +## Inhalt & Tonalität + +- Sprache: Deutsch, **Du-Form**, kurze Sätze, ruhiger Ton. Keine Ausrufezeichen, keine Dringlichkeit („Nur noch heute!“), kein Emoji. +- Beispiele im Ton der Marke: „Bewegung, die bleibt.“ · „Dein Studio für zu Hause.“ · „Kostenloser Versand ab 80 €.“ · „Du kannst innerhalb von 30 Tagen zurückgeben.“ +- Überschriften in Satzschreibweise („Neu im Studio“), nie in Versalien. Versalien gibt es nur in `eyebrow`, `nav`, `button` und `wordmark` – dort mit der Sperrung des Stils. +- Buttons nennen die Handlung: „In den Warenkorb“, „Zur Kasse“, „Adresse speichern“. Nie „OK“, „Absenden“, „Weiter“ ohne Kontext. +- Preise im deutschen Format: `129,00 €` (Komma, Leerzeichen, nachgestelltes €), immer mit `inkl. MwSt.`-Hinweis in `caption`. Streichpreise: `` in `ink-muted`, der neue Preis in `ink`, nie in Rot. +- Produktnamen: Produkt – Variante („Reformer Matte Pro – Anthrazit“). Der Marken-Schriftzug schreibt sich immer `SANAMARE.` mit Punkt. +- Fehlermeldungen sagen, was zu tun ist: „Bitte gib eine gültige E-Mail-Adresse ein.“ statt „Ungültige Eingabe“. + +## Farbe + +Zwei Themes in `tokens.json`: **Hell** (Standard für Shop, Warenkorb, Checkout, Konto) und **Dunkel** (Hero, Kampagnenflächen, Dark-Mode). Das Theme ist ein `data-theme`-Attribut auf dem Wurzelelement oder einem Abschnitt – ein dunkler Hero liegt als `
` auf einer hellen Seite. + +- Grund: `surface` (Seite), `surface-raised` (Karten, Felder, Menüs), `surface-sunken` (Footer, Bestellübersicht, Bildplatzhalter). Nie reines Weiß als Seitenhintergrund. +- Text: `ink` für alles Wichtige, `ink-muted` für Nebenzeilen, `ink-subtle` nur für Platzhalter und Deaktiviertes. Jede dieser Farben ist auf allen drei Surfaces lesbar (`ink-subtle` mit 3:1 – deshalb nie für Fließtext). +- Gold in zwei Tönen: `gold` ist **Schmuck** (Zierlinie unter Überschriften, Ornament-Punkt, Sterne, Hover-Linie in der Navigation), `gold-deep` ist **Gold mit Bedeutung** (Links, Eyebrow, aktive Navigation, Fokusring, Hinweise). Im hellen Theme ist `gold` nur 2.2:1 auf dem Grund – als Text verboten. +- Primäre Handlung ist `noir` mit `on-noir`: schwarz im hellen, elfenbein im dunklen Theme. Gold als Button-Fläche nur für den einen Akzent-Button pro Seite (Newsletter, Kampagne) mit `on-gold`. +- Status trägt immer Wort oder Icon: `success` („Auf Lager“), `danger` („Ausverkauft“, Fehler), jeweils mit `-soft`-Grund. Es gibt keinen Warnton – „Nur noch 2 Stück“ steht in `gold-deep` auf `gold-soft`. +- `overlay` hinter Dialogen, Off-Canvas-Warenkorb und Mobilmenü. + +## Typografie + +- `serif` (Cormorant Garamond) nur für die `Display`-Gruppe und `quote`. `sans` (Jost) für alles andere – jede Zeile, die jemand liest, um etwas zu tun, steht in Jost. +- Hierarchie einer Shop-Seite: `eyebrow` (gold-deep) → `display-lg` (Titel) → `body` (Beschreibung). Abschnitte der Startseite: `display-md`, Karten: `title`. +- Formularfelder und ihre Werte in `body` (16px): kleiner löst auf iOS den Auto-Zoom aus. Labels in `label`, Hilfe- und Fehlertexte in `caption`. +- Beide Schriften sind Google-Fonts (SIL Open Font License). **Im Shop selbst hosten** (Dateien von fonts.google.com oder dem npm-Paket `@fontsource/jost` bzw. `@fontsource/cormorant-garamond` unter `fonts/` ablegen und in `tokens.json` `type.fonts` eintragen) – ein Laden von Google-Servern ist in Deutschland ein DSGVO-Risiko. Die Vorschauen hier laden sie zur Ansicht von Google. +- Ziffern in Preisen und Tabellen: `font-variant-numeric: tabular-nums`. + +## Abstand, Radien, Linien, Schatten + +- 4er-Raster (`space-1` … `space-10`). Innerhalb von Komponenten `space-2`–`space-4`, Produktraster `space-5`, Abschnitte `space-8` (mobil) / `space-9` (Desktop). +- Fast eckig: `radius-sm` (2px) für Buttons, Felder, Badges; `radius-md` (6px) für Karten und Bilder; `radius-pill` nur für Chips, Stepper und Zähler. Keine anderen Radien. +- Linien statt Schatten: Karten, Tabellen und Felder trennen sich mit einer `hairline` in `line`. Rahmen mit Bedeutung (Feld, Sekundär-Button, Auswahl) in `line-strong`. Schatten nur für Schwebendes (`shadow-md` Dropdown, `shadow-lg` Dialog) und beim Hover einer Karte (`shadow-sm`). +- Goldene Zierlinie: 1px `gold`, 48px breit, zentriert unter einer `display-md`-Überschrift, `space-4` Abstand – das Motiv aus dem Logo (Linie, Punkt, Linie). Höchstens einmal pro Abschnitt. + +## Layout & Bedienung + +- Mobile first, Breakpoints in `tokens.json` (`bp-sm` … `bp-xl`). Container `container-max` (1280px), Fließtext `container-text` (720px). +- Produktraster: 2 / 3 / 4 Spalten, alle Bilder `product-image-ratio` (4:5), Abstand `space-5`. +- Jedes Control ist `control-height` (48px) hoch, Klickziele mindestens `touch-target` (44px). „In den Warenkorb“ und „Zur Kasse“ sind `control-height-lg` (56px) und auf Mobilgeräten vollbreit und am unteren Rand fixiert. +- Der Header ist sticky, `header-height` (72px), mit Logo links, Navigation mittig, Suche / Konto / Warenkorb rechts. Der Warenkorb zeigt die Stückzahl als Zähler. Unter `bp-lg` wird die Navigation zum Burger-Menü, Suche und Warenkorb bleiben sichtbar. +- Checkout ist linear: Adresse → Versand → Zahlung → Prüfen. Ein Schritt pro Seite, Fortschritt oben (`CheckoutSteps`), Bestellübersicht rechts (Desktop) oder einklappbar oben (mobil). Gastbestellung immer möglich. +- Formulare: ein Feld pro Zeile, Label über dem Feld, Fehler unter dem Feld in `danger` mit Icon, Autofill-Attribute gesetzt (`autocomplete="given-name"` …). Pflichtfelder sind die Regel – optionale Felder tragen „(optional)“ im Label. +- Fokus ist immer sichtbar: 2px Abstand im Grund, dann 2px `focus-ring`. Hover auf Karten: Bild wird leicht größer (1.03, 400ms), Titel bleibt. Keine Animation länger als 400ms; `prefers-reduced-motion` schaltet sie ab. +- Bilder: Produktfotos freigestellt auf `surface-sunken` oder auf warmem Studio-Hintergrund; Lifestyle-Bilder in gedämpften, warmen Tönen. Kein Stock-Lächeln, keine Stock-Fitness-Posen. + +## Logo & Iconografie + +- Das Original ist `assets/Logos/sanamare-logo-gold-auf-schwarz.png` (Gold auf Schwarz). Daraus abgeleitet, ohne eine Linie zu verändern: `sanamare-logo-gold.png` (freigestellt, für dunkle Gründe) und `sanamare-logo-ink.png` (dieselben Linien in `ink`, für helle Gründe) sowie die reine Bildmarke – Figur, Kreis, Lotus – als `sanamare-bildmarke-gold.png` und `sanamare-bildmarke-ink.png`. +- Wo das Logo steht: **Header** – Bildmarke 44px hoch neben dem Schriftzug im `wordmark`-Stil (Ink im hellen, Gold im dunklen Theme; die Bildmarke bleibt auch mobil, der Schriftzug fällt unter `bp-sm` weg). **Hero und Footer** (beide dunkel) – das vollständige Logo in Gold, 160–420px breit. Nie das goldene Logo auf Elfenbein (2.2:1 – die feinen Linien verschwinden), nie das Original mit schwarzem Quadrat in eine helle Fläche setzen. +- Freiraum mindestens `space-6`, Mindestbreite 120px für das vollständige Logo, 32px für die Bildmarke. Nicht verzerren, nicht drehen, keine Schatten. Siehe `assets/Logos/README.md`; eine Vektorversion (SVG) fehlt noch. +- Icons: dünne Linien-Icons, 1.5px Strich, 24px Raster, `currentColor` (z. B. Lucide, ISC-Lizenz). Jedes Icon-Only-Control hat ein `aria-label`; neben Text steht das Icon links mit `space-2` Abstand. Keine Emoji. + +## Komponenten + +`components/bundle.css` ist reines CSS auf den Tokens – kein Framework, kein JavaScript. Jede Komponente hat eine Vorschau und eine Anleitung unter `components//`. Die Klassen tragen das Präfix `sm-`. Die Seiten `Startseite`, `Produktseite` und `Warenkorb` zeigen, wie die Komponenten zusammen wirken. diff --git a/design/tokens.json b/design/tokens.json new file mode 100644 index 0000000..b87f176 --- /dev/null +++ b/design/tokens.json @@ -0,0 +1,127 @@ +{ + "name": "Sanamare", + "version": 1, + "color": { + "note": "Zwei Themes: „Hell“ ist der Standard im Shop (Elfenbein-Grund, schwarze Schrift, Gold als Akzent). „Dunkel“ ist der Look des Logos – für Hero-Flächen, Kampagnen und den Dark-Mode. Jede Textfarbe nennt die Gründe, auf denen sie lesbar ist.", + "themes": [ + { "id": "light", "name": "Hell" }, + { "id": "dark", "name": "Dunkel" } + ], + "tokens": [ + { "name": "surface", "value": { "light": "#f7f4ee", "dark": "#0d0d0f" }, "usage": "Seitenhintergrund. Warmes Elfenbein, nie reines Weiß – reines Weiß ist für surface-raised reserviert." }, + { "name": "surface-raised", "value": { "light": "#ffffff", "dark": "#17171a" }, "usage": "Karten, Produktkacheln, Menüs, Dialoge, Eingabefelder – alles, was über dem Seitenhintergrund liegt." }, + { "name": "surface-sunken", "value": { "light": "#efeadf", "dark": "#070708" }, "usage": "Zurückgesetzte Flächen: Bestellübersicht im Checkout, Footer, Bildplatzhalter, Zebrazeilen." }, + { "name": "line", "value": { "light": "#e2dbcd", "dark": "#2a2926" }, "usage": "Haarlinien und Trenner, ruhende Kartenränder, Tabellenlinien. Trägt keine Bedeutung – dafür line-strong." }, + { "name": "line-strong", "value": { "light": "#8c8270", "dark": "#6d6960" }, "usage": "Rahmen, die etwas bedeuten: Eingabefelder, Sekundär-Buttons, Auswahlrahmen (≥ 3:1 auf surface und surface-raised)." }, + { "name": "ink", "value": { "light": "#161411", "dark": "#f2ede3" }, "usage": "Primärtext und Überschriften auf surface, surface-raised, surface-sunken und gold-soft." }, + { "name": "ink-muted", "value": { "light": "#5d574d", "dark": "#b1a999" }, "usage": "Sekundärtext: Beschreibungen, Metadaten, Hilfetexte – auf allen drei Surfaces und gold-soft (≥ 4.5:1)." }, + { "name": "ink-subtle", "value": { "light": "#7d766b", "dark": "#8a8275" }, "usage": "Nur Platzhalter in Feldern und deaktivierter Text (≥ 3:1). Nie für Fließtext oder Preise." }, + { "name": "gold", "value": { "light": "#c6a24c", "dark": "#d4ae5e" }, "usage": "Das Gold des Logos – als Schmuck: Zierlinien, Ornament-Punkt, Sternbewertung, Hover-Linie, große Display-Ziffern. Im hellen Theme nur 2.2:1 auf surface, deshalb dort nie als Text oder bedeutungstragender Rahmen – dafür gold-deep." }, + { "name": "gold-deep", "value": { "light": "#7a5e1a", "dark": "#e4c47c" }, "usage": "Gold als Text und Interaktion: Links, Eyebrow-Zeilen, Preis-Hinweise, aktive Navigation, Fokusring, Icons mit Bedeutung – auf surface, surface-raised und gold-soft (≥ 4.5:1)." }, + { "name": "gold-soft", "value": { "light": "#f4ebd3", "dark": "#2a2211" }, "usage": "Getönter Grund hinter gold-deep-Text: Hinweisbalken, Badge „Neu“, ausgewählte Filterchips, Rabatt-Hinweis im Warenkorb." }, + { "name": "on-gold", "value": { "light": "#161411", "dark": "#161411" }, "usage": "Text und Icons auf einer gold-Fläche (Badge „Bestseller“, goldener Akzent-Button). Immer dunkel, nie weiß." }, + { "name": "noir", "value": { "light": "#161411", "dark": "#f2ede3" }, "usage": "Füllung des Primär-Buttons („In den Warenkorb“, „Zur Kasse“) und aktiver Schritte. Hell: schwarz, dunkel: elfenbein – immer der stärkste Kontrast zum Grund." }, + { "name": "on-noir", "value": { "light": "#f7f4ee", "dark": "#0d0d0f" }, "usage": "Label und Icon auf einer noir-Fläche." }, + { "name": "success", "value": { "light": "#1e6a5c", "dark": "#7fd3c0" }, "usage": "„Auf Lager“, „Bestellung eingegangen“, gültiger Gutschein – als Text auf surface, surface-raised und success-soft. Bewusst blaugrün statt reingrün, damit es sich von danger auch ohne Farbsehen unterscheidet; immer mit Wort oder Icon." }, + { "name": "success-soft", "value": { "light": "#e0f1ec", "dark": "#11292a" }, "usage": "Getönter Grund hinter success-Text (Erfolgsmeldung, Lager-Badge)." }, + { "name": "danger", "value": { "light": "#a8322b", "dark": "#f29a92" }, "usage": "Fehler in Formularen, „Ausverkauft“, „Entfernen“-Bestätigung – als Text auf surface, surface-raised und danger-soft. Immer mit Wort oder Icon." }, + { "name": "danger-soft", "value": { "light": "#f9e4e2", "dark": "#3a1715" }, "usage": "Getönter Grund hinter danger-Text (Fehlermeldung, Fehlerfeld)." }, + { "name": "link", "value": "{gold-deep}", "usage": "Textlinks – Alias von gold-deep, damit ein Theme, das das Gold verschiebt, auch die Links verschiebt." }, + { "name": "focus-ring", "value": "{gold-deep}", "usage": "Tastaturfokus: 2px Abstand im Grund, dann 2px solider Ring in dieser Farbe (≥ 3:1 auf allen Surfaces). Nie outline:none ohne Ersatz." }, + { "name": "overlay", "value": { "light": "#161411a6", "dark": "#000000b3" }, "usage": "Abdunkelung hinter Dialogen, Off-Canvas-Warenkorb und Mobilmenü." } + ] + }, + "type": { + "fonts": [], + "families": { + "serif": "\"Cormorant Garamond\", Cormorant, Georgia, \"Times New Roman\", serif", + "sans": "Jost, Futura, \"Avenir Next\", \"Century Gothic\", \"Segoe UI\", system-ui, sans-serif" + }, + "groups": [ + { + "name": "Display", + "family": "serif", + "styles": [ + { "name": "display-xl", "fontSize": "64px", "lineHeight": "1.0", "fontWeight": 500, "letterSpacing": "-0.01em", "sample": "Bewegung, die bleibt.", "usage": "Hero-Headline der Startseite, eine Zeile, maximal zwei. Mobil auf display-lg reduzieren." }, + { "name": "display-lg", "fontSize": "44px", "lineHeight": "1.05", "fontWeight": 500, "letterSpacing": "-0.005em", "sample": "Die Reformer-Kollektion", "usage": "Seitentitel (Kategorie, Produktname auf der Produktseite), Kampagnen-Teaser." }, + { "name": "display-md", "fontSize": "32px", "lineHeight": "1.15", "fontWeight": 500, "sample": "Neu im Studio", "usage": "Abschnittsüberschriften auf der Startseite, Titel von Dialogen und Checkout-Schritten." }, + { "name": "display-sm", "fontSize": "24px", "lineHeight": "1.2", "fontWeight": 500, "sample": "Zusammenfassung", "usage": "Unterabschnitte, Boxentitel (Bestellübersicht), Akkordeon-Titel auf der Produktseite." }, + { "name": "quote", "fontSize": "26px", "lineHeight": "1.3", "fontWeight": 400, "fontStyle": "italic", "sample": "„Nach zehn Stunden spürst du den Unterschied.“ – Joseph Pilates", "usage": "Zitate und Kundenstimmen, nie für UI-Text." } + ] + }, + { + "name": "Text", + "family": "sans", + "styles": [ + { "name": "title", "fontSize": "18px", "lineHeight": "26px", "fontWeight": 500, "sample": "Reformer Matte Pro – Anthrazit", "usage": "Produktname auf Karten und im Warenkorb, Titel in Listen." }, + { "name": "body", "fontSize": "16px", "lineHeight": "26px", "fontWeight": 400, "sample": "Griffige Oberfläche, 8 mm stark, aus recyceltem Naturkautschuk. Rutschfest auf jedem Boden.", "usage": "Fließtext, Produktbeschreibungen, Formularwerte. Nie unter 16px auf Mobilgeräten (verhindert Auto-Zoom in Feldern)." }, + { "name": "body-sm", "fontSize": "14px", "lineHeight": "22px", "fontWeight": 400, "sample": "Kostenloser Versand ab 80 €, Lieferung in 2–4 Werktagen.", "usage": "Sekundärzeilen: Versandhinweise, Produktvarianten, Tabellenzellen, Footer-Links." }, + { "name": "label", "fontSize": "14px", "lineHeight": "20px", "fontWeight": 500, "sample": "E-Mail-Adresse", "usage": "Formularlabels, Tabs, Breadcrumb, Mengenanzeige." }, + { "name": "button", "fontSize": "14px", "lineHeight": "20px", "fontWeight": 500, "letterSpacing": "0.08em", "sample": "IN DEN WARENKORB", "usage": "Button-Labels, in Versalien gesetzt (text-transform: uppercase im CSS). Nie länger als vier Wörter." }, + { "name": "nav", "fontSize": "13px", "lineHeight": "20px", "fontWeight": 500, "letterSpacing": "0.14em", "sample": "SHOP KOLLEKTIONEN STUDIO JOURNAL", "usage": "Hauptnavigation und Footer-Spaltentitel, Versalien." }, + { "name": "eyebrow", "fontSize": "12px", "lineHeight": "16px", "fontWeight": 500, "letterSpacing": "0.2em", "sample": "NEUE KOLLEKTION", "usage": "Kleine Versalzeile über einer Display-Überschrift, in gold-deep. Höchstens drei Wörter." }, + { "name": "caption", "fontSize": "12px", "lineHeight": "16px", "fontWeight": 400, "sample": "Art.-Nr. SM-2041 · inkl. MwSt., zzgl. Versand", "usage": "Metadaten, rechtliche Hinweise, Hilfetexte unter Feldern, Badge-Text – in ink-muted." }, + { "name": "price", "fontSize": "18px", "lineHeight": "24px", "fontWeight": 500, "sample": "129,00 €", "usage": "Preise auf Karten und im Warenkorb. Tabellenziffern (font-variant-numeric: tabular-nums), deutsches Format mit Komma und nachgestelltem €." }, + { "name": "price-lg", "fontSize": "28px", "lineHeight": "32px", "fontWeight": 500, "sample": "129,00 €", "usage": "Preis auf der Produktseite und Gesamtsumme im Warenkorb." }, + { "name": "wordmark", "fontSize": "22px", "lineHeight": "28px", "fontWeight": 400, "letterSpacing": "0.32em", "sample": "SANAMARE.", "usage": "Der Schriftzug als Text, wo das Logo-Bild nicht passt (Header im hellen Theme, E-Mails, Footer). Immer mit Punkt, immer Versalien." } + ] + } + ] + }, + "spacing": { + "note": "4er-Raster. Innerhalb einer Komponente 1–4, zwischen Komponenten 5–6, zwischen Abschnitten 7–10.", + "tokens": [ + { "name": "space-1", "value": "4px", "usage": "Icon zu Text, Badge-Innenabstand vertikal." }, + { "name": "space-2", "value": "8px", "usage": "Zwischen Label und Feld, Chip-Innenabstand, Abstand zwischen Sternen." }, + { "name": "space-3", "value": "12px", "usage": "Innenabstand in Chips und kleinen Buttons, Zeilen in Listen." }, + { "name": "space-4", "value": "16px", "usage": "Innenabstand von Feldern und Karten (mobil), Abstand Titel zu Preis, Seitenrand mobil." }, + { "name": "space-5", "value": "24px", "usage": "Kartenabstand im Produktraster, Innenabstand Karten (Desktop), Seitenrand Tablet." }, + { "name": "space-6", "value": "32px", "usage": "Abstand zwischen Formulargruppen, Innenabstand der Bestellübersicht, Seitenrand Desktop." }, + { "name": "space-7", "value": "48px", "usage": "Abstand zwischen Überschrift und Inhalt eines Abschnitts, Footer-Innenabstand." }, + { "name": "space-8", "value": "64px", "usage": "Abstand zwischen Abschnitten (mobil)." }, + { "name": "space-9", "value": "96px", "usage": "Abstand zwischen Abschnitten (Desktop)." }, + { "name": "space-10", "value": "128px", "usage": "Hero-Innenabstand oben/unten auf dem Desktop." } + ] + }, + "radius": { + "note": "Fast eckig. Edelmarken runden kaum – Weichheit kommt aus Farbe und Schrift, nicht aus Radien.", + "tokens": [ + { "name": "radius-none", "value": "0px", "usage": "Hero-Bilder, Vollbreite-Flächen, Tabellen." }, + { "name": "radius-sm", "value": "2px", "usage": "Buttons, Eingabefelder, Badges, Checkboxen." }, + { "name": "radius-md", "value": "6px", "usage": "Karten, Produktbilder im Raster, Dialoge, Dropdowns." }, + { "name": "radius-lg", "value": "12px", "usage": "Bildkacheln in Kollektions-Teasern, Off-Canvas-Panels (innere Kante)." }, + { "name": "radius-pill", "value": "999px", "usage": "Filterchips, Mengenstepper, Warenkorb-Zähler, Farbswatches." } + ] + }, + "shadow": { + "note": "Schatten sind leise. Ruhe kommt von Haarlinien (line); Schatten nur für Dinge, die wirklich schweben.", + "tokens": [ + { "name": "shadow-sm", "value": { "light": "0 1px 2px #16141114", "dark": "0 1px 2px #00000080" }, "usage": "Karten im Hover, Sticky-Header nach dem Scrollen." }, + { "name": "shadow-md", "value": { "light": "0 4px 12px #1614111a, 0 1px 2px #1614110f", "dark": "0 4px 12px #00000099, 0 1px 2px #00000080" }, "usage": "Dropdowns, Suchvorschläge, Mini-Warenkorb." }, + { "name": "shadow-lg", "value": { "light": "0 16px 48px #16141126", "dark": "0 16px 48px #000000bf" }, "usage": "Dialoge, Off-Canvas-Warenkorb, Zoom-Bild." } + ] + }, + "layout": { + "note": "Maße, die Bedienbarkeit garantieren. Kein Klickziel unter 44px, kein Formularfeld unter 48px.", + "tokens": [ + { "name": "container-max", "value": "1280px", "usage": "Maximale Inhaltsbreite, zentriert, Seitenrand space-4/5/6 je Breakpoint." }, + { "name": "container-text", "value": "720px", "usage": "Breite für Fließtext (Journal, Produktbeschreibung, AGB) – ca. 70 Zeichen pro Zeile." }, + { "name": "control-height", "value": "48px", "usage": "Höhe von Buttons, Eingabefeldern, Selects und Mengenstepper – Standard." }, + { "name": "control-height-sm", "value": "40px", "usage": "Kompakte Controls in Tabellen, Chips, Warenkorb-Zeilen." }, + { "name": "control-height-lg", "value": "56px", "usage": "„In den Warenkorb“ auf der Produktseite und „Zur Kasse“ – die wichtigsten Buttons sind die größten." }, + { "name": "touch-target", "value": "44px", "usage": "Mindestgröße jedes Klick- oder Tippziels, auch für Icon-Buttons und Checkboxen (per Padding erreichen)." }, + { "name": "header-height", "value": "72px", "usage": "Höhe des Headers auf dem Desktop; mobil 60px." }, + { "name": "product-image-ratio", "value": "4 / 5", "usage": "aspect-ratio aller Produktbilder im Raster und Warenkorb – ein Format, damit das Raster ruhig bleibt." }, + { "name": "hairline", "value": "1px", "usage": "Breite aller Linien und Rahmen. Keine 2px-Rahmen außer Fokusring und ausgewähltem Swatch." } + ] + }, + "breakpoint": { + "note": "Mobile first. Das Produktraster: 2 Spalten unter md, 3 ab md, 4 ab lg.", + "tokens": [ + { "name": "bp-sm", "value": "480px", "usage": "Große Telefone – Buttons nebeneinander statt gestapelt." }, + { "name": "bp-md", "value": "768px", "usage": "Tablet – 3 Spalten im Raster, Filter als Sidebar." }, + { "name": "bp-lg", "value": "1024px", "usage": "Desktop – 4 Spalten, Hauptnavigation sichtbar statt Burger-Menü." }, + { "name": "bp-xl", "value": "1280px", "usage": "Container erreicht seine Maximalbreite." } + ] + } +} diff --git a/next.config.ts b/next.config.ts new file mode 100644 index 0000000..8a69059 --- /dev/null +++ b/next.config.ts @@ -0,0 +1,10 @@ +import type { NextConfig } from "next"; + +const nextConfig: NextConfig = { + output: "standalone", + experimental: { + serverActions: { bodySizeLimit: "10mb" }, + }, +}; + +export default nextConfig; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..56c7ac6 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2025 @@ +{ + "name": "sanamare", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sanamare", + "version": "0.1.0", + "dependencies": { + "@fontsource/cormorant-garamond": "^5.3.0", + "@fontsource/jost": "^5.3.0", + "@prisma/client": "6.19.3", + "bcryptjs": "3.0.3", + "next": "15.5.28", + "react": "19.1.10", + "react-dom": "19.1.10", + "server-only": "^0.0.1", + "zod": "4.6.7" + }, + "devDependencies": { + "@types/node": "22.20.5", + "@types/react": "19.1.10", + "@types/react-dom": "19.1.10", + "prisma": "6.19.3", + "tsx": "^4.20.6", + "typescript": "5.9.3" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz", + "integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", + "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", + "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", + "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", + "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", + "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", + "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", + "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", + "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", + "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", + "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", + "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", + "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", + "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", + "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", + "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", + "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", + "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", + "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", + "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", + "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", + "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", + "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", + "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", + "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", + "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", + "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@fontsource/cormorant-garamond": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource/cormorant-garamond/-/cormorant-garamond-5.3.0.tgz", + "integrity": "sha512-weuGsCirGVWBWqpt6YUp0yLThTe4G8YO45noq8wxeJCRvEpq5lFrxNMFSTxcyOyV5k5otzJ8guDzYegdYlcLMQ==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, + "node_modules/@fontsource/jost": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource/jost/-/jost-5.3.0.tgz", + "integrity": "sha512-lORv5y49hSoLVxjGb0qNuBzXvnaNYI3B94200uGPGJFei8fao6d6LLz2ziWbOZubGfZnibzuT6GVNX8fBw8WQQ==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, + "node_modules/@img/colour": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", + "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.5.tgz", + "integrity": "sha512-QRUlFQ0WxvdWyqqG/WtI3iupfD5rBzmCHXSdPsY91sAtVtTo7Q4cb6zOccZ3gqEqkr0f1As1ehLqmEpDsRf+lg==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.3.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.5.tgz", + "integrity": "sha512-+BR255RhDlpygUpOc/Jdt1nT6DQ3XG/ERo5wbcdOf5Q320dKtPCKPLR1LJs9VGXRaMa8l1uUa0tkCNOXiAxZUw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.3.4" + } + }, + "node_modules/@img/sharp-freebsd-wasm32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.5.tgz", + "integrity": "sha512-Y/z91nEZ4uIBX5X3nfTovjU9lHNKFYbL2lpHCLVNmXQK03VIZvXBBt0KxbPGp2SdGSF+2mQU4e+hQaWOt86iAw==", + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "dependencies": { + "@img/sharp-wasm32": "0.35.5" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.4.tgz", + "integrity": "sha512-5R89nBYiRdUlSWJxPhO+GVtaXzXSxKnRu/xqMn3KTA3L9EB9Oy/P+Nn2f2vlhPuUdy/Zusb2DarbyTpGCfEDuw==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.4.tgz", + "integrity": "sha512-iR2OKH80yi0U+dUplyh3/xdpFvps6YkCwsXenIJxqxR1v9o+xtKTGbS9H7cps+2Vxjc8B1j96p75NmTGjIhtpQ==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.4.tgz", + "integrity": "sha512-LmRtTsOHuvM2+wlO2Db37dx5MiZhB0FvSunciw48YjdOkZz9KAiRbm8ujeMOA1INqmei5NapFxYEK1D1ZSidmw==", + "cpu": [ + "arm" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.4.tgz", + "integrity": "sha512-Y3dgX/6lE2QhQb+Gxy0WZxfg9MEm/JBjamZpS2IklP7xIQoKN4hzAm7KcMVGtaVDt3neE9OKBC7vAfonA/Lr1A==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.4.tgz", + "integrity": "sha512-Le6boB8Tai0Nis+gIxIpKx68UDVVIqdR8Tin5Yf1z2LJJQLDJvCDRqRu+jC2qCoD+eIomonmOwB4smBRxfVpYQ==", + "cpu": [ + "ppc64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.4.tgz", + "integrity": "sha512-aHkkIEHPRdQEegJN20MLmGtxYD9R2wQr3Cwpddnu5+YKMt6Uzax7S9h5gpZTo8wyrGuZSlfQ63OevL5mTyOC7Q==", + "cpu": [ + "riscv64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.4.tgz", + "integrity": "sha512-ra/mB6MikESDUO7Yg+Mi95bFBb9GsObURuhnOv3OqknjGe9sZrG8tCe9q0xSIGrtLgvgw0gKnFWcK4blSgQOuQ==", + "cpu": [ + "s390x" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.4.tgz", + "integrity": "sha512-GJ//SSXbnwSDes02umB3nDJLFcQzw8a18V8fyhqr6tV515tOEMdImjjxj1AoafMRz56F3PHgftnj1QEKSU1zkw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.4.tgz", + "integrity": "sha512-hvulFwtjUcagsis6BBxHwGFwWoNZjgYmULGVrZcyfNbjA8hKILbRxGg15/7w5HDyXHXUos/j6baAWqnCyQ2DWA==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.4.tgz", + "integrity": "sha512-6zXKeE/p39I1AmA3cJG35eyBGNqNddLnUXjhwBnsGjFPWqf5VKkDBEqaEkPDoTEtkxwi2vv8Tcr2mDyP4So7Fg==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.5.tgz", + "integrity": "sha512-LEaXK2WdXVK5ykcw0buWyPMsmLLL2vpHLD6yrNSW+JGEL3BZPA4tpKN6iaMc4AxTTAoaX/sU1rOL51lcIz48ZQ==", + "cpu": [ + "arm" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.5.tgz", + "integrity": "sha512-LYVx5JTsOM2CBzmxreh+nl64/3H6Xb09iSLknqH47z2T2DFFxDeFLP5y4dJwe6H7uGQlHPyEEtIqyo3DYsRwdQ==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.5.tgz", + "integrity": "sha512-QVxAAq8evVRI9ia2vqgwrmWucn5Dfv+JdWzj75pD8omHLPSP7f8p20O8jxzjCcuCEQEOtYOZUmX1hkiZ0kdevA==", + "cpu": [ + "ppc64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.5.tgz", + "integrity": "sha512-LtdreXguaavKODPIfzJ4kffx7UNt1omwtK0rch4EBbbSTXPnxWmYSayXdLJw0fJzQ97kHt1gL/yh4tvU+nCyRQ==", + "cpu": [ + "riscv64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-riscv64": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.5.tgz", + "integrity": "sha512-UZasTOFiYzotTsGOCu42BfUzP6Tu6Do/947iRm1RsLKvlllxwGcn4RN27LibGWceix4Y+Pmw3jsnTcCQIgWjqA==", + "cpu": [ + "s390x" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.3.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.5.tgz", + "integrity": "sha512-SxFtLTeJInhAA9Q836kux2vZNeOBQEx658qvbboZScr0wIARym3IcGmW7KpVD5sbVg0Ojy+udFQdayYIZyoNog==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.3.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.5.tgz", + "integrity": "sha512-9HbMclmI1zlNkFRs3z9/eBtDjfD0sGlrX1z6b1qwmiFY5ElDLh4BC0LPBdVp7z1DXFiKlIcznf+ZlsuZzLxQqg==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.3.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.5.tgz", + "integrity": "sha512-4KOphqB035HrVdqLZfCgMzzERrQkkzOwRhl4OAkRO1YCldbaFjySXMaK534Mo0V+LndnlJk+sbUyLeU0ULyD1A==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.3.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.5.tgz", + "integrity": "sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ==", + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.11.3" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-webcontainers-wasm32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.5.tgz", + "integrity": "sha512-hfhF/FmoQyTUkA0bIKFOtw536BQSeBMe6BF6QyWlrPxT754+TFLaZ7sKKTfvvM0yJgKgaYTwnFCIZ/GuDw5SUA==", + "cpu": [ + "wasm32" + ], + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@img/sharp-wasm32": "0.35.5" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.5.tgz", + "integrity": "sha512-X4t7g+7ZA5DKblCBEXGjUqqemj4vczING/5viFwAL8h4N3qYeyjwdCvRLHi4EdOUI+2Z7UFlp1VM+p/AuEtm6Q==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.5.tgz", + "integrity": "sha512-5Zm82LoBc43nhwNybZlG7Y1KO//Zhsn306fQl29ZOuStHLGTo3BWL83q3cznX0poxSAMuYL1On/BHBxkBeKr6A==", + "cpu": [ + "ia32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.5.tgz", + "integrity": "sha512-x76eH0vEiHlcMQu8Y8IenntaACtddpT6W0wmXtWrnKcnKI7ME5DdgqhAD6SEWOEl1v2zDvkZDhFA9KnURwpfqg==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@next/env": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/env/-/env-15.5.28.tgz", + "integrity": "sha512-xxW5EBI8fMPuVTPBW7LL980IRbuDXlbkUAwp9DDhtb4Lnich3nJ13uYpvrX4VE74hWPf6AvHHAMmGCidcHjbfg==", + "license": "MIT" + }, + "node_modules/@next/swc-darwin-arm64": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.5.28.tgz", + "integrity": "sha512-dPoQYXcfSIqx5o+TOXVXO7kONK5qbtNRDeiTfII0bT3puGIT6VF5e0QwmxNZfEZ5Zety5f3m9P/p4xqwfiLlPg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.5.28.tgz", + "integrity": "sha512-RgCJ7buBivTH+6sddqaVm+/v8kwMHlFkobvdt3DfETutws5HrxnToMIWSN9X3MZ3aAi7BbKrGZZWUDQLEycXqw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.5.28.tgz", + "integrity": "sha512-OHXQe13olE59aKe++zHavGcJPh5SLHXi6Anret3BBeq1+qhSuOJDNAli/EDDfxs6UTqA4Qddo4uyYry2slyjiQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.5.28.tgz", + "integrity": "sha512-nTB7bB6vfn4ezCJNYP43ukt2o8L3+WxKF/sTcTxepdXsJh3SM9RhlU7wrZYbH7L4HO5M87dqDTwm8587vAkCiw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.5.28.tgz", + "integrity": "sha512-WXCfVI32rW3xCusoUX1RpZKtyChWU2Zwe27JUDmM3KrXwcDNc9vV4zEq0GKFAURnuQ/Ouo/XqPvB0yh445XZCg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.5.28.tgz", + "integrity": "sha512-Miq+NDb/HWsXuxseYxMM6fuEOQXgTziarkKIRpVKCn8W69cEfhQaQr+90pO+u4q2CbJR2wzXmUuCFyZaJs/Nng==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.5.28.tgz", + "integrity": "sha512-5LR79lemgDlgxvG7MQJ+zHCkVcrUoQuO7CiIvq3I58vNW4goSOE2b+19Z6FujRWMouvni4gvudYFuFuNxolGWA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.5.28.tgz", + "integrity": "sha512-GNipvXUYROSTf4PXEyH95FrWImIB5zdaK6uEOg0RP1/X2drnvoMwiBkJ0VWdzX7w3iiBm3y5g2TxkKDGVTOQcg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@prisma/client": { + "version": "6.19.3", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-6.19.3.tgz", + "integrity": "sha512-mKq3jQFhjvko5LTJFHGilsuQs+W+T3Gm451NzuTDGQxwCzwXHYnIu2zGkRoW+Exq3Rob7yp2MfzSrdIiZVhrBg==", + "hasInstallScript": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "peerDependencies": { + "prisma": "*", + "typescript": ">=5.1.0" + }, + "peerDependenciesMeta": { + "prisma": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/@prisma/config": { + "version": "6.19.3", + "resolved": "https://registry.npmjs.org/@prisma/config/-/config-6.19.3.tgz", + "integrity": "sha512-CBPT44BjlQxEt8kiMEauji2WHTDoVBOKl7UlewXmUgBPnr/oPRZC3psci5chJnYmH0ivEIog2OU9PGWoki3DLQ==", + "devOptional": true, + "license": "Apache-2.0", + "dependencies": { + "c12": "3.1.0", + "deepmerge-ts": "7.1.5", + "effect": "3.21.0", + "empathic": "2.0.0" + } + }, + "node_modules/@prisma/debug": { + "version": "6.19.3", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-6.19.3.tgz", + "integrity": "sha512-ljkJ+SgpXNktLG0Q/n4JGYCkKf0f8oYLyjImS2I8e2q2WCfdRRtWER062ZV/ixaNP2M2VKlWXVJiGzZaUgbKZw==", + "devOptional": true, + "license": "Apache-2.0" + }, + "node_modules/@prisma/engines": { + "version": "6.19.3", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-6.19.3.tgz", + "integrity": "sha512-RSYxtlYFl5pJ8ZePgMv0lZ9IzVCOdTPOegrs2qcbAEFrBI1G33h6wyC9kjQvo0DnYEhEVY0X4LsuFHXLKQk88g==", + "devOptional": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.19.3", + "@prisma/engines-version": "7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7", + "@prisma/fetch-engine": "6.19.3", + "@prisma/get-platform": "6.19.3" + } + }, + "node_modules/@prisma/engines-version": { + "version": "7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7.tgz", + "integrity": "sha512-03bgb1VD5gvuumNf+7fVGBzfpJPjmqV423l/WxsWk2cNQ42JD0/SsFBPhN6z8iAvdHs07/7ei77SKu7aZfq8bA==", + "devOptional": true, + "license": "Apache-2.0" + }, + "node_modules/@prisma/fetch-engine": { + "version": "6.19.3", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-6.19.3.tgz", + "integrity": "sha512-tKtl/qco9Nt7LU5iKhpultD8O4vMCZcU2CHjNTnRrL1QvSUr5W/GcyFPjNL87GtRrwBc7ubXXD9xy4EvLvt8JA==", + "devOptional": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.19.3", + "@prisma/engines-version": "7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7", + "@prisma/get-platform": "6.19.3" + } + }, + "node_modules/@prisma/get-platform": { + "version": "6.19.3", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-6.19.3.tgz", + "integrity": "sha512-xFj1VcJ1N3MKooOQAGO0W5tsd0W2QzIvW7DD7c/8H14Zmp4jseeWAITm+w2LLoLrlhoHdPPh0NMZ8mfL6puoHA==", + "devOptional": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/debug": "6.19.3" + } + }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/@swc/helpers": { + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", + "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" + } + }, + "node_modules/@types/node": { + "version": "22.20.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.5.tgz", + "integrity": "sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/react": { + "version": "19.1.10", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.10.tgz", + "integrity": "sha512-EhBeSYX0Y6ye8pNebpKrwFJq7BoQ8J5SO6NlvNwwHjSj6adXJViPQrKlsyPw7hLBLvckEMO1yxeGdR82YBBlDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.0.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.1.10", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.1.10.tgz", + "integrity": "sha512-rjLOyiY96RFVspVdQaZHmBgtoZmlHFCPC/prqZmKK4eI1kAiSAZOVgkRKeUj5v/2cWkmMd0k5gCepaRAZbGgvQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.0.0" + } + }, + "node_modules/bcryptjs": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-3.0.3.tgz", + "integrity": "sha512-GlF5wPWnSa/X5LKM1o0wz0suXIINz1iHRLvTS+sLyi7XPbe5ycmYI3DlZqVGZZtDgl4DmasFg7gOB3JYbphV5g==", + "license": "BSD-3-Clause", + "bin": { + "bcrypt": "bin/bcrypt" + } + }, + "node_modules/c12": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/c12/-/c12-3.1.0.tgz", + "integrity": "sha512-uWoS8OU1MEIsOv8p/5a82c3H31LsWVR5qiyXVfBNOzfffjUWtPnhAb4BYI2uG2HfGmZmFjCtui5XNWaps+iFuw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "chokidar": "^4.0.3", + "confbox": "^0.2.2", + "defu": "^6.1.4", + "dotenv": "^16.6.1", + "exsolve": "^1.0.7", + "giget": "^2.0.0", + "jiti": "^2.4.2", + "ohash": "^2.0.11", + "pathe": "^2.0.3", + "perfect-debounce": "^1.0.0", + "pkg-types": "^2.2.0", + "rc9": "^2.1.2" + }, + "peerDependencies": { + "magicast": "^0.3.5" + }, + "peerDependenciesMeta": { + "magicast": { + "optional": true + } + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001816", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001816.tgz", + "integrity": "sha512-+8Yx7BXCoqk6IF8yTicjfUR6D/ldJzdlsodlEOiOSPmhK844WIgk67/zIQaGAOxNkZyyvBlrRFnLvqKIoqbAFw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/citty": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.6.tgz", + "integrity": "sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "consola": "^3.2.3" + } + }, + "node_modules/client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", + "license": "MIT" + }, + "node_modules/confbox": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.2.4.tgz", + "integrity": "sha512-ysOGlgTFbN2/Y6Cg3Iye8YKulHw+R2fNXHrgSmXISQdMnomY6eNDprVdW9R5xBguEqI954+S6709UyiO7B+6OQ==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge-ts": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-7.1.5.tgz", + "integrity": "sha512-HOJkrhaYsweh+W+e74Yn7YStZOilkoPb6fycpwNLKzSPtruFs48nYis0zy5yJz1+ktUhHxoRDJ27RQAWLIJVJw==", + "devOptional": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/defu": { + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.7.tgz", + "integrity": "sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/destr": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.5.tgz", + "integrity": "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/dotenv": { + "version": "16.6.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "devOptional": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/effect": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/effect/-/effect-3.21.0.tgz", + "integrity": "sha512-PPN80qRokCd1f015IANNhrwOnLO7GrrMQfk4/lnZRE/8j7UPWrNNjPV0uBrZutI/nHzernbW+J0hdqQysHiSnQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.0.0", + "fast-check": "^3.23.1" + } + }, + "node_modules/empathic": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/empathic/-/empathic-2.0.0.tgz", + "integrity": "sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/esbuild": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", + "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.12", + "@esbuild/android-arm": "0.25.12", + "@esbuild/android-arm64": "0.25.12", + "@esbuild/android-x64": "0.25.12", + "@esbuild/darwin-arm64": "0.25.12", + "@esbuild/darwin-x64": "0.25.12", + "@esbuild/freebsd-arm64": "0.25.12", + "@esbuild/freebsd-x64": "0.25.12", + "@esbuild/linux-arm": "0.25.12", + "@esbuild/linux-arm64": "0.25.12", + "@esbuild/linux-ia32": "0.25.12", + "@esbuild/linux-loong64": "0.25.12", + "@esbuild/linux-mips64el": "0.25.12", + "@esbuild/linux-ppc64": "0.25.12", + "@esbuild/linux-riscv64": "0.25.12", + "@esbuild/linux-s390x": "0.25.12", + "@esbuild/linux-x64": "0.25.12", + "@esbuild/netbsd-arm64": "0.25.12", + "@esbuild/netbsd-x64": "0.25.12", + "@esbuild/openbsd-arm64": "0.25.12", + "@esbuild/openbsd-x64": "0.25.12", + "@esbuild/openharmony-arm64": "0.25.12", + "@esbuild/sunos-x64": "0.25.12", + "@esbuild/win32-arm64": "0.25.12", + "@esbuild/win32-ia32": "0.25.12", + "@esbuild/win32-x64": "0.25.12" + } + }, + "node_modules/exsolve": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.1.3.tgz", + "integrity": "sha512-kuzL9zherLQoqDeQaS55AiiIg1kb4KYXaSusTtgZTPlvKP2gGCI82LNmBNh5RjDVUXIcmgx+/Mx7vPwRzBbhJA==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/fast-check": { + "version": "3.23.2", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.23.2.tgz", + "integrity": "sha512-h5+1OzzfCC3Ef7VbtKdcv7zsstUQwUDlYpUTvjeUsJAssPgLn7QzbboPtL5ro04Mq0rPOsMzl7q5hIbRs2wD1A==", + "devOptional": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT", + "dependencies": { + "pure-rand": "^6.1.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-tsconfig": { + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.14.3.tgz", + "integrity": "sha512-++QEw4DIY7WGoukz+/+A/8dGYPT9l9yIadnmSgZ8Rjr3YVSVDipQSO9CdnJo9ePqFqUUqh+wk9uIaoiAwsiPkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/giget": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/giget/-/giget-2.0.0.tgz", + "integrity": "sha512-L5bGsVkxJbJgdnwyuheIunkGatUF/zssUoxxjACCseZYAVbaqdh9Tsmmlkl8vYan09H7sbvKt4pS8GqKLBrEzA==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "citty": "^0.1.6", + "consola": "^3.4.0", + "defu": "^6.1.4", + "node-fetch-native": "^1.6.6", + "nypm": "^0.6.0", + "pathe": "^2.0.3" + }, + "bin": { + "giget": "dist/cli.mjs" + } + }, + "node_modules/jiti": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", + "devOptional": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/next": { + "version": "15.5.28", + "resolved": "https://registry.npmjs.org/next/-/next-15.5.28.tgz", + "integrity": "sha512-JjhLBBY1PNnuwPtcZ7t8yxVeJVYvD2Jyp633J+gRCNbzSt7N0E+xqCf6uQiff3+3qmUkwcF/ksfSsK1xsZ76Tw==", + "license": "MIT", + "dependencies": { + "@next/env": "15.5.28", + "@swc/helpers": "0.5.15", + "caniuse-lite": "^1.0.30001579", + "postcss": "8.4.31", + "styled-jsx": "5.1.6" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": "^18.18.0 || ^19.8.0 || >= 20.0.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "15.5.28", + "@next/swc-darwin-x64": "15.5.28", + "@next/swc-linux-arm64-gnu": "15.5.28", + "@next/swc-linux-arm64-musl": "15.5.28", + "@next/swc-linux-x64-gnu": "15.5.28", + "@next/swc-linux-x64-musl": "15.5.28", + "@next/swc-win32-arm64-msvc": "15.5.28", + "@next/swc-win32-x64-msvc": "15.5.28", + "sharp": "^0.34.3 || ^0.35.5" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "@playwright/test": "^1.51.1", + "babel-plugin-react-compiler": "*", + "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@playwright/test": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "node_modules/node-fetch-native": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.7.tgz", + "integrity": "sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/nypm": { + "version": "0.6.10", + "resolved": "https://registry.npmjs.org/nypm/-/nypm-0.6.10.tgz", + "integrity": "sha512-W72Hrj1petq+b3Hk2aAC+9zswetlIFTnDW4s5djseZh2nYqBbyQLOtj472HwcbcWykPBUW1WpWpjOd4nK6gMRw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "citty": "^0.2.2", + "pathe": "^2.0.3", + "tinyexec": "^1.3.1" + }, + "bin": { + "nypm": "dist/cli.mjs" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/nypm/node_modules/citty": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/citty/-/citty-0.2.2.tgz", + "integrity": "sha512-+6vJA3L98yv+IdfKGZHBNiGW5KHn22e/JwID0Strsz8h4S/csAu/OuICwxrg44k5MRiZHWIo8XXuJgQTriRP4w==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/ohash": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.12.tgz", + "integrity": "sha512-65S/5gk9YSsaRjcyf7Nfa6h/d3E8/1gslpXfI4W7Dxn/oap8IKRuNT5VXkLQ1YFKIEg4apRY4Pj6aiwFzrDdmw==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/perfect-debounce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-1.0.0.tgz", + "integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/pkg-types": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.3.tgz", + "integrity": "sha512-j/lCFdcppV0JxWpCEITdbDltBxPP6cHT+yNJ6Go2OgoSA9518X847X9z0p6LtA4Nc16+eQzCZjRrWanTGvHJ5w==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "confbox": "^0.3.1", + "exsolve": "^1.1.1", + "pathe": "^2.0.3" + } + }, + "node_modules/pkg-types/node_modules/confbox": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.3.1.tgz", + "integrity": "sha512-cKUSoKa8YxFZZSmraVi7onONx3amu77ngK3kGpsYHDH7drPwCRkQE1RYMPlLRrMtnciRj274XNRxcHxnKmDSnA==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/postcss": { + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prisma": { + "version": "6.19.3", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-6.19.3.tgz", + "integrity": "sha512-++ZJ0ijLrDJF6hNB4t4uxg2br3fC4H9Yc9tcbjr2fcNFP3rh/SBNrAgjhsqBU4Ght8JPrVofG/ZkXfnSfnYsFg==", + "devOptional": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@prisma/config": "6.19.3", + "@prisma/engines": "6.19.3" + }, + "bin": { + "prisma": "build/index.js" + }, + "engines": { + "node": ">=18.18" + }, + "peerDependencies": { + "typescript": ">=5.1.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "devOptional": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, + "node_modules/rc9": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/rc9/-/rc9-2.1.2.tgz", + "integrity": "sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "defu": "^6.1.4", + "destr": "^2.0.3" + } + }, + "node_modules/react": { + "version": "19.1.10", + "resolved": "https://registry.npmjs.org/react/-/react-19.1.10.tgz", + "integrity": "sha512-xLes4RnWjC02mmkdHO2GPNjO0le6RMBPLYWKMaMf4jUIMFjTqrYBobxWAh8rU0pjfefJ6OLdef9zbYj+7iXH9Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.1.10", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.10.tgz", + "integrity": "sha512-EDzJj/XjpSk+4biljInEj7y4f1qb+Hnl3kYvSqArStcAAgTHAj9pJM03Hi69JJZmVsyN/de2hOAouPxLMYEDbA==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.26.0" + }, + "peerDependencies": { + "react": "^19.1.10" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/scheduler": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", + "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/server-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/server-only/-/server-only-0.0.1.tgz", + "integrity": "sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==", + "license": "MIT" + }, + "node_modules/sharp": { + "version": "0.35.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.5.tgz", + "integrity": "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@img/colour": "^1.1.0", + "detect-libc": "^2.1.2", + "semver": "^7.8.5" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.35.5", + "@img/sharp-darwin-x64": "0.35.5", + "@img/sharp-freebsd-wasm32": "0.35.5", + "@img/sharp-libvips-darwin-arm64": "1.3.4", + "@img/sharp-libvips-darwin-x64": "1.3.4", + "@img/sharp-libvips-linux-arm": "1.3.4", + "@img/sharp-libvips-linux-arm64": "1.3.4", + "@img/sharp-libvips-linux-ppc64": "1.3.4", + "@img/sharp-libvips-linux-riscv64": "1.3.4", + "@img/sharp-libvips-linux-s390x": "1.3.4", + "@img/sharp-libvips-linux-x64": "1.3.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.3.4", + "@img/sharp-libvips-linuxmusl-x64": "1.3.4", + "@img/sharp-linux-arm": "0.35.5", + "@img/sharp-linux-arm64": "0.35.5", + "@img/sharp-linux-ppc64": "0.35.5", + "@img/sharp-linux-riscv64": "0.35.5", + "@img/sharp-linux-s390x": "0.35.5", + "@img/sharp-linux-x64": "0.35.5", + "@img/sharp-linuxmusl-arm64": "0.35.5", + "@img/sharp-linuxmusl-x64": "0.35.5", + "@img/sharp-webcontainers-wasm32": "0.35.5", + "@img/sharp-win32-arm64": "0.35.5", + "@img/sharp-win32-ia32": "0.35.5", + "@img/sharp-win32-x64": "0.35.5" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/styled-jsx": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz", + "integrity": "sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==", + "license": "MIT", + "dependencies": { + "client-only": "0.0.1" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/tinyexec": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz", + "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/tsx": { + "version": "4.20.6", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.20.6.tgz", + "integrity": "sha512-ytQKuwgmrrkDTFP4LjR0ToE2nqgy886GpvRSpU0JAnrdBYppuY5rLkRUYPU1yCryb24SsKBTL/hlDQAEFVwtZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.25.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "devOptional": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/zod": { + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..d4875d6 --- /dev/null +++ b/package.json @@ -0,0 +1,37 @@ +{ + "name": "sanamare", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "tsc --noEmit", + "db:push": "prisma db push", + "db:migrate": "prisma migrate deploy", + "db:seed": "tsx prisma/seed.ts", + "tokens": "node scripts/build-tokens.mjs" + }, + "prisma": { + "seed": "tsx prisma/seed.ts" + }, + "dependencies": { + "@fontsource/cormorant-garamond": "^5.3.0", + "@fontsource/jost": "^5.3.0", + "@prisma/client": "6.19.3", + "bcryptjs": "3.0.3", + "next": "15.5.28", + "react": "19.1.10", + "react-dom": "19.1.10", + "server-only": "^0.0.1", + "zod": "4.6.7" + }, + "devDependencies": { + "@types/node": "22.20.5", + "@types/react": "19.1.10", + "@types/react-dom": "19.1.10", + "prisma": "6.19.3", + "tsx": "^4.20.6", + "typescript": "5.9.3" + } +} diff --git a/prisma/migrations/20261019125521_init/migration.sql b/prisma/migrations/20261019125521_init/migration.sql new file mode 100644 index 0000000..1dc5b67 --- /dev/null +++ b/prisma/migrations/20261019125521_init/migration.sql @@ -0,0 +1,325 @@ +-- CreateEnum +CREATE TYPE "OrderStatus" AS ENUM ('PENDING', 'PAID', 'PROCESSING', 'SHIPPED', 'COMPLETED', 'CANCELLED', 'REFUNDED'); + +-- CreateEnum +CREATE TYPE "PaymentStatus" AS ENUM ('OPEN', 'AUTHORIZED', 'PAID', 'FAILED', 'REFUNDED'); + +-- CreateTable +CREATE TABLE "Role" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "description" TEXT NOT NULL DEFAULT '', + "permissions" TEXT[], + "isSystem" BOOLEAN NOT NULL DEFAULT false, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Role_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "User" ( + "id" TEXT NOT NULL, + "email" TEXT NOT NULL, + "passwordHash" TEXT NOT NULL, + "firstName" TEXT NOT NULL DEFAULT '', + "lastName" TEXT NOT NULL DEFAULT '', + "phone" TEXT NOT NULL DEFAULT '', + "roleId" TEXT, + "active" BOOLEAN NOT NULL DEFAULT true, + "newsletter" BOOLEAN NOT NULL DEFAULT false, + "lastLoginAt" TIMESTAMP(3), + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "User_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Session" ( + "id" TEXT NOT NULL, + "tokenHash" TEXT NOT NULL, + "userId" TEXT NOT NULL, + "expiresAt" TIMESTAMP(3) NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "Session_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Address" ( + "id" TEXT NOT NULL, + "userId" TEXT NOT NULL, + "firstName" TEXT NOT NULL, + "lastName" TEXT NOT NULL, + "company" TEXT NOT NULL DEFAULT '', + "street" TEXT NOT NULL, + "extra" TEXT NOT NULL DEFAULT '', + "zip" TEXT NOT NULL, + "city" TEXT NOT NULL, + "country" TEXT NOT NULL DEFAULT 'DE', + "isDefault" BOOLEAN NOT NULL DEFAULT false, + + CONSTRAINT "Address_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Category" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "slug" TEXT NOT NULL, + "description" TEXT NOT NULL DEFAULT '', + "image" TEXT NOT NULL DEFAULT '', + "sort" INTEGER NOT NULL DEFAULT 0, + "active" BOOLEAN NOT NULL DEFAULT true, + "showOnHome" BOOLEAN NOT NULL DEFAULT true, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Category_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Product" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "slug" TEXT NOT NULL, + "subtitle" TEXT NOT NULL DEFAULT '', + "description" TEXT NOT NULL DEFAULT '', + "details" TEXT NOT NULL DEFAULT '', + "sku" TEXT NOT NULL DEFAULT '', + "price" INTEGER NOT NULL, + "compareAtPrice" INTEGER, + "taxRate" INTEGER NOT NULL DEFAULT 19, + "stock" INTEGER NOT NULL DEFAULT 0, + "trackStock" BOOLEAN NOT NULL DEFAULT true, + "active" BOOLEAN NOT NULL DEFAULT true, + "featured" BOOLEAN NOT NULL DEFAULT false, + "badge" TEXT NOT NULL DEFAULT '', + "images" TEXT[], + "sort" INTEGER NOT NULL DEFAULT 0, + "categoryId" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Product_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ProductVariant" ( + "id" TEXT NOT NULL, + "productId" TEXT NOT NULL, + "name" TEXT NOT NULL, + "sku" TEXT NOT NULL DEFAULT '', + "price" INTEGER, + "stock" INTEGER NOT NULL DEFAULT 0, + "sort" INTEGER NOT NULL DEFAULT 0, + + CONSTRAINT "ProductVariant_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Order" ( + "id" TEXT NOT NULL, + "number" TEXT NOT NULL, + "userId" TEXT, + "email" TEXT NOT NULL, + "phone" TEXT NOT NULL DEFAULT '', + "status" "OrderStatus" NOT NULL DEFAULT 'PENDING', + "paymentStatus" "PaymentStatus" NOT NULL DEFAULT 'OPEN', + "paymentMethod" TEXT NOT NULL, + "paymentRef" TEXT NOT NULL DEFAULT '', + "shippingMethod" TEXT NOT NULL, + "shippingAddress" JSONB NOT NULL, + "billingAddress" JSONB, + "subtotal" INTEGER NOT NULL, + "shippingCost" INTEGER NOT NULL, + "paymentFee" INTEGER NOT NULL DEFAULT 0, + "discount" INTEGER NOT NULL DEFAULT 0, + "couponCode" TEXT NOT NULL DEFAULT '', + "taxAmount" INTEGER NOT NULL, + "total" INTEGER NOT NULL, + "note" TEXT NOT NULL DEFAULT '', + "internalNote" TEXT NOT NULL DEFAULT '', + "trackingNumber" TEXT NOT NULL DEFAULT '', + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Order_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "OrderItem" ( + "id" TEXT NOT NULL, + "orderId" TEXT NOT NULL, + "productId" TEXT, + "variantId" TEXT, + "name" TEXT NOT NULL, + "variantName" TEXT NOT NULL DEFAULT '', + "sku" TEXT NOT NULL DEFAULT '', + "unitPrice" INTEGER NOT NULL, + "quantity" INTEGER NOT NULL, + "taxRate" INTEGER NOT NULL, + "total" INTEGER NOT NULL, + + CONSTRAINT "OrderItem_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "OrderEvent" ( + "id" TEXT NOT NULL, + "orderId" TEXT NOT NULL, + "message" TEXT NOT NULL, + "author" TEXT NOT NULL DEFAULT 'System', + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "OrderEvent_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "PaymentMethod" ( + "id" TEXT NOT NULL, + "code" TEXT NOT NULL, + "name" TEXT NOT NULL, + "description" TEXT NOT NULL DEFAULT '', + "enabled" BOOLEAN NOT NULL DEFAULT false, + "sort" INTEGER NOT NULL DEFAULT 0, + "fee" INTEGER NOT NULL DEFAULT 0, + "minTotal" INTEGER NOT NULL DEFAULT 0, + "maxTotal" INTEGER NOT NULL DEFAULT 0, + "loggedInOnly" BOOLEAN NOT NULL DEFAULT false, + "config" JSONB NOT NULL DEFAULT '{}', + + CONSTRAINT "PaymentMethod_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ShippingMethod" ( + "id" TEXT NOT NULL, + "name" TEXT NOT NULL, + "description" TEXT NOT NULL DEFAULT '', + "price" INTEGER NOT NULL, + "freeFrom" INTEGER NOT NULL DEFAULT 0, + "countries" TEXT[] DEFAULT ARRAY['DE']::TEXT[], + "enabled" BOOLEAN NOT NULL DEFAULT true, + "sort" INTEGER NOT NULL DEFAULT 0, + + CONSTRAINT "ShippingMethod_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Coupon" ( + "id" TEXT NOT NULL, + "code" TEXT NOT NULL, + "type" TEXT NOT NULL DEFAULT 'percent', + "value" INTEGER NOT NULL, + "minTotal" INTEGER NOT NULL DEFAULT 0, + "maxUses" INTEGER NOT NULL DEFAULT 0, + "usedCount" INTEGER NOT NULL DEFAULT 0, + "active" BOOLEAN NOT NULL DEFAULT true, + "validUntil" TIMESTAMP(3), + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "Coupon_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Page" ( + "id" TEXT NOT NULL, + "slug" TEXT NOT NULL, + "title" TEXT NOT NULL, + "content" TEXT NOT NULL DEFAULT '', + "published" BOOLEAN NOT NULL DEFAULT true, + "showInFooter" TEXT NOT NULL DEFAULT '', + "sort" INTEGER NOT NULL DEFAULT 0, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Page_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Setting" ( + "key" TEXT NOT NULL, + "value" JSONB NOT NULL, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Setting_pkey" PRIMARY KEY ("key") +); + +-- CreateTable +CREATE TABLE "NewsletterSubscriber" ( + "id" TEXT NOT NULL, + "email" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "NewsletterSubscriber_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "AuditLog" ( + "id" TEXT NOT NULL, + "userId" TEXT, + "userEmail" TEXT NOT NULL DEFAULT '', + "action" TEXT NOT NULL, + "details" TEXT NOT NULL DEFAULT '', + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "AuditLog_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "Role_name_key" ON "Role"("name"); + +-- CreateIndex +CREATE UNIQUE INDEX "User_email_key" ON "User"("email"); + +-- CreateIndex +CREATE UNIQUE INDEX "Session_tokenHash_key" ON "Session"("tokenHash"); + +-- CreateIndex +CREATE UNIQUE INDEX "Category_slug_key" ON "Category"("slug"); + +-- CreateIndex +CREATE UNIQUE INDEX "Product_slug_key" ON "Product"("slug"); + +-- CreateIndex +CREATE UNIQUE INDEX "Order_number_key" ON "Order"("number"); + +-- CreateIndex +CREATE UNIQUE INDEX "PaymentMethod_code_key" ON "PaymentMethod"("code"); + +-- CreateIndex +CREATE UNIQUE INDEX "Coupon_code_key" ON "Coupon"("code"); + +-- CreateIndex +CREATE UNIQUE INDEX "Page_slug_key" ON "Page"("slug"); + +-- CreateIndex +CREATE UNIQUE INDEX "NewsletterSubscriber_email_key" ON "NewsletterSubscriber"("email"); + +-- AddForeignKey +ALTER TABLE "User" ADD CONSTRAINT "User_roleId_fkey" FOREIGN KEY ("roleId") REFERENCES "Role"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Session" ADD CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Address" ADD CONSTRAINT "Address_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Product" ADD CONSTRAINT "Product_categoryId_fkey" FOREIGN KEY ("categoryId") REFERENCES "Category"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ProductVariant" ADD CONSTRAINT "ProductVariant_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Order" ADD CONSTRAINT "Order_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "OrderItem" ADD CONSTRAINT "OrderItem_orderId_fkey" FOREIGN KEY ("orderId") REFERENCES "Order"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "OrderItem" ADD CONSTRAINT "OrderItem_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "OrderEvent" ADD CONSTRAINT "OrderEvent_orderId_fkey" FOREIGN KEY ("orderId") REFERENCES "Order"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/prisma/migrations/migration_lock.toml b/prisma/migrations/migration_lock.toml new file mode 100644 index 0000000..044d57c --- /dev/null +++ b/prisma/migrations/migration_lock.toml @@ -0,0 +1,3 @@ +# Please do not edit this file manually +# It should be added in your version-control system (e.g., Git) +provider = "postgresql" diff --git a/prisma/schema.prisma b/prisma/schema.prisma new file mode 100644 index 0000000..84b298a --- /dev/null +++ b/prisma/schema.prisma @@ -0,0 +1,276 @@ +generator client { + provider = "prisma-client-js" +} + +datasource db { + provider = "postgresql" + url = env("DATABASE_URL") +} + +// ---------- Benutzer, Rollen, Rechte ---------- + +model Role { + id String @id @default(cuid()) + name String @unique + description String @default("") + // Liste von Rechte-Schlüsseln aus src/lib/permissions.ts + permissions String[] + // Systemrollen (Inhaber) können nicht gelöscht werden + isSystem Boolean @default(false) + users User[] + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt +} + +model User { + id String @id @default(cuid()) + email String @unique + passwordHash String + firstName String @default("") + lastName String @default("") + phone String @default("") + // Ohne Rolle ist ein Benutzer ein Kunde ohne Admin-Zugang + roleId String? + role Role? @relation(fields: [roleId], references: [id], onDelete: SetNull) + active Boolean @default(true) + newsletter Boolean @default(false) + lastLoginAt DateTime? + sessions Session[] + orders Order[] + addresses Address[] + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt +} + +model Session { + id String @id @default(cuid()) + tokenHash String @unique + userId String + user User @relation(fields: [userId], references: [id], onDelete: Cascade) + expiresAt DateTime + createdAt DateTime @default(now()) +} + +model Address { + id String @id @default(cuid()) + userId String + user User @relation(fields: [userId], references: [id], onDelete: Cascade) + firstName String + lastName String + company String @default("") + street String + extra String @default("") + zip String + city String + country String @default("DE") + isDefault Boolean @default(false) +} + +// ---------- Katalog ---------- + +model Category { + id String @id @default(cuid()) + name String + slug String @unique + description String @default("") + image String @default("") + sort Int @default(0) + active Boolean @default(true) + showOnHome Boolean @default(true) + products Product[] + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt +} + +model Product { + id String @id @default(cuid()) + name String + slug String @unique + subtitle String @default("") // z. B. "Anthrazit · 8 mm" + description String @default("") + details String @default("") // Material & Pflege + sku String @default("") + // Preise in Cent, brutto + price Int + compareAtPrice Int? + taxRate Int @default(19) + stock Int @default(0) + trackStock Boolean @default(true) + active Boolean @default(true) + featured Boolean @default(false) + badge String @default("") // "", "new", "best" + images String[] + sort Int @default(0) + categoryId String? + category Category? @relation(fields: [categoryId], references: [id], onDelete: SetNull) + variants ProductVariant[] + orderItems OrderItem[] + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt +} + +model ProductVariant { + id String @id @default(cuid()) + productId String + product Product @relation(fields: [productId], references: [id], onDelete: Cascade) + name String // z. B. "183 cm" oder "Anthrazit" + sku String @default("") + // Preis in Cent; leer = Produktpreis + price Int? + stock Int @default(0) + sort Int @default(0) +} + +// ---------- Bestellungen ---------- + +enum OrderStatus { + PENDING // angelegt, Zahlung offen + PAID // bezahlt + PROCESSING // in Bearbeitung + SHIPPED // versendet + COMPLETED // abgeschlossen + CANCELLED // storniert + REFUNDED // erstattet +} + +enum PaymentStatus { + OPEN + AUTHORIZED + PAID + FAILED + REFUNDED +} + +model Order { + id String @id @default(cuid()) + number String @unique + userId String? + user User? @relation(fields: [userId], references: [id], onDelete: SetNull) + email String + phone String @default("") + status OrderStatus @default(PENDING) + paymentStatus PaymentStatus @default(OPEN) + paymentMethod String + paymentRef String @default("") + shippingMethod String + shippingAddress Json + billingAddress Json? + subtotal Int + shippingCost Int + paymentFee Int @default(0) + discount Int @default(0) + couponCode String @default("") + taxAmount Int + total Int + note String @default("") + internalNote String @default("") + trackingNumber String @default("") + items OrderItem[] + events OrderEvent[] + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt +} + +model OrderItem { + id String @id @default(cuid()) + orderId String + order Order @relation(fields: [orderId], references: [id], onDelete: Cascade) + productId String? + product Product? @relation(fields: [productId], references: [id], onDelete: SetNull) + variantId String? + name String + variantName String @default("") + sku String @default("") + unitPrice Int + quantity Int + taxRate Int + total Int +} + +model OrderEvent { + id String @id @default(cuid()) + orderId String + order Order @relation(fields: [orderId], references: [id], onDelete: Cascade) + message String + author String @default("System") + createdAt DateTime @default(now()) +} + +// ---------- Konfiguration ---------- + +model PaymentMethod { + id String @id @default(cuid()) + // stripe_card, stripe_sepa, stripe_klarna, paypal, prepayment, invoice, cod + code String @unique + name String + description String @default("") + enabled Boolean @default(false) + sort Int @default(0) + // Gebühr in Cent + fee Int @default(0) + // Mindest- und Höchstbestellwert in Cent (0 = keine Grenze) + minTotal Int @default(0) + maxTotal Int @default(0) + // Nur für angemeldete Kunden (z. B. Rechnung) + loggedInOnly Boolean @default(false) + // Anbieter-spezifisch: Schlüssel, Testmodus, Bankdaten, Zahlungsziel … + config Json @default("{}") +} + +model ShippingMethod { + id String @id @default(cuid()) + name String + description String @default("") + price Int + // Ab diesem Warenwert kostenlos (0 = nie) + freeFrom Int @default(0) + countries String[] @default(["DE"]) + enabled Boolean @default(true) + sort Int @default(0) +} + +model Coupon { + id String @id @default(cuid()) + code String @unique + // "percent" oder "fixed" + type String @default("percent") + value Int // Prozent oder Cent + minTotal Int @default(0) + maxUses Int @default(0) + usedCount Int @default(0) + active Boolean @default(true) + validUntil DateTime? + createdAt DateTime @default(now()) +} + +model Page { + id String @id @default(cuid()) + slug String @unique + title String + content String @default("") + published Boolean @default(true) + showInFooter String @default("") // "", "service", "company", "legal" + sort Int @default(0) + updatedAt DateTime @updatedAt +} + +model Setting { + key String @id + value Json + updatedAt DateTime @updatedAt +} + +model NewsletterSubscriber { + id String @id @default(cuid()) + email String @unique + createdAt DateTime @default(now()) +} + +model AuditLog { + id String @id @default(cuid()) + userId String? + userEmail String @default("") + action String + details String @default("") + createdAt DateTime @default(now()) +} diff --git a/prisma/seed.ts b/prisma/seed.ts new file mode 100644 index 0000000..144dd80 --- /dev/null +++ b/prisma/seed.ts @@ -0,0 +1,112 @@ +// Grunddaten: Rollen, Inhaber-Zugang, Zahlungs- und Versandarten, Rechtsseiten, Beispielkatalog. +import { PrismaClient } from "@prisma/client"; +import bcrypt from "bcryptjs"; +import { ALL_PERMISSIONS } from "../src/lib/permissions"; +import { PAYMENT_DEFINITIONS } from "../src/lib/payments/catalog"; + +const db = new PrismaClient(); + +async function main() { + const owner = await db.role.upsert({ + where: { name: "Inhaber" }, + create: { name: "Inhaber", description: "Voller Zugriff auf alles, kann nicht eingeschränkt werden.", permissions: ALL_PERMISSIONS, isSystem: true }, + update: { permissions: ALL_PERMISSIONS, isSystem: true }, + }); + await db.role.upsert({ + where: { name: "Shop-Manager" }, + create: { + name: "Shop-Manager", + description: "Bestellungen, Katalog, Kunden und Inhalte – ohne Team, Rollen und Zahlungszugänge.", + permissions: ["dashboard.view", "orders.view", "orders.edit", "orders.refund", "products.view", "products.edit", "products.delete", "categories.edit", "stock.edit", "customers.view", "customers.edit", "coupons.edit", "newsletter.view", "content.edit", "appearance.edit", "shipping.edit"], + }, + update: {}, + }); + await db.role.upsert({ + where: { name: "Versand" }, + create: { name: "Versand", description: "Sieht Bestellungen und trägt Versand und Sendungsnummern ein.", permissions: ["dashboard.view", "orders.view", "orders.edit", "products.view", "stock.edit"] }, + update: {}, + }); + await db.role.upsert({ + where: { name: "Redaktion" }, + create: { name: "Redaktion", description: "Pflegt Produkttexte, Seiten und die Startseite.", permissions: ["dashboard.view", "products.view", "products.edit", "content.edit", "appearance.edit"] }, + update: {}, + }); + + const email = (process.env.ADMIN_EMAIL ?? "admin@sanamare.de").toLowerCase(); + const password = process.env.ADMIN_PASSWORD ?? "sanamare-admin"; + const existing = await db.user.findUnique({ where: { email } }); + if (!existing) { + await db.user.create({ data: { email, firstName: "Max", lastName: "", passwordHash: await bcrypt.hash(password, 12), roleId: owner.id } }); + console.log(`Inhaber-Zugang angelegt: ${email}`); + } + + for (const [i, def] of PAYMENT_DEFINITIONS.entries()) { + await db.paymentMethod.upsert({ + where: { code: def.code }, + create: { + code: def.code, + name: def.defaultName, + description: def.defaultDescription, + sort: i, + enabled: def.provider === "manual" && def.code !== "cod", + loggedInOnly: def.code === "invoice", + fee: def.code === "cod" ? 700 : 0, + config: def.defaultConfig ?? {}, + }, + update: {}, + }); + } + + if ((await db.shippingMethod.count()) === 0) { + await db.shippingMethod.createMany({ + data: [ + { name: "Standardversand (DHL)", description: "Lieferung in 2–4 Werktagen, klimaneutral.", price: 495, freeFrom: 8000, countries: ["DE"], sort: 0 }, + { name: "Expressversand", description: "Lieferung am nächsten Werktag bei Bestellung bis 14 Uhr.", price: 1290, freeFrom: 0, countries: ["DE"], sort: 1 }, + { name: "Versand EU", description: "Lieferung in 4–7 Werktagen.", price: 1290, freeFrom: 15000, countries: ["AT", "CH", "NL", "BE", "LU", "FR", "IT", "ES", "DK", "PL"], sort: 2 }, + ], + }); + } + + const pages = [ + { slug: "versand", title: "Versand & Lieferung", showInFooter: "service", content: "## Lieferzeit\nWir liefern innerhalb Deutschlands in 2–4 Werktagen.\n\n## Versandkosten\nKostenloser Versand ab 80 €. Darunter berechnen wir 4,95 €." }, + { slug: "rueckgabe", title: "Rückgabe", showInFooter: "service", content: "Du kannst innerhalb von 30 Tagen zurückgeben. Schreib uns eine kurze Nachricht, wir schicken dir ein Rücksendeetikett." }, + { slug: "kontakt", title: "Kontakt", showInFooter: "service", content: "Du erreichst uns Mo–Fr von 9 bis 18 Uhr.\n\nE-Mail: [hallo@sanamare.de](mailto:hallo@sanamare.de)" }, + { slug: "ueber-uns", title: "Über uns", showInFooter: "company", content: "Sanamare ist ein Pilates-Studio mit eigenem Shop. Wir verkaufen nur, was wir selbst im Studio benutzen." }, + { slug: "studio", title: "Studio", showInFooter: "company", content: "Hier stellen wir bald unser Studio vor." }, + { slug: "journal", title: "Journal", showInFooter: "company", content: "Hier erscheinen bald Übungen, Tipps und Neuigkeiten aus dem Studio." }, + { slug: "impressum", title: "Impressum", showInFooter: "legal", content: "Bitte im Admin unter Inhalte → Seiten ausfüllen." }, + { slug: "datenschutz", title: "Datenschutz", showInFooter: "legal", content: "Bitte im Admin unter Inhalte → Seiten ausfüllen." }, + { slug: "agb", title: "AGB", showInFooter: "legal", content: "Bitte im Admin unter Inhalte → Seiten ausfüllen." }, + { slug: "widerruf", title: "Widerruf", showInFooter: "legal", content: "Bitte im Admin unter Inhalte → Seiten ausfüllen." }, + ]; + for (const [i, p] of pages.entries()) await db.page.upsert({ where: { slug: p.slug }, create: { ...p, sort: i }, update: {} }); + + if ((await db.category.count()) === 0) { + const mats = await db.category.create({ data: { name: "Matten", slug: "matten", description: "Rutschfest, langlebig, angenehm unter den Händen.", sort: 0 } }); + const gear = await db.category.create({ data: { name: "Kleingeräte", slug: "kleingeraete", description: "Ringe, Bälle und Bänder für dein Training.", sort: 1 } }); + const wear = await db.category.create({ data: { name: "Bekleidung", slug: "bekleidung", description: "Bequem in jeder Position.", sort: 2 } }); + const products = [ + { name: "Reformer Matte Pro", slug: "reformer-matte-pro", subtitle: "Anthrazit · 8 mm", price: 12900, compareAtPrice: 14900, stock: 24, featured: true, badge: "new", categoryId: mats.id, sku: "SM-2041", description: "Griffige Oberfläche, 8 mm stark, aus recyceltem Naturkautschuk. Rutschfest auf jedem Boden, auch bei langen Flows.", details: "Naturkautschuk, PVC-frei. Mit lauwarmem Wasser und einem weichen Tuch abwischen, liegend trocknen.", variants: [{ name: "173 cm", stock: 8 }, { name: "183 cm", stock: 12 }, { name: "200 cm", stock: 0, price: 13900 }] }, + { name: "Pilates Ring Studio", slug: "pilates-ring-studio", subtitle: "Schwarz / Gold", price: 4900, compareAtPrice: 5900, stock: 40, featured: true, categoryId: gear.id, sku: "SM-1102", description: "Leichter, stabiler Ring mit gepolsterten Griffen für Innen- und Außenseite." }, + { name: "Grip Socks, 2er-Pack", slug: "grip-socks", subtitle: "Sand", price: 2400, stock: 120, featured: true, badge: "best", categoryId: wear.id, sku: "SM-3010", description: "Rutschfeste Socken für Reformer und Matte.", variants: [{ name: "35–37", stock: 30 }, { name: "38–40", stock: 50 }, { name: "41–43", stock: 40 }] }, + { name: "Flow Leggings", slug: "flow-leggings", subtitle: "Nachtblau · hoher Bund", price: 8900, stock: 30, featured: true, categoryId: wear.id, sku: "SM-3201", description: "Blickdicht, weich und mit hohem Bund, der nicht rutscht.", variants: [{ name: "XS", stock: 5 }, { name: "S", stock: 10 }, { name: "M", stock: 10 }, { name: "L", stock: 5 }] }, + { name: "Soft Ball", slug: "soft-ball", subtitle: "Ø 25 cm", price: 1900, stock: 2, categoryId: gear.id, sku: "SM-1120", description: "Weicher Ball für Mobilisation und Stabilisation." }, + { name: "Resistance Band Set", slug: "resistance-band-set", subtitle: "3 Stärken", price: 3400, stock: 60, categoryId: gear.id, sku: "SM-1140", description: "Drei Bänder aus Stoff in leicht, mittel und stark." }, + ]; + for (const [i, p] of products.entries()) { + const { variants, ...data } = p; + await db.product.create({ + data: { ...data, images: [], sort: i, variants: variants ? { create: variants.map((v, j) => ({ ...v, sort: j })) } : undefined }, + }); + } + await db.coupon.create({ data: { code: "WILLKOMMEN10", type: "percent", value: 10 } }); + } +} + +main() + .then(() => db.$disconnect()) + .catch(async (e) => { + console.error(e); + await db.$disconnect(); + process.exit(1); + }); diff --git a/public/brand/bildmarke-gold.png b/public/brand/bildmarke-gold.png new file mode 100644 index 0000000..fc3952c Binary files /dev/null and b/public/brand/bildmarke-gold.png differ diff --git a/public/brand/bildmarke-ink.png b/public/brand/bildmarke-ink.png new file mode 100644 index 0000000..cfd0c10 Binary files /dev/null and b/public/brand/bildmarke-ink.png differ diff --git a/public/brand/logo-gold-auf-schwarz.png b/public/brand/logo-gold-auf-schwarz.png new file mode 100644 index 0000000..ca5d8f5 Binary files /dev/null and b/public/brand/logo-gold-auf-schwarz.png differ diff --git a/public/brand/logo-gold.png b/public/brand/logo-gold.png new file mode 100644 index 0000000..ebde50b Binary files /dev/null and b/public/brand/logo-gold.png differ diff --git a/public/brand/logo-ink.png b/public/brand/logo-ink.png new file mode 100644 index 0000000..2a06536 Binary files /dev/null and b/public/brand/logo-ink.png differ diff --git a/scripts/build-tokens.mjs b/scripts/build-tokens.mjs new file mode 100644 index 0000000..092c3bb --- /dev/null +++ b/scripts/build-tokens.mjs @@ -0,0 +1,47 @@ +// Erzeugt src/styles/tokens.css aus design/tokens.json (Sanamare Design System). +import { readFileSync, writeFileSync } from "node:fs"; + +const t = JSON.parse(readFileSync(new URL("../design/tokens.json", import.meta.url))); +const themes = t.color.themes.map((x) => x.id); +const first = themes[0]; + +const colorValue = (v, theme) => { + const raw = typeof v === "string" ? v : v[theme] ?? v[first]; + return raw.startsWith("{") ? `var(--${raw.slice(1, -1)})` : raw; +}; +const themed = (v, theme) => (typeof v === "string" ? v : v[theme] ?? v[first]); + +const block = (theme) => { + const lines = []; + for (const tok of t.color.tokens) lines.push(` --${tok.name}: ${colorValue(tok.value, theme)};`); + for (const tok of t.shadow?.tokens ?? []) lines.push(` --${tok.name}: ${themed(tok.value, theme)};`); + return lines.join("\n"); +}; + +let css = `/* ${t.name} — generated from design/tokens.json (npm run tokens) */\n:root {\n`; +for (const [k, v] of Object.entries(t.type.families)) css += ` --font-${k}: ${v};\n`; +for (const fam of ["spacing", "radius", "layout", "breakpoint"]) + for (const tok of t[fam]?.tokens ?? []) css += ` --${tok.name}: ${tok.value};\n`; +css += block(first) + "\n color-scheme: light;\n}\n"; +for (const th of themes.slice(1)) { + css += `[data-theme="${th}"] {\n${block(th)}\n color-scheme: ${th};\n background-color: var(--surface);\n color: var(--ink);\n}\n`; +} +for (const g of t.type.groups) { + for (const s of g.styles) { + const props = [ + `font-family: var(--font-${g.family})`, + `font-size: ${s.fontSize}`, + `line-height: ${s.lineHeight}`, + `font-weight: ${s.fontWeight}`, + ]; + if (s.letterSpacing) props.push(`letter-spacing: ${s.letterSpacing}`); + if (s.fontStyle) props.push(`font-style: ${s.fontStyle}`); + if (["button", "nav", "eyebrow", "wordmark"].includes(s.name)) props.push("text-transform: uppercase"); + if (s.name === "eyebrow") props.push("color: var(--gold-deep)"); + if (s.name.startsWith("price")) props.push("font-variant-numeric: tabular-nums"); + css += `.${s.name} { ${props.join("; ")}; }\n`; + } +} +css += `@media (max-width: 767px) { .display-xl { font-size: 44px; line-height: 1.05; } .display-lg { font-size: 34px; } }\n`; +writeFileSync(new URL("../src/styles/tokens.css", import.meta.url), css); +console.log("tokens.css geschrieben"); diff --git a/src/app/(shop)/actions.ts b/src/app/(shop)/actions.ts new file mode 100644 index 0000000..83ee9d4 --- /dev/null +++ b/src/app/(shop)/actions.ts @@ -0,0 +1,69 @@ +"use server"; +import { cookies } from "next/headers"; +import { redirect } from "next/navigation"; +import { revalidatePath } from "next/cache"; +import { z } from "zod"; +import { db } from "@/lib/db"; +import { readCartCookie, writeCartCookie } from "@/lib/cart"; +import { findCoupon } from "@/lib/pricing"; + +export async function subscribeNewsletter(_prev: unknown, formData: FormData) { + const email = z.email().safeParse(String(formData.get("email") ?? "").trim().toLowerCase()); + if (!email.success) return { ok: false, error: "Bitte gib eine gültige E-Mail-Adresse ein." }; + await db.newsletterSubscriber.upsert({ where: { email: email.data }, create: { email: email.data }, update: {} }); + return { ok: true, error: null }; +} + +export async function addToCart(formData: FormData) { + const productId = String(formData.get("productId") ?? ""); + const variantId = String(formData.get("variantId") ?? "") || null; + const quantity = Math.max(1, Math.min(99, Number(formData.get("quantity") ?? 1) || 1)); + const product = await db.product.findFirst({ where: { id: productId, active: true }, include: { variants: true } }); + if (!product) return; + if (product.variants.length > 0 && !product.variants.some((v) => v.id === variantId)) { + redirect(`/produkt/${product.slug}?variante=fehlt`); + } + const entries = await readCartCookie(); + const existing = entries.find((e) => e.p === productId && e.v === variantId); + if (existing) existing.q = Math.min(99, existing.q + quantity); + else entries.push({ p: productId, v: variantId, q: quantity }); + await writeCartCookie(entries); + revalidatePath("/", "layout"); + const back = String(formData.get("redirectTo") ?? ""); + redirect(back.startsWith("/") ? back : "/warenkorb?hinzugefuegt=1"); +} + +export async function updateCartLine(formData: FormData) { + const [productId, variantRaw] = String(formData.get("key") ?? "").split(":"); + const variantId = variantRaw || null; + const quantity = Number(formData.get("quantity")); + let entries = await readCartCookie(); + if (!Number.isFinite(quantity) || quantity <= 0) { + entries = entries.filter((e) => !(e.p === productId && e.v === variantId)); + } else { + const e = entries.find((x) => x.p === productId && x.v === variantId); + if (e) e.q = Math.min(99, Math.round(quantity)); + } + await writeCartCookie(entries); + revalidatePath("/", "layout"); +} + +export async function applyCoupon(_prev: unknown, formData: FormData) { + const code = String(formData.get("code") ?? "").trim().toUpperCase(); + const jar = await cookies(); + if (!code) { + jar.delete("sm_coupon"); + revalidatePath("/warenkorb"); + return { error: null }; + } + const { error } = await findCoupon(code, Number.MAX_SAFE_INTEGER); + if (error) return { error }; + jar.set("sm_coupon", code, { httpOnly: true, sameSite: "lax", path: "/", maxAge: 60 * 60 * 24 * 7 }); + revalidatePath("/", "layout"); + return { error: null }; +} + +export async function removeCoupon() { + (await cookies()).delete("sm_coupon"); + revalidatePath("/", "layout"); +} diff --git a/src/app/(shop)/kasse/actions.ts b/src/app/(shop)/kasse/actions.ts new file mode 100644 index 0000000..96448d1 --- /dev/null +++ b/src/app/(shop)/kasse/actions.ts @@ -0,0 +1,131 @@ +"use server"; +import { cookies } from "next/headers"; +import { redirect } from "next/navigation"; +import { z } from "zod"; +import { db } from "@/lib/db"; +import { getCurrentUser } from "@/lib/auth"; +import { getCart } from "@/lib/cart"; +import { finishCheckoutSession } from "@/lib/checkout-finish"; +import { availablePayments, availableShipping, createOrder, readCheckout, writeCheckout } from "@/lib/checkout"; +import { computeTotals } from "@/lib/pricing"; +import { getSettings } from "@/lib/settings"; +import { getDefinition } from "@/lib/payments/catalog"; +import { getCredentials } from "@/lib/payments/credentials"; +import { createCheckoutSession } from "@/lib/payments/stripe"; +import { createPaypalOrder } from "@/lib/payments/paypal"; + +export type FormState = { errors?: Record; message?: string } | null; + +const addressSchema = z.object({ + firstName: z.string().trim().min(1, "Bitte gib deinen Vornamen ein."), + lastName: z.string().trim().min(1, "Bitte gib deinen Nachnamen ein."), + company: z.string().trim().default(""), + street: z.string().trim().min(3, "Bitte gib Straße und Hausnummer ein."), + extra: z.string().trim().default(""), + zip: z.string().trim().regex(/^[0-9A-Za-z -]{4,10}$/, "Bitte gib eine gültige Postleitzahl ein."), + city: z.string().trim().min(2, "Bitte gib deinen Ort ein."), + country: z.string().trim().length(2, "Bitte wähle ein Land."), +}); + +function pick(formData: FormData, prefix = "") { + const o: Record = {}; + for (const k of ["firstName", "lastName", "company", "street", "extra", "zip", "city", "country"]) o[k] = String(formData.get(prefix + k) ?? ""); + return o; +} + +export async function saveAddress(_prev: FormState, formData: FormData): Promise { + const settings = await getSettings(); + const errors: Record = {}; + const email = z.email().safeParse(String(formData.get("email") ?? "").trim().toLowerCase()); + if (!email.success) errors.email = "Bitte gib eine gültige E-Mail-Adresse ein."; + const phone = String(formData.get("phone") ?? "").trim(); + if (settings.checkout.requirePhone && phone.length < 5) errors.phone = "Bitte gib deine Telefonnummer ein."; + const address = addressSchema.safeParse(pick(formData)); + if (!address.success) for (const i of address.error.issues) errors[String(i.path[0])] ??= i.message; + if (address.success && !settings.checkout.countries.includes(address.data.country)) errors.country = "In dieses Land liefern wir leider nicht."; + const billingSame = formData.get("billingSame") === "on"; + let billing; + if (!billingSame) { + const b = addressSchema.safeParse(pick(formData, "b_")); + if (!b.success) for (const i of b.error.issues) errors["b_" + String(i.path[0])] ??= i.message; + else billing = b.data; + } + if (Object.keys(errors).length) return { errors, message: "Bitte prüfe die markierten Felder." }; + await writeCheckout({ + email: email.data, + phone, + address: address.data, + billingSame, + billing, + newsletter: formData.get("newsletter") === "on", + }); + redirect("/kasse/versand"); +} + +export async function saveShipping(_prev: FormState, formData: FormData): Promise { + const id = String(formData.get("shippingMethodId") ?? ""); + const state = await readCheckout(); + const methods = await availableShipping(state.address?.country); + if (!methods.some((m) => m.id === id)) return { message: "Bitte wähle eine Versandart." }; + await writeCheckout({ shippingMethodId: id }); + redirect("/kasse/zahlung"); +} + +export async function savePayment(_prev: FormState, formData: FormData): Promise { + const id = String(formData.get("paymentMethodId") ?? ""); + const [lines, user, jar] = await Promise.all([getCart(), getCurrentUser(), cookies()]); + const totals = await computeTotals({ lines, couponCode: jar.get("sm_coupon")?.value }); + const methods = await availablePayments(totals.total, Boolean(user)); + if (!methods.some((m) => m.id === id)) return { message: "Bitte wähle eine Zahlungsart." }; + await writeCheckout({ paymentMethodId: id }); + redirect("/kasse/pruefen"); +} + +export async function placeOrder(_prev: FormState, formData: FormData): Promise { + const settings = await getSettings(); + if (settings.checkout.requireTerms && formData.get("terms") !== "on") { + return { errors: { terms: "Bitte bestätige die AGB und die Widerrufsbelehrung." } }; + } + const [state, lines, user, jar] = await Promise.all([readCheckout(), getCart(), getCurrentUser(), cookies()]); + if (!lines.length) redirect("/warenkorb"); + if (!state.email || !state.address) redirect("/kasse/adresse"); + const shipping = state.shippingMethodId ? await db.shippingMethod.findUnique({ where: { id: state.shippingMethodId } }) : null; + if (!shipping?.enabled) redirect("/kasse/versand"); + const payment = state.paymentMethodId ? await db.paymentMethod.findUnique({ where: { id: state.paymentMethodId } }) : null; + if (!payment?.enabled) redirect("/kasse/zahlung"); + const totals = await computeTotals({ lines, couponCode: jar.get("sm_coupon")?.value, shipping, payment }); + if (settings.checkout.minOrderValue > 0 && totals.subtotal < settings.checkout.minOrderValue) redirect("/warenkorb"); + + let order; + try { + order = await createOrder({ state, lines, totals, shippingName: shipping.name, payment, userId: user?.id ?? null, note: String(formData.get("note") ?? "").slice(0, 1000) }); + } catch (e) { + return { message: e instanceof Error ? e.message : "Die Bestellung konnte nicht angelegt werden." }; + } + await writeCheckout({ lastOrderId: order.id }); + jar.set("sm_last_order", order.id, { httpOnly: true, sameSite: "lax", path: "/", maxAge: 60 * 60 * 24 * 30 }); + + const def = getDefinition(payment.code); + const appUrl = (process.env.APP_URL ?? "http://localhost:3000").replace(/\/$/, ""); + let target: string; + try { + if (def?.provider === "stripe") { + const creds = await getCredentials(); + const session = await createCheckoutSession({ secretKey: creds.stripe.secretKey, order, stripeType: def.stripeType!, appUrl }); + await db.order.update({ where: { id: order.id }, data: { paymentRef: session.id } }); + target = session.url; + } else if (def?.provider === "paypal") { + const creds = await getCredentials(); + const pp = await createPaypalOrder(creds.paypal, order, appUrl); + await db.order.update({ where: { id: order.id }, data: { paymentRef: pp.id } }); + target = pp.url; + } else { + await finishCheckoutSession(); + target = `/kasse/danke/${order.id}`; + } + } catch (e) { + await db.orderEvent.create({ data: { orderId: order.id, message: `Zahlung konnte nicht gestartet werden: ${e instanceof Error ? e.message : e}` } }); + return { message: "Die Zahlung konnte nicht gestartet werden. Bitte wähle eine andere Zahlungsart oder versuche es gleich noch einmal." }; + } + redirect(target); +} diff --git a/src/app/(shop)/kasse/adresse/page.tsx b/src/app/(shop)/kasse/adresse/page.tsx new file mode 100644 index 0000000..72db436 --- /dev/null +++ b/src/app/(shop)/kasse/adresse/page.tsx @@ -0,0 +1,50 @@ +import Link from "next/link"; +import { getCurrentUser } from "@/lib/auth"; +import { db } from "@/lib/db"; +import { COUNTRIES, getSettings } from "@/lib/settings"; +import { AddressForm } from "@/components/shop/AddressForm"; +import { CheckoutSummary, loadCheckout } from "../shared"; + +export const metadata = { title: "Kasse – Adresse" }; + +export default async function AddressStep() { + const [data, user, settings] = await Promise.all([loadCheckout(), getCurrentUser(), getSettings()]); + if (!user && !settings.checkout.guestCheckout) { + return ( +
+

Bitte melde dich an

+

Für eine Bestellung brauchst du ein Kundenkonto.

+
+ Anmelden + Konto erstellen +
+
+ ); + } + const saved = user ? await db.address.findFirst({ where: { userId: user.id }, orderBy: { isDefault: "desc" } }) : null; + const s = data.state; + const address = s.address ?? (saved ?? (user ? { firstName: user.firstName, lastName: user.lastName } : undefined)); + return ( +
+
+ {!user && ( +

+ Schon Kunde? Anmelden · Du kannst auch als Gast bestellen. +

+ )} + [c, COUNTRIES[c] ?? c])} + /> +
+ +
+ ); +} diff --git a/src/app/(shop)/kasse/danke/[id]/page.tsx b/src/app/(shop)/kasse/danke/[id]/page.tsx new file mode 100644 index 0000000..ea85ab6 --- /dev/null +++ b/src/app/(shop)/kasse/danke/[id]/page.tsx @@ -0,0 +1,73 @@ +import Link from "next/link"; +import { cookies } from "next/headers"; +import { notFound } from "next/navigation"; +import { db } from "@/lib/db"; +import { getCurrentUser } from "@/lib/auth"; +import { formatPrice } from "@/lib/money"; +import { Alert } from "@/components/shop/Blocks"; + +export const metadata = { title: "Danke für deine Bestellung" }; + +export default async function ThanksPage({ params }: { params: Promise<{ id: string }> }) { + const { id } = await params; + const [order, jar, user] = await Promise.all([ + db.order.findUnique({ where: { id }, include: { items: true } }), + cookies(), + getCurrentUser(), + ]); + if (!order) notFound(); + const allowed = jar.get("sm_last_order")?.value === order.id || (user && order.userId === user.id); + if (!allowed) notFound(); + const payment = await db.paymentMethod.findUnique({ where: { code: order.paymentMethod } }); + const cfg = (payment?.config ?? {}) as Record; + + return ( +
+ Bestellung {order.number} +

Danke für deine Bestellung.

+

+ Wir haben deine Bestellung erhalten und melden uns an {order.email}, sobald sie unterwegs ist. +

+ {order.paymentMethod === "prepayment" && ( +
+ + Kontoinhaber: {cfg.accountHolder} + IBAN: {cfg.iban} + {cfg.bic && BIC: {cfg.bic}} + {cfg.bank && Bank: {cfg.bank}} + Verwendungszweck: {order.number} + Wir versenden, sobald das Geld da ist. + +
+ )} + {order.paymentMethod === "invoice" && ( +
+ Die Rechnung liegt dem Paket bei. Zahlungsziel: {cfg.dueDays || 14} Tage. +
+ )} + {order.paymentStatus === "PAID" && ( +
+ )} +
+ + + {order.items.map((i) => ( + + + + + ))} + + {order.discount > 0 && } + {order.paymentFee > 0 && } + + +
{i.quantity} × {i.name}{i.variantName ? ` – ${i.variantName}` : ""}{formatPrice(i.total)}
Versand ({order.shippingMethod}){order.shippingCost ? formatPrice(order.shippingCost) : "Kostenlos"}
Gutschein {order.couponCode}−{formatPrice(order.discount)}
Gebühr Zahlungsart{formatPrice(order.paymentFee)}
Gesamt{formatPrice(order.total)}
+
+
+ Weiter einkaufen + {!user && Konto erstellen} +
+
+ ); +} diff --git a/src/app/(shop)/kasse/layout.tsx b/src/app/(shop)/kasse/layout.tsx new file mode 100644 index 0000000..271484e --- /dev/null +++ b/src/app/(shop)/kasse/layout.tsx @@ -0,0 +1,10 @@ +import { CheckoutSteps } from "@/components/shop/CheckoutSteps"; + +export default function CheckoutLayout({ children }: { children: React.ReactNode }) { + return ( +
+ + {children} +
+ ); +} diff --git a/src/app/(shop)/kasse/page.tsx b/src/app/(shop)/kasse/page.tsx new file mode 100644 index 0000000..96369fd --- /dev/null +++ b/src/app/(shop)/kasse/page.tsx @@ -0,0 +1,4 @@ +import { redirect } from "next/navigation"; +export default function Kasse() { + redirect("/kasse/adresse"); +} diff --git a/src/app/(shop)/kasse/pruefen/page.tsx b/src/app/(shop)/kasse/pruefen/page.tsx new file mode 100644 index 0000000..50c46be --- /dev/null +++ b/src/app/(shop)/kasse/pruefen/page.tsx @@ -0,0 +1,49 @@ +import Link from "next/link"; +import { redirect } from "next/navigation"; +import { formatPrice } from "@/lib/money"; +import { getSettings } from "@/lib/settings"; +import { AddressLines } from "@/components/shop/AddressLines"; +import { getDefinition } from "@/lib/payments/catalog"; +import { PlaceOrderForm } from "@/components/shop/PlaceOrderForm"; +import { CheckoutSummary, loadCheckout } from "../shared"; + +export const metadata = { title: "Kasse – Prüfen" }; + +export default async function ReviewStep() { + const [data, settings] = await Promise.all([loadCheckout(), getSettings()]); + const { state, shipping, payment } = data; + if (!state.address || !state.email) redirect("/kasse/adresse"); + if (!shipping) redirect("/kasse/versand"); + if (!payment) redirect("/kasse/zahlung"); + const provider = getDefinition(payment.code)?.provider; + return ( +
+
+

Alles richtig?

+
+
+

Lieferadresse Ändern

+ +

{state.email}

+
+
+

Rechnungsadresse Ändern

+ {state.billingSame === false && state.billing ? :

Wie Lieferadresse

} +
+
+

Versand Ändern

+

{shipping.name}

+
+
+

Zahlung Ändern

+

{payment.name}

+
+
+
+ +
+
+ +
+ ); +} diff --git a/src/app/(shop)/kasse/shared.tsx b/src/app/(shop)/kasse/shared.tsx new file mode 100644 index 0000000..fe72a7b --- /dev/null +++ b/src/app/(shop)/kasse/shared.tsx @@ -0,0 +1,30 @@ +import { cookies } from "next/headers"; +import { redirect } from "next/navigation"; +import { db } from "@/lib/db"; +import { getCart } from "@/lib/cart"; +import { readCheckout } from "@/lib/checkout"; +import { computeTotals } from "@/lib/pricing"; +import { OrderSummary } from "@/components/shop/OrderSummary"; + +/** Gemeinsame Daten aller Kassen-Schritte; leerer Warenkorb → zurück. */ +export async function loadCheckout() { + const [lines, state, jar] = await Promise.all([getCart(), readCheckout(), cookies()]); + if (lines.length === 0) redirect("/warenkorb"); + const [shipping, payment] = await Promise.all([ + state.shippingMethodId ? db.shippingMethod.findUnique({ where: { id: state.shippingMethodId } }) : null, + state.paymentMethodId ? db.paymentMethod.findUnique({ where: { id: state.paymentMethodId } }) : null, + ]); + const totals = await computeTotals({ lines, couponCode: jar.get("sm_coupon")?.value, shipping, payment }); + return { lines, state, shipping, payment, totals }; +} + +export function CheckoutSummary({ data }: { data: Awaited> }) { + return ( + + ); +} diff --git a/src/app/(shop)/kasse/versand/page.tsx b/src/app/(shop)/kasse/versand/page.tsx new file mode 100644 index 0000000..12e5737 --- /dev/null +++ b/src/app/(shop)/kasse/versand/page.tsx @@ -0,0 +1,43 @@ +import { redirect } from "next/navigation"; +import { availableShipping } from "@/lib/checkout"; +import { formatPrice } from "@/lib/money"; +import { shippingPrice } from "@/lib/pricing"; +import { ChoiceForm } from "@/components/shop/ChoiceForm"; +import { saveShipping } from "../actions"; +import { CheckoutSummary, loadCheckout } from "../shared"; + +export const metadata = { title: "Kasse – Versand" }; + +export default async function ShippingStep() { + const data = await loadCheckout(); + if (!data.state.address) redirect("/kasse/adresse"); + const methods = await availableShipping(data.state.address.country); + const merchandise = data.totals.subtotal - data.totals.discount; + return ( +
+
+ {methods.length === 0 ? ( +

In dein Land können wir gerade nicht liefern. Bitte melde dich bei uns.

+ ) : ( + { + const price = shippingPrice(m, merchandise); + return { + id: m.id, + title: m.name, + price: price === 0 ? "Kostenlos" : formatPrice(price), + text: [m.description, m.freeFrom > 0 && price > 0 ? `Kostenlos ab ${formatPrice(m.freeFrom)}` : ""].filter(Boolean).join(" · "), + }; + })} + /> + )} +
+ +
+ ); +} diff --git a/src/app/(shop)/kasse/zahlung/page.tsx b/src/app/(shop)/kasse/zahlung/page.tsx new file mode 100644 index 0000000..67b38ad --- /dev/null +++ b/src/app/(shop)/kasse/zahlung/page.tsx @@ -0,0 +1,46 @@ +import { redirect } from "next/navigation"; +import { getCurrentUser } from "@/lib/auth"; +import { availablePayments } from "@/lib/checkout"; +import { formatPrice } from "@/lib/money"; +import { Alert } from "@/components/shop/Blocks"; +import { ChoiceForm } from "@/components/shop/ChoiceForm"; +import { savePayment } from "../actions"; +import { CheckoutSummary, loadCheckout } from "../shared"; + +export const metadata = { title: "Kasse – Zahlung" }; + +export default async function PaymentStep({ searchParams }: { searchParams: Promise<{ abgebrochen?: string }> }) { + const [{ abgebrochen }, data, user] = await Promise.all([searchParams, loadCheckout(), getCurrentUser()]); + if (!data.state.address) redirect("/kasse/adresse"); + if (!data.shipping) redirect("/kasse/versand"); + const methods = await availablePayments(data.totals.total, Boolean(user)); + return ( +
+
+ {abgebrochen && ( +
+ Es wurde nichts abgebucht. Wähle eine Zahlungsart und versuche es noch einmal. +
+ )} + {methods.length === 0 ? ( + Bitte melde dich bei uns, wir helfen dir weiter. + ) : ( + ({ + id: m.id, + title: m.name, + price: m.fee > 0 ? `+ ${formatPrice(m.fee)}` : "", + text: m.description, + }))} + /> + )} +
+ +
+ ); +} diff --git a/src/app/(shop)/kategorie/[slug]/page.tsx b/src/app/(shop)/kategorie/[slug]/page.tsx new file mode 100644 index 0000000..862c6e4 --- /dev/null +++ b/src/app/(shop)/kategorie/[slug]/page.tsx @@ -0,0 +1,36 @@ +import { notFound } from "next/navigation"; +import Link from "next/link"; +import { db } from "@/lib/db"; +import { ProductList } from "@/components/shop/ProductList"; + +export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }) { + const { slug } = await params; + const c = await db.category.findUnique({ where: { slug } }); + return { title: c?.name ?? "Kategorie" }; +} + +export default async function CategoryPage({ + params, + searchParams, +}: { + params: Promise<{ slug: string }>; + searchParams: Promise<{ sort?: string }>; +}) { + const [{ slug }, { sort }] = await Promise.all([params, searchParams]); + const category = await db.category.findUnique({ where: { slug } }); + if (!category || !category.active) notFound(); + return ( +
+ +

{category.name}

+ {category.description &&

{category.description}

} + +
+ ); +} diff --git a/src/app/(shop)/kollektionen/page.tsx b/src/app/(shop)/kollektionen/page.tsx new file mode 100644 index 0000000..52b06b3 --- /dev/null +++ b/src/app/(shop)/kollektionen/page.tsx @@ -0,0 +1,25 @@ +import Link from "next/link"; +import { db } from "@/lib/db"; +import { Icon } from "@/components/Icon"; +import { ProductImage } from "@/components/shop/ProductImage"; + +export const metadata = { title: "Kollektionen" }; + +export default async function CollectionsPage() { + const categories = await db.category.findMany({ where: { active: true }, orderBy: { sort: "asc" } }); + return ( +
+ Kollektionen +

Alles für dein Studio

+

Wähle eine Kollektion.

+
+ {categories.map((c) => ( + + + {c.name} + + ))} +
+
+ ); +} diff --git a/src/app/(shop)/konto/anmelden/page.tsx b/src/app/(shop)/konto/anmelden/page.tsx new file mode 100644 index 0000000..af9f3e8 --- /dev/null +++ b/src/app/(shop)/konto/anmelden/page.tsx @@ -0,0 +1,23 @@ +import Link from "next/link"; +import { redirect } from "next/navigation"; +import { getCurrentUser } from "@/lib/auth"; +import { LoginForm } from "@/components/shop/AuthForms"; + +export const metadata = { title: "Anmelden" }; + +export default async function LoginPage({ searchParams }: { searchParams: Promise<{ weiter?: string }> }) { + const { weiter } = await searchParams; + if (await getCurrentUser()) redirect(weiter ?? "/konto"); + return ( +
+
+

Anmelden

+

Schön, dass du wieder da bist.

+ +

+ Noch kein Konto? Jetzt erstellen +

+
+
+ ); +} diff --git a/src/app/(shop)/konto/bestellung/[number]/page.tsx b/src/app/(shop)/konto/bestellung/[number]/page.tsx new file mode 100644 index 0000000..4bae1fa --- /dev/null +++ b/src/app/(shop)/konto/bestellung/[number]/page.tsx @@ -0,0 +1,42 @@ +import Link from "next/link"; +import { notFound, redirect } from "next/navigation"; +import { db } from "@/lib/db"; +import { getCurrentUser } from "@/lib/auth"; +import { formatPrice } from "@/lib/money"; +import { ORDER_STATUS, PAYMENT_STATUS, dayFmt } from "@/lib/status"; +import type { AddressData } from "@/lib/checkout"; +import { AddressLines } from "@/components/shop/AddressLines"; + +export default async function OrderDetail({ params }: { params: Promise<{ number: string }> }) { + const { number } = await params; + const user = await getCurrentUser(); + if (!user) redirect("/konto/anmelden"); + const order = await db.order.findUnique({ where: { number }, include: { items: true } }); + if (!order || order.userId !== user.id) notFound(); + return ( +
+ ← Zurück zum Konto +

Bestellung {order.number}

+

+ vom {dayFmt.format(order.createdAt)} · {ORDER_STATUS[order.status].label} · {PAYMENT_STATUS[order.paymentStatus].label} + {order.trackingNumber && <> · Sendungsnummer {order.trackingNumber}} +

+
+ + + {order.items.map((i) => ( + + ))} + + {order.discount > 0 && } + + +
{i.quantity} × {i.name}{i.variantName ? ` – ${i.variantName}` : ""}{formatPrice(i.total)}
Versand{formatPrice(order.shippingCost)}
Gutschein−{formatPrice(order.discount)}
Gesamt{formatPrice(order.total)}
+
+
+

Lieferadresse

+

Rechnungsadresse

{order.billingAddress ? :

Wie Lieferadresse

}
+
+
+ ); +} diff --git a/src/app/(shop)/konto/page.tsx b/src/app/(shop)/konto/page.tsx new file mode 100644 index 0000000..a60f242 --- /dev/null +++ b/src/app/(shop)/konto/page.tsx @@ -0,0 +1,45 @@ +import Link from "next/link"; +import { redirect } from "next/navigation"; +import { db } from "@/lib/db"; +import { getCurrentUser } from "@/lib/auth"; +import { logout } from "@/lib/auth-actions"; +import { formatPrice } from "@/lib/money"; +import { ORDER_STATUS, dayFmt } from "@/lib/status"; + +export const metadata = { title: "Mein Konto" }; + +export default async function AccountPage() { + const user = await getCurrentUser(); + if (!user) redirect("/konto/anmelden"); + const orders = await db.order.findMany({ where: { userId: user.id }, orderBy: { createdAt: "desc" } }); + return ( +
+ Mein Konto +

Hallo {user.firstName || user.email}

+
+ {user.role && Zum Admin-Bereich} +
+
+

Deine Bestellungen

+ {orders.length === 0 ? ( +

Du hast noch nichts bestellt. Zum Shop

+ ) : ( +
+ + + + {orders.map((o) => ( + + + + + + + ))} + +
BestellungDatumStatusSumme
{o.number}{dayFmt.format(o.createdAt)}{ORDER_STATUS[o.status].label}{formatPrice(o.total)}
+
+ )} +
+ ); +} diff --git a/src/app/(shop)/konto/registrieren/page.tsx b/src/app/(shop)/konto/registrieren/page.tsx new file mode 100644 index 0000000..12fee7e --- /dev/null +++ b/src/app/(shop)/konto/registrieren/page.tsx @@ -0,0 +1,23 @@ +import Link from "next/link"; +import { redirect } from "next/navigation"; +import { getCurrentUser } from "@/lib/auth"; +import { RegisterForm } from "@/components/shop/AuthForms"; + +export const metadata = { title: "Konto erstellen" }; + +export default async function RegisterPage({ searchParams }: { searchParams: Promise<{ weiter?: string; email?: string }> }) { + const { weiter, email } = await searchParams; + if (await getCurrentUser()) redirect(weiter ?? "/konto"); + return ( +
+
+

Konto erstellen

+

Bestellungen verfolgen und schneller bestellen.

+ +

+ Schon ein Konto? Anmelden +

+
+
+ ); +} diff --git a/src/app/(shop)/layout.tsx b/src/app/(shop)/layout.tsx new file mode 100644 index 0000000..c8d1f67 --- /dev/null +++ b/src/app/(shop)/layout.tsx @@ -0,0 +1,27 @@ +import { Header } from "@/components/shop/Header"; +import { Footer } from "@/components/shop/Footer"; +import { getSettings } from "@/lib/settings"; +import { can, getCurrentUser } from "@/lib/auth"; + +export const dynamic = "force-dynamic"; + +export default async function ShopLayout({ children }: { children: React.ReactNode }) { + const [settings, user] = await Promise.all([getSettings(), getCurrentUser()]); + if (settings.general.maintenance && !can(user, "dashboard.view")) { + return ( +
+ {/* eslint-disable-next-line @next/next/no-img-element */} + {settings.general.shopName} +

Wir sind gleich wieder da.

+

Der Shop wird gerade überarbeitet.

+
+ ); + } + return ( + <> +
+ {children} +