> ## Documentation Index
> Fetch the complete documentation index at: https://docs.startmyvpn.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Environment variables and application settings reference.

## Environment file (`.env`)

The `.env` file at the project root controls all runtime configuration. Below is a complete reference.

### Application

```ini theme={null}
APP_NAME="StartMyVPN"
APP_ENV=production          # local | production
APP_DEBUG=false             # Never true in production
APP_URL=https://yourdomain.com
APP_KEY=                    # Generated by: php artisan key:generate
```

### Database

```ini theme={null}
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=startmyvpn
DB_USERNAME=your_db_user
DB_PASSWORD=your_db_password
```

SQLite is supported for development:

```ini theme={null}
DB_CONNECTION=sqlite
# DB_DATABASE defaults to database/database.sqlite
```

### Mail

```ini theme={null}
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=your_smtp_user
MAIL_PASSWORD=your_smtp_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=noreply@yourdomain.com
MAIL_FROM_NAME="${APP_NAME}"
```

For local development, use `log` as the mailer to write emails to the log file instead of sending them:

```ini theme={null}
MAIL_MAILER=log
```

### Queues

```ini theme={null}
QUEUE_CONNECTION=database   # database | redis
```

For higher throughput, use Redis:

```ini theme={null}
QUEUE_CONNECTION=redis
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=null
REDIS_CLIENT=predis          # predis | phpredis
```

### Cache

```ini theme={null}
CACHE_STORE=file             # file | redis | database
```

### Security

```ini theme={null}
BCRYPT_ROUNDS=12             # Password hashing rounds (10-14 recommended)
RECAPTCHA_SECRET=            # Optional: Google reCAPTCHA v3 secret
```

### Payment gateways

Payment gateway credentials are stored in the **Admin → Settings → Payments** panel rather than in `.env`, with the exception of PayPal:

```ini theme={null}
PAYPAL_MODE=live             # sandbox | live
PAYPAL_LIVE_CLIENT_ID=
PAYPAL_LIVE_CLIENT_SECRET=
PAYPAL_CURRENCY=USD
PAYPAL_WEBHOOK_ID=
```

### Social login (Google)

```ini theme={null}
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT_URI=https://yourdomain.com/auth/google/callback
```

### Logging

```ini theme={null}
LOG_CHANNEL=stack            # stack | single | daily
LOG_LEVEL=warning            # debug | info | warning | error
```

Optional integration with Better Stack (Logtail):

```ini theme={null}
LOG_CHANNEL=betterstack
BETTER_STACK_SOURCE_TOKEN=your_token
```

***

## In-app settings

After installation, most configuration is managed through the admin panel at **Admin → Settings**:

| Section  | What you configure                                       |
| -------- | -------------------------------------------------------- |
| General  | App name, support email, logo, landing page content      |
| Email    | SMTP credentials (overrides `.env` at runtime)           |
| Payments | Stripe keys, PayPal sandbox/live toggle, CryptAPI config |
| Social   | Google OAuth credentials, enable/disable social login    |
| API      | API rate limits and API-level toggles                    |

<Tip>
  Settings stored in the database take precedence over `.env` values for email and payment credentials. You only need `.env` for the initial setup.
</Tip>
