Environment variables
Every setting in .env, what it does and when to change it. Everything else is set in Dashboard > Settings.
Copy .env.example to .env. Values that should not live in the database (secrets, keys, the address of the site) are here; the academy's name, contacts, payment switches, tax, bank details, instructor share and certificate signature are edited in Dashboard > Settings.
#Core
| Variable |
Default |
What it does |
DATABASE_URL |
file:./maarifa.db |
The database. SQLite file next to the schema, or a PostgreSQL URL (Requirements). |
SITE_URL |
http://localhost:3305 |
Public address, no trailing slash. Used for payment return links, certificate verification links, the sitemap and canonical URLs. Must start with https:// in production. |
AUTH_SECRET |
none |
Signs the dashboard and student session cookies. 32+ random characters. Changing it signs everyone out. |
ACADEMY_TIMEZONE |
Asia/Muscat |
Time zone for "this month" in the dashboard and for showing live session times. |
#First accounts and sample data
| Variable |
Default |
What it does |
ADMIN_EMAIL, ADMIN_PASSWORD |
admin@maarifa.test |
Create the first admin when the database has no dashboard account. |
DEMO_INSTRUCTOR_PASSWORD |
maarifa-teach-2026 |
The seed creates an INSTRUCTOR account for each sample instructor with this password. Empty = profiles without accounts. |
SEED_DEMO_STUDENT |
0 |
1 creates a demo learner with enrolments, progress, a certificate, orders and a conversation. |
DEMO_STUDENT_EMAIL, DEMO_STUDENT_PASSWORD |
student@maarifa.test |
The demo learner's sign-in. |
DEMO_HINT |
0 |
1 shows the demo sign-in details on the sign-in pages. Only for public demos. |
#Payments
| Variable |
Default |
What it does |
THAWANI_MODE |
uat |
uat for Thawani's test environment, live for real payments. |
THAWANI_SECRET_KEY, THAWANI_PUBLISHABLE_KEY |
empty |
Thawani keys. Card payment appears at checkout only when both are set, the switch is on in Settings and the currency is OMR. See Payments. |
#AI (optional)
| Variable |
Default |
What it does |
AI_BASE_URL |
empty |
Any OpenAI-compatible API, for example https://api.openai.com/v1 or a local Ollama http://localhost:11434/v1. Empty switches the AI features off. |
AI_API_KEY |
empty |
Sent as Authorization: Bearer ... when set. |
AI_MODEL |
gpt-4o-mini |
The model name your provider expects. |
See AI assistant.
#After changing .env
Restart the server (pm2 restart maarifa, or stop and start npm run dev). Variables are read when the server starts.