Configure the three .env files that control Docker services, the Laravel backend, and the Nuxt frontend.
SaaS4Builders uses three .env files, each controlling a different part of the stack. The make install command creates these files automatically from their .example templates, but you will need to customize them — especially for Stripe billing and OAuth providers.
The root .env is read by Docker Compose to configure containers and pass environment variables into them. The backend/.env and frontend/.env are read by the Laravel and Nuxt applications running inside those containers.
In production, set APP_ENV=production, APP_DEBUG=false, and both URLs to your actual domains. See the Deployment Guide for the full production checklist.
The queue worker runs in a separate Docker container (saas-queue). Jobs dispatched by the application are stored in Redis and processed asynchronously.
Critical for production: This must exactly match your frontend domain (including port if non-standard). Example: app.yourdomain.com. If this is wrong, authentication will silently fail.
Comma-separated list of enabled providers (e.g., google,github)
GOOGLE_CLIENT_ID
(empty)
Google OAuth client ID
GOOGLE_CLIENT_SECRET
(empty)
Google OAuth client secret
GOOGLE_REDIRECT_URI
${APP_URL}/api/v1/auth/oauth/google/callback
Google OAuth callback URL
GITHUB_CLIENT_ID
(empty)
GitHub OAuth client ID
GITHUB_CLIENT_SECRET
(empty)
GitHub OAuth client secret
GITHUB_REDIRECT_URI
${APP_URL}/api/v1/auth/oauth/github/callback
GitHub OAuth callback URL
OAuth is optional. Leave OAUTH_PROVIDERS empty to disable social login entirely. To enable a provider, add its name to the list and fill in the credentials.
In the Docker setup, the Node container receives two API URLs from docker-compose.yml: NUXT_API_BASE_URL=http://nginx:80 for server-side rendering and NUXT_PUBLIC_API_BASE_URL=http://localhost:8000 for client-side requests. These Docker-level variables override what's in frontend/.env.
Auth mode: cookie (Sanctum SPA) or token (Bearer tokens)
The default cookie mode uses Sanctum's cookie-based SPA authentication. This is recommended for the built-in frontend. Use token mode if you are building a separate client application.
The default header mode sends the tenant ID in an X-Tenant-ID HTTP header with every API request. Other modes (path, subdomain) are available for different URL strategies.
These are only needed for Nuxt Studio integration. Studio uses the application's existing Sanctum authentication — no separate OAuth setup is required.
The make install command copies the same .example templates, so values are consistent by default. If you change a shared variable, update it in all relevant files.