From b05a21350c6545655dc90c192b78e0e5b81648df Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Sun, 18 Jan 2026 15:37:51 +0100 Subject: [PATCH] umami, glitchtip, redis --- .eslintignore | 5 + .eslintrc.json | 12 + README.md | 17 +- app/[locale]/layout.tsx | 8 + components/analytics/AnalyticsProvider.tsx | 20 + components/analytics/UmamiScript.tsx | 19 + docker-compose.yml | 44 +- eslint.config.mjs | 36 - instrumentation.ts | 17 + lib/services/analytics/analytics-service.ts | 10 + .../analytics/noop-analytics-service.ts | 11 + .../analytics/umami-analytics-service.ts | 32 + lib/services/app-services.ts | 12 + lib/services/cache/cache-service.ts | 10 + lib/services/cache/memory-cache-service.ts | 30 + lib/services/cache/redis-cache-service.ts | 49 + lib/services/create-services.ts | 44 + .../errors/error-reporting-service.ts | 16 + .../glitchtip-error-reporting-service.ts | 53 + .../errors/noop-error-reporting-service.ts | 18 + next.config.mjs | 25 +- package-lock.json | 3291 +++++++++++++++-- package.json | 8 +- sentry.client.config.ts | 10 + sentry.edge.config.ts | 10 + sentry.server.config.ts | 10 + tsconfig.tsbuildinfo | 2 +- types/redis.d.ts | 22 + types/sentry-nextjs.d.ts | 43 + 29 files changed, 3568 insertions(+), 316 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.json create mode 100644 components/analytics/AnalyticsProvider.tsx create mode 100644 components/analytics/UmamiScript.tsx delete mode 100644 eslint.config.mjs create mode 100644 instrumentation.ts create mode 100644 lib/services/analytics/analytics-service.ts create mode 100644 lib/services/analytics/noop-analytics-service.ts create mode 100644 lib/services/analytics/umami-analytics-service.ts create mode 100644 lib/services/app-services.ts create mode 100644 lib/services/cache/cache-service.ts create mode 100644 lib/services/cache/memory-cache-service.ts create mode 100644 lib/services/cache/redis-cache-service.ts create mode 100644 lib/services/create-services.ts create mode 100644 lib/services/errors/error-reporting-service.ts create mode 100644 lib/services/errors/glitchtip-error-reporting-service.ts create mode 100644 lib/services/errors/noop-error-reporting-service.ts create mode 100644 sentry.client.config.ts create mode 100644 sentry.edge.config.ts create mode 100644 sentry.server.config.ts create mode 100644 types/redis.d.ts create mode 100644 types/sentry-nextjs.d.ts diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..25a6f26c --- /dev/null +++ b/.eslintignore @@ -0,0 +1,5 @@ +.next/ +node_modules/ +reference/ +public/ +dist/ diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..6a15a482 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,12 @@ +{ + "extends": ["next/core-web-vitals", "next/typescript"], + "rules": { + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unused-vars": "warn", + "@typescript-eslint/no-require-imports": "off", + "prefer-const": "warn", + "react/no-unescaped-entities": "off", + "@next/next/no-img-element": "warn" + } +} + diff --git a/README.md b/README.md index 00d1accd..38577796 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,20 @@ SITE_URL=https://klz-cables.com RESEND_API_KEY=your_resend_key TURNSTILE_SITE_KEY=your_turnstile_key TURNSTILE_SECRET_KEY=your_turnstile_secret -VERCEL_ANALYTICS_ID=your_analytics_id + +# Umami +NEXT_PUBLIC_UMAMI_WEBSITE_ID=your_umami_website_id +NEXT_PUBLIC_UMAMI_SCRIPT_URL=https://analytics.infra.mintel.me/script.js + +# GlitchTip (Sentry compatible) +SENTRY_DSN=https://PUBLIC_KEY@errors.infra.mintel.me/PROJECT_ID +NEXT_PUBLIC_SENTRY_DSN=https://PUBLIC_KEY@errors.infra.mintel.me/PROJECT_ID + +# Redis (optional cache) +# Platform provides a shared redis container reachable as `redis`. +# Pick a dedicated DB index per app, e.g. redis://redis:6379/2 +REDIS_URL=redis://redis:6379/2 +REDIS_KEY_PREFIX=klz: ``` ## 📊 Project Overview @@ -346,4 +359,4 @@ Proprietary - KLZ Cables **Status**: ✅ **READY FOR DEPLOYMENT** **Version**: 1.0.0 -**Last Updated**: December 27, 2025 \ No newline at end of file +**Last Updated**: December 27, 2025 diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index f2640d5c..5205a68a 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -3,6 +3,8 @@ import {getMessages, getTranslations} from 'next-intl/server'; import '../../styles/globals.css'; import Header from '@/components/Header'; import Footer from '@/components/Footer'; +import UmamiScript from '@/components/analytics/UmamiScript'; +import AnalyticsProvider from '@/components/analytics/AnalyticsProvider'; import { Metadata, Viewport } from 'next'; export async function generateMetadata({params: {locale}}: {params: {locale: string}}): Promise { @@ -79,6 +81,12 @@ export default async function LocaleLayout({