Environment Setup

Learn how to set up Arunya's environment.

Arunya uses environment variables to configure the application, database, and other services. These values are loaded from a .env file in the project root.


1. Create the Environment File

Copy the example file to get started:

cp .env.example .env

2. Configure Core Environment Variables

Open the .env file and update the values to match your local or production environment.

# The base URL of your deployment (e.g., http://localhost:3000 or https://analytics.example.com)
BASE_URL=http://localhost:3000

# PostgreSQL connection string
DATABASE_URL=postgresql://username:password@localhost:5432/arunya?schema=public

# JWT secret key used for authentication and session handling
JWT_KEY=your-secure-jwt-secret

3. DATABASE_URL Format

The DATABASE_URL must follow this format:

postgresql://<user>:<password>@<host>:<port>/<database>?schema=public

Example:

DATABASE_URL=postgresql://arunya_user:strongpass@localhost:5432/arunya?schema=public

4. ADMIN_EMAIL

The ADMIN_EMAIL is used to identify the admin user in the database.

ADMIN_EMAIL=admin@example.com

5. ADMIN_PASSWORD

The ADMIN_PASSWORD is used to identify the admin user in the database.

ADMIN_PASSWORD=your-secure-admin-password

6. Recommendations for Production

In production:

  • Use a strong and unique JWT_KEY.
  • Ensure the BASE_URL matches your deployed domain.
  • Use environment management provided by your hosting platform or deployment pipeline.

After setting up the .env, you can continue with Prisma migrations or start the application with:

npm run dev

Need help setting up PostgreSQL or deploying Arunya? See the Deployment Guide.