# =====================================================================
# ATAPOLY CBT — Backend Environment Variables
# =====================================================================
# Copy this file to `.env` on each deployment and fill in values.
# The SAME backend code runs on cPanel (online) and on the lab PC (offline).
# Only the values below differ between the two.
# =====================================================================

# ---- Core ----
NODE_ENV=production
PORT=3001

# ---- PostgreSQL ----
# cPanel:   host=localhost (or cPanel-provided), user/db created in cPanel
# Local:    host=localhost, user/db created by the local Postgres install
# Docker:   host=db (the name of the DB service in docker-compose), user/db created by init.js
PGHOST=localhost
PGPORT=5432
PGUSER=cbt_admin
PGPASSWORD=cbt_password
PGDATABASE=atapoly_cbt
DB_SSL=false


# =====================================================================
# SYNC (only set on the LOCAL/offline backend)
# =====================================================================
# Point the local backend at the cPanel deployment.
# Leave BLANK on the cPanel backend — cPanel only RECEIVES syncs.
ONLINE_SERVER_URL=https://atapolycbt.atapolysdc.org.ng

# How often (ms) the local backend pushes/pulls. Default 5 hours.
SYNC_INTERVAL=18000000

# =====================================================================
# LICENSE (set on BOTH; usually the same value)
# =====================================================================
# URL of the license validation endpoint on the cPanel backend.
# Local backends call this to refresh their cached license.
LICENSE_VALIDATE_URL=https://atapolycbt.atapolysdc.org.ng/api/license/validate

# ---- Auth ----
JWT_SECRET=e9171b517733163a90962376a81d5a761150d0f305db6c62b5aef3a56d32a2f986ca9215c7a8f0159551b6120db91bd3

# Shared secret. MUST be identical on local and cPanel `.env` files.
SYNC_TOKEN=3d56f4d53bb6f93257d039d9a21bfc05c558685a9e3bef8275bd4bc58db5f478fd7e41c71636cc53faa1dd70e1fc3030

# =====================================================================
# AI question generation (Gemini) — set on cPanel only
# =====================================================================
GEMINI_API_KEY=
