Create environment file
Copy the example file
Biovity includes an
.env.example file with all required variables. Copy it to create your local environment file:Next.js automatically loads
.env.local for local development. This file should never be committed to version control.Configure database connection
Update the Replace:
DATABASE_URL with your PostgreSQL credentials:.env.local
user- Your PostgreSQL usernamepassword- Your PostgreSQL passwordhost- Database host (uselocalhostfor local development)5432- PostgreSQL port (default is 5432)database- Your database name
Generate authentication secret
Better Auth requires a secret key for signing tokens. Generate one using OpenSSL:Copy the output and add it to your
.env.local:.env.local
Configure public URLs
Set the public-facing URLs for your application:
.env.local
Variables prefixed with
NEXT_PUBLIC_ are exposed to the browser. Only use this prefix for non-sensitive values.Complete environment file
Your final.env.local should look like this:
.env.local
Environment variables reference
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | PostgreSQL connection string |
BETTER_AUTH_SECRET | Yes | Secret key for authentication tokens |
BETTER_AUTH_URL | Yes | Base URL for authentication callbacks |
NEXT_PUBLIC_APP_URL | Yes | Public application URL |
NEXT_PUBLIC_SITE_URL | Yes | Production site URL |
NODE_ENV | No | Node environment (development/production) |