Getting Started

Configuration

PortfoliX uses environment variables to manage configuration. These are stored in the .env file in the root directory.

Essential Variables

| Variable | Description | Example | | :--- | :--- | :--- | | DATABASE_URL | PostgreSQL connection string | postgresql://user:pass@localhost:5432/portfolix | | NEXTAUTH_SECRET | Secret key for session encryption | Generate with openssl rand -base64 32 | | NEXTAUTH_URL | The full URL of your site | https://yourdomain.com |

AI Configuration (Optional)

To enable the AI Assistant, add keys for your preferred providers. You only need one, but can add multiple.

# OpenAI
OPENAI_API_KEY=sk-...

# Anthropic (Claude)
ANTHROPIC_API_KEY=sk-ant-...

# Google Gemini
GOOGLE_API_KEY=AIza...

Email Configuration (SMTP)

Required for the contact form to send emails.

SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your@email.com
SMTP_PASSWORD=your_app_password
SMTP_FROM=noreply@yourdomain.com

Analytics (Optional)

Integrate third-party analytics tools.

NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX  # Google Analytics 4
NEXT_PUBLIC_HOTJAR_ID=123456    # Hotjar Site ID