Add production observability: Sentry, pino, and sharp badge encoding.
Local Build and Deploy / deploy (push) Successful in 1m9s

Sentry is opt-in via DSN env vars; logger uses structured pino JSON in prod; badge uploads are normalized to GIF with sharp.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
SimoandCursor committed 2026-07-17 23:09:57 +02:00
1 parent 6c81af69ea
commit 09f1bc2bd6
16 files changed
+2206 -121

No files matched your search

+17 -1
View File
@@ -1,4 +1,5 @@
import type { NextConfig } from "next";
import { withSentryConfig } from "@sentry/nextjs";
import createNextIntlPlugin from "next-intl/plugin";
const securityHeaders = [
@@ -38,6 +39,9 @@ const nextConfig: NextConfig = {
"mariadb",
"@prisma/client",
"lzma",
"sharp",
"pino",
"pino-pretty",
],
// Compress responses with gzip
@@ -79,4 +83,16 @@ const nextConfig: NextConfig = {
// src/i18n/request.ts, so URLs and the access-guard middleware stay unchanged.
const withNextIntl = createNextIntlPlugin("./src/i18n/request.ts");
export default withNextIntl(nextConfig);
const config = withNextIntl(nextConfig);
export default withSentryConfig(config, {
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
silent: !process.env.CI,
widenClientFileUpload: true,
disableLogger: true,
sourcemaps: {
disable: !process.env.SENTRY_AUTH_TOKEN,
},
});