// Check environment on startup
const hasDatabase = !!(process.env.DATABASE_URL || process.env.POSTGRES_URL)
const hasBlob = !!process.env.BLOB_READ_WRITE_TOKEN

if (!hasDatabase) {
  console.warn(`
╔══════════════════════════════════════════════════════════════╗
║  WARNING: No database connection configured                  ║
╠══════════════════════════════════════════════════════════════╣
║  This app requires Neon PostgreSQL to function.              ║
║                                                              ║
║  To fix:                                                     ║
║  1. Copy .env.example to .env.local                          ║
║  2. Set POSTGRES_URL with your Neon connection string        ║
║  3. Restart the dev server                                   ║
║                                                              ║
║  Get credentials from:                                       ║
║  - Vercel Project Settings > Environment Variables           ║
║  - Or https://console.neon.tech                              ║
╚══════════════════════════════════════════════════════════════╝
`)
}

/** @type {import('next').NextConfig} */
const nextConfig = {
  typescript: {
    ignoreBuildErrors: true,
  },
  images: {
    unoptimized: true,
    remotePatterns: [
      {
        protocol: 'https',
        hostname: '**.public.blob.vercel-storage.com',
      },
      {
        protocol: 'https',
        hostname: 'blob.v0.app',
      },
    ],
  },
  experimental: {
    serverActions: {
      bodySizeLimit: '100mb',
    },
  },
  compress: true,
  poweredByHeader: false,
  reactStrictMode: true,
}

export default nextConfig
