1ee8288c7e
Google Analytics integration, off by default and GDPR-compliant for EU:
- src/lib/analytics/gtag.ts: typed event helpers + consent control. Every
function is a safe no-op when NEXT_PUBLIC_GA_ID is unset.
- GoogleAnalytics.tsx: loads gtag.js with Consent Mode v2, all storage
defaulting to "denied". anonymize_ip on, send_page_view off.
- ConsentBanner.tsx: on-brand cookie banner, localized to all 5 locales,
persists choice for one year, flips analytics_storage to granted on accept.
- PageViewTracker.tsx: fires page_view on App Router client navigation
(inside Suspense for useSearchParams).
- Key conversion events wired: ai_consultation_submitted (primary funnel
goal) and ai_chat_opened.
- Consent strings added to messages/{en,it,vec,es,de}.json.
Build plumbing:
- NEXT_PUBLIC_GA_ID inlined at build time via Dockerfile ARG +
docker-compose build.args (NEXT_PUBLIC_* must exist during next build,
not just runtime).
- Nginx CSP extended to allow googletagmanager.com + google-analytics.com.
- env template documents NEXT_PUBLIC_GA_ID (empty = analytics disabled).
Verified: production build inlines the Measurement ID into the client
bundle; site builds cleanly both with and without the ID set.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
35 lines
1.6 KiB
Plaintext
35 lines
1.6 KiB
Plaintext
# Conexión local a SQLite
|
|
#DATABASE_URL="file:./dev.db"
|
|
|
|
# POSTGRES SQL CONEXION
|
|
#:xDATABASE_URL="postgresql://flux_user:STRONG_PASSWORD@postgres:5432/flux_db?schema=public"
|
|
DATABASE_URL="postgresql://flux_user:dev_password@localhost:5432/flux_db?schema=public"
|
|
|
|
# SESSION_SECRET (REQUIRED, min 32 chars).
|
|
# Used to sign 7-day admin JWTs in src/lib/session.ts and CSRF tokens in
|
|
# src/lib/csrf.ts. The app refuses to boot without it. Generate with:
|
|
# openssl rand -base64 48
|
|
SESSION_SECRET="CHANGE_ME_openssl_rand_base64_48_min_32_chars"
|
|
|
|
# Optional: multi-instance rate limiting via Upstash Redis REST API.
|
|
# Leave both unset to use the in-memory bucket store (fine for single VPS).
|
|
#REDIS_URL="https://xxx.upstash.io"
|
|
#REDIS_TOKEN="xxxxx"
|
|
|
|
# Google Analytics 4 Measurement ID (format: G-XXXXXXXXXX).
|
|
# Leave empty to disable analytics entirely — the site loads no Google
|
|
# scripts and the consent banner stays hidden until this is set.
|
|
NEXT_PUBLIC_GA_ID=""
|
|
|
|
# OPEN AI KEY
|
|
OPENAI_API_KEY=sk-proj-dsdsdsds-kaDAHhZXPYsK6-4uw0UWJZ0YuLnQfVoEA
|
|
|
|
NEXT_PUBLIC_APP_URL=http://localhost:3000 # En producción será https://www.rf-flux.com
|
|
|
|
#email Config
|
|
SMTP_HOST=smtp.gmail.com # (or smtp.office365.com, mail.fluxsrl.com, etc.)
|
|
SMTP_PORT=587 #(587 for TLS, 465 for SSL)
|
|
SMTP_USER=davidherran@dreamhousestudios.co
|
|
SMTP_PASS=syzybrtcidrkzehp #(Gmail: use App Password, not regular password)
|
|
SMTP_FROM=FLUX Operations <davidherran@dreamhousestudios.co>
|
|
SMTP_SECURE=false # (true for port 465, false for 587 with STARTTLS) |