// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
    compatibilityDate: '2025-07-15',
    srcDir: 'app',
    devtools: { enabled: true },
    auth: {
        // Full auth endpoint URL (origin + /api/auth). This prevents /session recursion.
        // Prefer setting AUTH_ORIGIN in your environment (e.g. https://example.com)
        baseURL: `${(
            process.env.AUTH_ORIGIN ||
            process.env.BASE_SITE_URL ||
            `http://localhost:${process.env.PORT || 3000}`
        ).replace(/\/$/, '')}/api/auth`,
    },
    turnstile: {
        siteKey: process.env.CLOUD_FLARE_SITE_KEY,
    },
    runtimeConfig: {
        //private (server-side only - güvenli)
        turnstile: {
            // This can be overridden at runtime via the NUXT_TURNSTILE_SECRET_KEY
            // environment variable.
            secretKey: process.env.CLOUD_FLARE_SECRET,
        },
        yourOrigin: "",
        apiSecret: "",
        authOrigin: process.env.AUTH_ORIGIN,
        jwtSecret: process.env.JWT_SECRET,
        googleToken: process.env.NUXT_GOOGLE_TOKEN,
        authSecret: process.env.NUXT_AUTH_SECRET,
        githubClientId: process.env.GITHUB_CLIENT_ID,
        githubClientSecret: process.env.GITHUB_CLIENT_SECRET,
        googleClientId: process.env.GOOGLE_CLIENT_ID,
        googleClientSecret: process.env.GOOGLE_CLIENT_SECRET,
        public: {
            //public (client-side accessible)
            BASE_API_URL: process.env.NUXT_PUBLIC_API_BASE,
            BASE_SITE_URL: process.env.NUXT_PUBLIC_API_BASE,
            yourOrigin: "",
            apiBase: "",
        },
    },
    modules: [
        //'@nuxt/content',
        '@nuxt/a11y',
        '@nuxt/eslint',
        '@nuxt/fonts',
        '@nuxt/hints',
        '@nuxt/icon',
        '@nuxt/image',
        '@nuxt/scripts',
        "@sidebase/nuxt-auth",
        "@pinia/nuxt",
        '@nuxtjs/turnstile',
    ],
    app: {
        head: {
            title: 'Avigo Multipurpose Theme',
            meta: [
                { charset: 'utf-8' },
                { name: 'viewport', content: 'width=device-width, initial-scale=1.0' },
            ],
            link: [
                { rel: 'stylesheet', href: '/assets/css/bootstrap.min.css' },
                { rel: 'stylesheet', href: '/assets/css/font-awesome-pro.css' },
                { rel: 'stylesheet', href: '/assets/css/magnific-popup.css' },
                { rel: 'stylesheet', href: '/assets/css/owl.carousel.min.css' },
                { rel: 'stylesheet', href: '/assets/css/slick-slider.css' },
                { rel: 'stylesheet', href: '/assets/css/meanmenu.css' },
                { rel: 'stylesheet', href: '/assets/css/typography.css' },
                { rel: 'stylesheet', href: '/assets/css/preloader.css' },
                { rel: 'stylesheet', href: '/assets/css/mobile-menu.css' },
                { rel: 'stylesheet', href: '/assets/css/header.css' },
                { rel: 'stylesheet', href: '/assets/css/footer.css' },
                { rel: 'stylesheet', href: '/assets/css/aos.css' },
                { rel: 'stylesheet', href: '/assets/css/fonts.css' },
                { rel: 'stylesheet', href: '/assets/css/blog-page.css' },
                { rel: 'stylesheet', href: '/assets/css/nice-select.css' },
                { rel: 'stylesheet', href: '/assets/css/modal-video.min.css' },
                { rel: 'stylesheet', href: '/assets/css/responsive.css' },
                { rel: 'stylesheet', href: '/assets/css/comon.css' },
                { rel: 'stylesheet', href: '/assets/css/avigo-unit.css' },
                { rel: 'stylesheet', href: '/assets/css/avigo-core.css' },
                { rel: 'stylesheet', href: '/style.css' }
            ],
            script: [
                { src: '/assets/js/jquery-3-6-0.min.js', defer: true },
                { src: '/assets/js/bootstrap.min.js', defer: true },
                // fontawesome will be loaded client-side via a plugin to avoid SSR hydration mismatches
                { src: '/assets/js/owl.carousel.min.js', defer: true },
                { src: 'https://unpkg.com/aos@next/dist/aos.js', defer: true, crossorigin: 'anonymous' },
                { src: '/assets/js/jquery.magnific-popup.min.js', defer: true },
                { src: 'https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.min.js', defer: true, crossorigin: 'anonymous' },
                { src: 'https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js', defer: true, integrity: 'sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3', crossorigin: 'anonymous' },
                { src: '/assets/js/slick-slider.js', defer: true },
                { src: '/assets/js/mobile-menu.js', defer: true },
                { src: '/assets/js/tilt.jquery.js', defer: true },
                { src: '/assets/js/jquery.lineProgressbar.js', defer: true },
                { src: '/assets/js/jquery.nice-select.js', defer: true },
                { src: '/assets/js/mobile-meanmenu.js', defer: true },
                { src: '/assets/js/modal-video.min.js', defer: true },
                { src: '/assets/js/main.js', defer: true },
            ]
        }
    },
    vite: {
        build: {
            sourcemap: false,
        },
    },
})