- Replace Vite + React Router with Next.js 15 App Router - Implement i18n with next-intl (URL-based: /de, /en, /sr) - Add SSR/SSG for all pages (48 static pages generated) - Setup Supabase SSR client for auth - Migrate all pages: Home, About, Portfolio, Blog, Contact, Login, Dashboard, Imprint, Privacy, Terms - Add Docker support with standalone output - Replace i18next with next-intl JSON translations - Use next/image for optimized images Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
46 lines
1.1 KiB
Plaintext
46 lines
1.1 KiB
Plaintext
// main.tsx
|
|
import { createRoot } from 'react-dom/client';
|
|
import { HelmetProvider } from 'react-helmet-async';
|
|
import App from './App';
|
|
import './index.css';
|
|
import './styles/mobile-optimizations.css';
|
|
import './styles/minimal-fixes.css';
|
|
import './i18n';
|
|
import { register as registerServiceWorker } from './utils/serviceWorkerRegistration';
|
|
import { reportWebVitals } from './utils/webVitals';
|
|
import { initializeFonts } from './utils/fontLoader';
|
|
|
|
// Typdefinition für Google Analytics
|
|
declare global {
|
|
interface Window {
|
|
dataLayer: unknown[];
|
|
gtag: (command: string, ...args: unknown[]) => void;
|
|
initializeAnalytics: () => void;
|
|
}
|
|
}
|
|
|
|
// Initialize fonts as early as possible
|
|
initializeFonts();
|
|
|
|
const rootElement = document.getElementById('root');
|
|
|
|
if (!rootElement) {
|
|
throw new Error('Root element not found');
|
|
}
|
|
|
|
createRoot(rootElement).render(
|
|
<HelmetProvider>
|
|
<App />
|
|
</HelmetProvider>
|
|
);
|
|
|
|
// Mark app as mounted to prevent flicker
|
|
requestAnimationFrame(() => {
|
|
document.body.classList.add('app-mounted');
|
|
});
|
|
|
|
// Register service worker
|
|
registerServiceWorker();
|
|
|
|
// Report Web Vitals
|
|
reportWebVitals(); |