Environment Variables
Lokus reads environment variables from a .env file in the project root. Copy the example file to get started:
cp .env.example .envVariable Reference
Section titled “Variable Reference”VITE_AUTH_BASE_URL
Section titled “VITE_AUTH_BASE_URL”Base URL for the authentication backend.
| Mode | Default |
|---|---|
Development (npm run dev) | http://localhost:3000 |
Production (npm run build) | https://lokusmd.com |
VITE_AUTH_BASE_URL=https://lokusmd.comUsed for sign-up, sign-in, OAuth flows, email confirmation links, and profile management. The value is baked into the frontend at build time.
AUTH_BASE_URL
Section titled “AUTH_BASE_URL”Rust-side equivalent of VITE_AUTH_BASE_URL. Automatically matches the frontend value. Override only if the backend needs a different endpoint.
GOOGLE_CLIENT_ID
Section titled “GOOGLE_CLIENT_ID”Google OAuth Client ID for Gmail integration. Required only if you enable Gmail features.
GOOGLE_CLIENT_ID=your_client_id_hereCreate one at Google Cloud Console > Credentials > OAuth 2.0 Client IDs. Set application type to “Desktop application” and add http://localhost:8080/gmail-callback as an authorized redirect URI.
GOOGLE_CLIENT_SECRET
Section titled “GOOGLE_CLIENT_SECRET”Google OAuth Client Secret. Paired with GOOGLE_CLIENT_ID above.
GOOGLE_CLIENT_SECRET=your_client_secret_hereVITE_ENABLE_CRASH_REPORTS
Section titled “VITE_ENABLE_CRASH_REPORTS”Enable Sentry crash reporting. Default: false.
VITE_ENABLE_CRASH_REPORTS=trueTAURI_SENTRY_DSN
Section titled “TAURI_SENTRY_DSN”Sentry DSN for the Rust backend. Only used when VITE_ENABLE_CRASH_REPORTS is true.
TAURI_SENTRY_DSN=https://your-dsn@sentry.io/project-idVITE_SENTRY_ENVIRONMENT
Section titled “VITE_SENTRY_ENVIRONMENT”Sentry environment label. Default: production.
VITE_SENTRY_ENVIRONMENT=stagingVITE_DISABLE_UPDATE_CHECKER
Section titled “VITE_DISABLE_UPDATE_CHECKER”Disable the auto-update check. Used for App Store builds where updates go through the store.
VITE_DISABLE_UPDATE_CHECKER=trueDevelopment vs Production
Section titled “Development vs Production”In development (npm run dev), Vite reads the .env file and injects VITE_-prefixed variables into the frontend. The Rust backend loads .env via dotenvy at startup.
In production (npm run build), VITE_-prefixed variables are baked into the JavaScript bundle at build time. Changing them after the build has no effect — you must rebuild.
Security
Section titled “Security”- Never commit
.envfiles with real credentials. The.gitignorealready excludes.env. - Rotate credentials immediately if they are accidentally exposed.
- Use
.env.examplefor documenting variable names without real values.