# ===================================================================
# ENVIRONMENT VARIABLES FOR FREND NEXT.JS PLAYGROUND
# ===================================================================
# Copy this file to .env.local and update values as needed
# ===================================================================

# Application Settings
NODE_ENV=development
PORT=3000

# ===================================================================
# KEYCLOAK AUTHENTICATION (DISABLED BY DEFAULT)
# ===================================================================
# To enable: Set KEYCLOAK_ENABLED=true and configure values below
# See ENABLE_KEYCLOAK.md for complete setup instructions
# ===================================================================

# Enable/Disable Keycloak
KEYCLOAK_ENABLED=false

# Keycloak Configuration (uncomment when KEYCLOAK_ENABLED=true)
# KEYCLOAK_CLIENT_ID=frend-next-playground
# KEYCLOAK_CLIENT_SECRET=your-client-secret-from-keycloak
# KEYCLOAK_ISSUER=http://localhost:8480/realms/customers

# NextAuth.js Configuration (uncomment when KEYCLOAK_ENABLED=true)
# NEXTAUTH_URL=http://localhost:8420
# NEXTAUTH_SECRET=generate-with-openssl-rand-base64-32

# ===================================================================
# DOCUMENT TYPE AUTHENTICATION POLICIES
# ===================================================================
# Configure which document types require authentication when enabled
# Use comma-separated lists (no spaces)
# Defaults are used if not specified
# ===================================================================

# Always require authentication (private: payslips, contracts)
# DOC_ALWAYS_PROTECTED=payslips,pay-stubs,contracts,tax-documents,hr-documents

# Allow public access with magic token (email links: invoices, receipts)
# DOC_PUBLIC_WITH_TOKEN=invoices,receipts,delivery-notes,quotes

# Always public - no auth needed (marketing materials)
# DOC_ALWAYS_PUBLIC=marketing,brochures

# ===================================================================
# DATAPALLAS API CONFIGURATION
# ===================================================================
# DataPallas server configuration for accessing reports and data
# The API key is auto-discovered from api-key.txt or defaults to '123' for development
# ===================================================================

# DataPallas API Base URL (default: http://localhost:9090)
NEXT_PUBLIC_RB_API_BASE_URL=http://localhost:9090

# DataPallas API Key (optional - auto-discovered from api-key.txt file)
# NEXT_PUBLIC_RB_API_KEY=your-api-key-here
# DATAPALLAS_API_KEY=your-api-key-here

# ===================================================================
# DATABASE CONFIGURATION (Prisma ORM)
# ===================================================================
# SQLite is the default - works out of the box!
# To switch to MySQL, see prisma/schema.prisma for instructions.
# ===================================================================

# OPTION 1: SQLite (DEFAULT - No setup required)
DATABASE_URL="file:./data/app.db"

# OPTION 2: MySQL (Uncomment below, comment out SQLite above)
# Also update prisma/schema.prisma to use mysql provider
# DATABASE_URL="mysql://username:password@localhost:3306/flowkraft"
#
# MySQL Quick Setup:
# 1. Edit prisma/schema.prisma - comment sqlite, uncomment mysql
# 2. Uncomment the MySQL DATABASE_URL above
# 3. Run: npx prisma db push
# 4. Run: npx prisma generate

# ===================================================================
# PAYMENT PROCESSING
# ===================================================================
# Configure Stripe and PayPal for invoice payments.
# Get test API keys from:
# - Stripe: https://dashboard.stripe.com/test/apikeys
# - PayPal: https://developer.paypal.com/dashboard/applications/sandbox
# ===================================================================

# Application URL (used for payment callbacks)
NEXT_PUBLIC_APP_URL=http://localhost:8420

# --- Stripe Configuration ---
# Publishable key (safe for client-side)
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_your_publishable_key_here

# Secret key (server-side only - NEVER expose to client)
STRIPE_SECRET_KEY=sk_test_your_secret_key_here

# --- PayPal Configuration ---
# Client ID (safe for client-side)
NEXT_PUBLIC_PAYPAL_CLIENT_ID=your_paypal_client_id_here

# Client Secret (server-side only)
PAYPAL_CLIENT_SECRET=your_paypal_client_secret_here

# Use sandbox mode (set to "true" for testing, "false" for production)
PAYPAL_SANDBOX=true
