Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ashcroft08/provesa-web/llms.txt

Use this file to discover all available pages before exploring further.

This guide documents all environment variables required to configure PROVESA Web. These variables are defined in your .env file at the project root.

Quick Setup

  1. Copy the example environment file:
    cp .env.example .env
    
  2. Edit .env and fill in your values for each variable.

Database Configuration

DATABASE_URL
string
required
PostgreSQL database connection string in the format:
postgres://user:password@host:port/db-name
Example:
DATABASE_URL="postgres://provesa_user:securepass@localhost:5432/provesa_db"
This is used by Drizzle ORM to connect to your PostgreSQL database. See Database Setup for more details.

Application Configuration

ORIGIN
string
required
The base URL where your application is hosted. This is used by Better Auth for session management and authentication flows.Development:
ORIGIN="http://localhost:5173"
Production:
ORIGIN="https://provesa.com"

Authentication

BETTER_AUTH_SECRET
string
required
Secret key for Better Auth session encryption and token signing. Must be 32 characters minimum and generated with high entropy for production.Generate a secure secret:
openssl rand -base64 32
Example:
BETTER_AUTH_SECRET="dGhpc2lzYXZlcnlzZWN1cmVzZWNyZXRrZXkxMjM0NTY3OA=="
See Better Auth documentation for more details.

Email Configuration

GMAIL_USER
string
required
Gmail email address used to send password recovery emails via Nodemailer.Example:
GMAIL_USER="no-reply@provesa.com"
See Email Setup for complete Gmail configuration.
GMAIL_APP_PASSWORD
string
required
Gmail App Password (not your regular Gmail password) for SMTP authentication. This is a 16-character password generated in your Google Account settings.Example:
GMAIL_APP_PASSWORD="abcd efgh ijkl mnop"
Important: You must enable 2-factor authentication on your Google Account to generate App Passwords. See Email Setup for step-by-step instructions.

Admin Seed Configuration

These variables are used to create the initial administrator account when seeding the database.
ADMIN_NAME
string
default:"Administrador"
Display name for the default administrator account.Example:
ADMIN_NAME="Administrador"
ADMIN_EMAIL
string
default:"admin@provesa.com"
Email address for the default administrator account. This will be used to log in.Example:
ADMIN_EMAIL="admin@provesa.com"
ADMIN_PASSWORD
string
required
Password for the default administrator account. Choose a strong password for production environments.Example:
ADMIN_PASSWORD="SecureP@ssw0rd123!"
Security Note: Change this password immediately after first login in production.

Example .env File

Here’s a complete example with all required variables:
# Database
DATABASE_URL="postgres://provesa_user:securepass@localhost:5432/provesa_db"

# Application
ORIGIN="http://localhost:5173"

# Better Auth (generate with: openssl rand -base64 32)
BETTER_AUTH_SECRET="dGhpc2lzYXZlcnlzZWN1cmVzZWNyZXRrZXkxMjM0NTY3OA=="

# Gmail credentials for password recovery
GMAIL_USER="no-reply@provesa.com"
GMAIL_APP_PASSWORD="abcd efgh ijkl mnop"

# Admin seed (for initial setup)
ADMIN_NAME="Administrador"
ADMIN_EMAIL="admin@provesa.com"
ADMIN_PASSWORD="SecureP@ssw0rd123!"

Validation

The application validates environment variables at startup:
  • DATABASE_URL - Checked in drizzle.config.js:3 and src/lib/server/db/index.js:6
  • If DATABASE_URL is missing, the application throws: DATABASE_URL is not set

Next Steps

Build docs developers (and LLMs) love