feat: Upgrade auf Next.js 16 (middleware -> proxy, Schriften via next/font)

- next 15.5 -> 16.4, Turbopack-Build; middleware.ts heißt jetzt proxy.ts
- Google-Fonts-@import (ungültig mitten im CSS) durch next/font ersetzt:
  Schriften werden selbst ausgeliefert (DSGVO, schneller)
- lint-Script (next lint entfällt) durch typecheck ersetzt, CLAUDE.md angepasst
- npm audit (prod): 0 Funde

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
MBO-Tech-IT 2026-10-07 08:11:39 +02:00
parent 705f28a61e
commit 3d56a8e66d
9 changed files with 104 additions and 71 deletions

View File

@ -7,14 +7,14 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
```bash ```bash
npm run dev # Dev-Server (http://localhost:3000) — erhöhter Node-Heap (4 GB) npm run dev # Dev-Server (http://localhost:3000) — erhöhter Node-Heap (4 GB)
npm run build # Produktions-Build (TypeScript + Next.js) npm run build # Produktions-Build (TypeScript + Next.js)
npm run lint # ESLint via next lint npm run typecheck # TypeScript-Check (next lint existiert ab Next 16 nicht mehr)
npx tsc --noEmit # TypeScript-Check ohne Build npx tsc --noEmit # TypeScript-Check ohne Build
git push # Remote: https://gitea.mbo-tech-it.de/jonny/MBO-Tech-IT-Webseite.git git push # Remote: https://gitea.mbo-tech-it.de/jonny/MBO-Tech-IT-Webseite.git
``` ```
## Architektur ## Architektur
**Next.js 15 App Router**, kein Pages Router. Alle Routen liegen unter `app/`. **Next.js 16 App Router**, kein Pages Router. Session-Refresh für `/kunden` und `/auth` läuft in `proxy.ts` (früher `middleware.ts`). Alle Routen liegen unter `app/`.
``` ```
app/ app/

View File

@ -2,8 +2,6 @@
@tailwind components; @tailwind components;
@tailwind utilities; @tailwind utilities;
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');
:root { :root {
--color-orange: #f97316; --color-orange: #f97316;
--color-orange-light: #fb923c; --color-orange-light: #fb923c;
@ -24,7 +22,7 @@ html {
body { body {
background-color: #f0f4f8; background-color: #f0f4f8;
color: #1a202c; color: #1a202c;
font-family: 'Inter', system-ui, sans-serif; font-family: var(--font-inter), 'Inter', system-ui, sans-serif;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
} }

View File

@ -1,10 +1,25 @@
import type { Metadata } from "next"; import type { Metadata } from "next";
import { Inter, JetBrains_Mono } from "next/font/google";
import "./globals.css"; import "./globals.css";
import Providers from "@/components/Providers"; import Providers from "@/components/Providers";
import { PageTracker } from "@/components/analytics/PageTracker"; import { PageTracker } from "@/components/analytics/PageTracker";
import { DEFAULT_DESCRIPTION, DEFAULT_TITLE, SITE_NAME, SITE_URL } from "@/lib/site"; import { DEFAULT_DESCRIPTION, DEFAULT_TITLE, SITE_NAME, SITE_URL } from "@/lib/site";
import { OG_COMMON } from "@/lib/seo"; import { OG_COMMON } from "@/lib/seo";
// Schriften werden beim Build geladen und selbst ausgeliefert (kein Abruf bei Google).
const inter = Inter({
subsets: ["latin"],
weight: ["300", "400", "500", "600", "700", "800", "900"],
variable: "--font-inter",
display: "swap",
});
const jetbrainsMono = JetBrains_Mono({
subsets: ["latin"],
weight: ["400", "500"],
variable: "--font-mono",
display: "swap",
});
export const metadata: Metadata = { export const metadata: Metadata = {
metadataBase: new URL(SITE_URL), metadataBase: new URL(SITE_URL),
title: { title: {
@ -46,7 +61,11 @@ export default function RootLayout({
children: React.ReactNode; children: React.ReactNode;
}) { }) {
return ( return (
<html lang="de" className="scroll-smooth" suppressHydrationWarning> <html
lang="de"
className={`${inter.variable} ${jetbrainsMono.variable} scroll-smooth`}
suppressHydrationWarning
>
<body> <body>
<PageTracker /> <PageTracker />
<Providers>{children}</Providers> <Providers>{children}</Providers>

3
next-env.d.ts vendored
View File

@ -1,6 +1,7 @@
/// <reference types="next" /> /// <reference types="next" />
/// <reference types="next/image-types/global" /> /// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" /> import "./.next/types/routes.d.ts";
import "./.next/types/root-params.d.ts";
// NOTE: This file should not be edited // NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

108
package-lock.json generated
View File

@ -12,7 +12,7 @@
"@supabase/supabase-js": "^2.104.1", "@supabase/supabase-js": "^2.104.1",
"bcryptjs": "^3.0.3", "bcryptjs": "^3.0.3",
"lucide-react": "^1.11.0", "lucide-react": "^1.11.0",
"next": "^15.5.27", "next": "^16.4.0",
"next-themes": "^0.4.6", "next-themes": "^0.4.6",
"nodemailer": "^10.0.15", "nodemailer": "^10.0.15",
"react": "^19.0.0", "react": "^19.0.0",
@ -593,15 +593,15 @@
} }
}, },
"node_modules/@next/env": { "node_modules/@next/env": {
"version": "15.5.27", "version": "16.4.0",
"resolved": "https://registry.npmjs.org/@next/env/-/env-15.5.27.tgz", "resolved": "https://registry.npmjs.org/@next/env/-/env-16.4.0.tgz",
"integrity": "sha512-WC5hvVqiuFOcRyz6gKPeJkiVvSMf3scNeAV49CdWtVqxmUlzh8UKR6YHt9yiNkh8LngtzqSlVz07/Ma3ZAzchA==", "integrity": "sha512-pyLlT5oafGlX8X7xjgGNXz5dNIDSxREm+qD6i9VLSZiZFopA/XWl8NM/KPmLx/8EG/++c49iid3gNWSQW1+2dQ==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/@next/swc-darwin-arm64": { "node_modules/@next/swc-darwin-arm64": {
"version": "15.5.27", "version": "16.4.0",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.5.27.tgz", "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.4.0.tgz",
"integrity": "sha512-fBA9QurmK4+uj4wNhmRTuO5zMVRaBHCvp6H93zTG/5i6Yi6TewbvbesXB8YQNj8T99Cwrow87hHiFV6wL/hyMA==", "integrity": "sha512-yyZ+9MgViAKLLb5l1gPBGjRwnq3teNLb5Zx6JEw8LzNSTjlsnp+baUHFxTgl7PpjCmKf48VQfyipG1eBflb48Q==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@ -615,9 +615,9 @@
} }
}, },
"node_modules/@next/swc-darwin-x64": { "node_modules/@next/swc-darwin-x64": {
"version": "15.5.27", "version": "16.4.0",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.5.27.tgz", "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.4.0.tgz",
"integrity": "sha512-FGZwJwry8qZNHxD/nfwrCwCHHrqx6epqItkkxbYcBQEQ2uw5S43bY83fQB5zbAsZE7TELMjoYkbhsQ4oKM7wwg==", "integrity": "sha512-RePEEejEj1Auf5s9qEcG0JbcDP3ceNUS/ofNX8AhxzgIjTVlZIHMatlp16YplcSMpsVo/ZMQHJTjbMYJznjGUg==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@ -631,9 +631,9 @@
} }
}, },
"node_modules/@next/swc-linux-arm64-gnu": { "node_modules/@next/swc-linux-arm64-gnu": {
"version": "15.5.27", "version": "16.4.0",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.5.27.tgz", "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.4.0.tgz",
"integrity": "sha512-GQulAaJYNF1RYuatlsw9/uzbKz4if2V7Ic9nVO+P0ljYPm4yBRTFIl6g5YkKTw40lMLbpy9edLoH44g3jSHMYA==", "integrity": "sha512-HhsyCqd+NpmvDDVY/LqkAN24f+QVvXh3ie+PfcwKinWL2Mu826JymQxJXGjAIfmJ4VlHjp4Pe/nZtXtUoEMAqw==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@ -647,9 +647,9 @@
} }
}, },
"node_modules/@next/swc-linux-arm64-musl": { "node_modules/@next/swc-linux-arm64-musl": {
"version": "15.5.27", "version": "16.4.0",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.5.27.tgz", "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.4.0.tgz",
"integrity": "sha512-URFFsUmu8Pi0/1qdnUI7tx7keZw1Mt5zHfrIX1RfDG9Nih8DYxK54WZsDJUX2ZTlii1jgotL7qcbwKnSAES6xQ==", "integrity": "sha512-sN9Pf+Zh+RpZAOmbR7d8KAA8T61CVhawtbEJ2Bk6QrRzx6Z/6haaF4UiwBzytM96GRRRWZh9/WALIEO3npMamA==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@ -663,9 +663,9 @@
} }
}, },
"node_modules/@next/swc-linux-x64-gnu": { "node_modules/@next/swc-linux-x64-gnu": {
"version": "15.5.27", "version": "16.4.0",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.5.27.tgz", "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.4.0.tgz",
"integrity": "sha512-aJp74z7uvU5jQhyH7lyk+4qSRcTdKbKT9NQE3jiO9kWYkoHZjKi0zzHDbCoZ+v2sJDEiJ/z58R0UlWMGWNF3HA==", "integrity": "sha512-D5M5xLWQVd1CvR+L7BickM1weRfmM41x3L1NWcnKY/oyJJqr1qwaCgmu3dMAhLBOMdZwSuDCRV6DJRRpiUkbDQ==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@ -679,9 +679,9 @@
} }
}, },
"node_modules/@next/swc-linux-x64-musl": { "node_modules/@next/swc-linux-x64-musl": {
"version": "15.5.27", "version": "16.4.0",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.5.27.tgz", "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.4.0.tgz",
"integrity": "sha512-ILl2bQ8MbpvyMpY8AXljb3BXs0MJSC8HXZ6QV5AWpVS7ZELqNPtrHvhUk+SNarvjvICXX8bCS287TCi+gUFVYg==", "integrity": "sha512-8d5WLS6a9YalqpOgXdlbvonFu+sIgjA+CO6tGzetrpPVcUL56foa7B7664h41rAlbLi5fJwK4vWji3zf4QDy+w==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@ -695,9 +695,9 @@
} }
}, },
"node_modules/@next/swc-win32-arm64-msvc": { "node_modules/@next/swc-win32-arm64-msvc": {
"version": "15.5.27", "version": "16.4.0",
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.5.27.tgz", "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.4.0.tgz",
"integrity": "sha512-1MB9Rh5y8TOPN2x7naNTJNkCZQav9c70AI7EBYXxsEewwOffC4DjjwBwKf20NBvcA+u+5jDv7nVmHxunlP2d7Q==", "integrity": "sha512-sQuOIiW3snb48UwrBcDMvFA/u03qtw2LeuSIxFIQ9AJuW9UG/4Ddsfo+eV73PnZwBhyncMtsKVh7PrzMol2/fA==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@ -711,9 +711,9 @@
} }
}, },
"node_modules/@next/swc-win32-x64-msvc": { "node_modules/@next/swc-win32-x64-msvc": {
"version": "15.5.27", "version": "16.4.0",
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.5.27.tgz", "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.4.0.tgz",
"integrity": "sha512-XtYgpGOswgnyBWXzOEG6q9RhvnSw0CEZ0MbWqCsl5PISgt9EzvJvNW5mU5n1PsphX/lnamzxjgQXH2GUJL8nqg==", "integrity": "sha512-6/33lCuxpdHUy27RegyGM/5uTpF7YZd3UR4D0gpkOA/tWY5YR7msbQjqPgCZmSmxrrTLGCXYA4A8vT2H5DPGTQ==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@ -869,9 +869,9 @@
} }
}, },
"node_modules/@swc/helpers": { "node_modules/@swc/helpers": {
"version": "0.5.15", "version": "0.5.23",
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.23.tgz",
"integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", "integrity": "sha512-5lSsMOTXURePglDfvuAQUqkGek9Hg2kksOYay2m0+XR++b2NWYL/4sWyuvVBIs8oKnJaxkdi9whaL/sqN13afw==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"tslib": "^2.8.0" "tslib": "^2.8.0"
@ -983,7 +983,6 @@
"version": "2.11.27", "version": "2.11.27",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.27.tgz", "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.27.tgz",
"integrity": "sha512-ElY12DaROGuan+lMmZ8Cvo/ZUbXPe7Enc/9VU/b1T3Kp4dwytRcNdR8DoSJN5SNJT/CuvcCA0DHDVmMOCePdRQ==", "integrity": "sha512-ElY12DaROGuan+lMmZ8Cvo/ZUbXPe7Enc/9VU/b1T3Kp4dwytRcNdR8DoSJN5SNJT/CuvcCA0DHDVmMOCePdRQ==",
"dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"bin": { "bin": {
"baseline-browser-mapping": "dist/cli.cjs" "baseline-browser-mapping": "dist/cli.cjs"
@ -1518,33 +1517,34 @@
} }
}, },
"node_modules/next": { "node_modules/next": {
"version": "15.5.27", "version": "16.4.0",
"resolved": "https://registry.npmjs.org/next/-/next-15.5.27.tgz", "resolved": "https://registry.npmjs.org/next/-/next-16.4.0.tgz",
"integrity": "sha512-F82CrlPZ8GRxBH9RIIoR3qU1t5RT3dv1K8moe8SjlDEquiFipvEI13R1Om90TaUOEwShkWCMlg8+gvTNzfMhvg==", "integrity": "sha512-N2C+9q89Z/oLrsepSRS4jRMtwmUZAoZuAHU0e9T6+sAB5DdhADmrnOW+zjYijlrYFmVfmQhGVGy9eMFoB7UgKg==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@next/env": "15.5.27", "@next/env": "16.4.0",
"@swc/helpers": "0.5.15", "@swc/helpers": "0.5.23",
"baseline-browser-mapping": "^2.9.19",
"caniuse-lite": "^1.0.30001579", "caniuse-lite": "^1.0.30001579",
"postcss": "8.4.31", "postcss": "8.5.23",
"styled-jsx": "5.1.6" "styled-jsx": "5.1.6"
}, },
"bin": { "bin": {
"next": "dist/bin/next" "next": "dist/bin/next"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^19.8.0 || >= 20.0.0" "node": ">=20.9.0"
}, },
"optionalDependencies": { "optionalDependencies": {
"@next/swc-darwin-arm64": "15.5.27", "@next/swc-darwin-arm64": "16.4.0",
"@next/swc-darwin-x64": "15.5.27", "@next/swc-darwin-x64": "16.4.0",
"@next/swc-linux-arm64-gnu": "15.5.27", "@next/swc-linux-arm64-gnu": "16.4.0",
"@next/swc-linux-arm64-musl": "15.5.27", "@next/swc-linux-arm64-musl": "16.4.0",
"@next/swc-linux-x64-gnu": "15.5.27", "@next/swc-linux-x64-gnu": "16.4.0",
"@next/swc-linux-x64-musl": "15.5.27", "@next/swc-linux-x64-musl": "16.4.0",
"@next/swc-win32-arm64-msvc": "15.5.27", "@next/swc-win32-arm64-msvc": "16.4.0",
"@next/swc-win32-x64-msvc": "15.5.27", "@next/swc-win32-x64-msvc": "16.4.0",
"sharp": "^0.34.3 || ^0.35.4" "sharp": "^0.35.4"
}, },
"peerDependencies": { "peerDependencies": {
"@opentelemetry/api": "^1.1.0", "@opentelemetry/api": "^1.1.0",
@ -1580,9 +1580,9 @@
} }
}, },
"node_modules/next/node_modules/postcss": { "node_modules/next/node_modules/postcss": {
"version": "8.4.31", "version": "8.5.23",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.23.tgz",
"integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "integrity": "sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg==",
"funding": [ "funding": [
{ {
"type": "opencollective", "type": "opencollective",
@ -1599,9 +1599,9 @@
], ],
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"nanoid": "^3.3.6", "nanoid": "^3.3.16",
"picocolors": "^1.0.0", "picocolors": "^1.1.1",
"source-map-js": "^1.0.2" "source-map-js": "^1.2.1"
}, },
"engines": { "engines": {
"node": "^10 || ^12 || >=14" "node": "^10 || ^12 || >=14"

View File

@ -6,14 +6,14 @@
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint" "typecheck": "tsc --noEmit"
}, },
"dependencies": { "dependencies": {
"@supabase/ssr": "^0.10.2", "@supabase/ssr": "^0.10.2",
"@supabase/supabase-js": "^2.104.1", "@supabase/supabase-js": "^2.104.1",
"bcryptjs": "^3.0.3", "bcryptjs": "^3.0.3",
"lucide-react": "^1.11.0", "lucide-react": "^1.11.0",
"next": "^15.5.27", "next": "^16.4.0",
"next-themes": "^0.4.6", "next-themes": "^0.4.6",
"nodemailer": "^10.0.15", "nodemailer": "^10.0.15",
"react": "^19.0.0", "react": "^19.0.0",

View File

@ -1,7 +1,7 @@
import { createServerClient } from "@supabase/ssr"; import { createServerClient } from "@supabase/ssr";
import { type NextRequest, NextResponse } from "next/server"; import { type NextRequest, NextResponse } from "next/server";
export async function middleware(request: NextRequest) { export async function proxy(request: NextRequest) {
let supabaseResponse = NextResponse.next({ request }); let supabaseResponse = NextResponse.next({ request });
const supabase = createServerClient( const supabase = createServerClient(

View File

@ -24,8 +24,8 @@ const config: Config = {
}, },
}, },
fontFamily: { fontFamily: {
sans: ["Inter", "system-ui", "sans-serif"], sans: ["var(--font-inter)", "Inter", "system-ui", "sans-serif"],
mono: ["JetBrains Mono", "Fira Code", "monospace"], mono: ["var(--font-mono)", "JetBrains Mono", "Fira Code", "monospace"],
}, },
animation: { animation: {
"fade-in": "fadeIn 0.6s ease-out forwards", "fade-in": "fadeIn 0.6s ease-out forwards",

View File

@ -1,7 +1,11 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "ES2017", "target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"], "lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"strict": true, "strict": true,
@ -11,7 +15,7 @@
"moduleResolution": "bundler", "moduleResolution": "bundler",
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"jsx": "preserve", "jsx": "react-jsx",
"incremental": true, "incremental": true,
"plugins": [ "plugins": [
{ {
@ -19,9 +23,20 @@
} }
], ],
"paths": { "paths": {
"@/*": ["./*"] "@/*": [
"./*"
]
} }
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "include": [
"exclude": ["node_modules", "modules"] "next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": [
"node_modules",
"modules"
]
} }