Environment variables

Every setting in .env, what it does and what happens when it is empty.

Settings that change rarely and secrets live in .env (copied from .env.example). Everything the owner changes day to day (name, hours, prices, payment methods) is in Dashboard > Settings and stored in the database. Restart the server after editing .env.

Required

Variable Example What it does
DATABASE_URL file:./sufra.db Database. A path is SQLite (relative to prisma/); postgresql://... for PostgreSQL (how).
AUTH_SECRET 64 hex characters Signs the staff session cookie. At least 16 characters, 32+ recommended. Changing it signs everyone out.
SITE_URL https://order.your-restaurant.com Public address: payment return links, sitemap, page metadata, secure cookies. No trailing slash.

First owner account

Used by npm run db:seed only when the database has no staff account yet. Later changes happen in Dashboard > Staff.

Variable Default
OWNER_EMAIL owner@sufra.test email of the first owner
OWNER_PASSWORD sufra-demo-2026 change it before the first seed

Restaurant

Variable Default
RESTAURANT_TIMEZONE Asia/Muscat time zone for opening hours (IANA name)
DEMO_HINT 0 1 shows the owner email and password on the sign-in page. For public demos only, never for a real restaurant.

Card payments (Thawani)

Variable Default
THAWANI_MODE uat uat = Thawani test environment, live = real payments
THAWANI_SECRET_KEY empty secret key from your Thawani merchant portal (server only)
THAWANI_PUBLISHABLE_KEY empty publishable key, used in the payment page link

With either key empty, card payment stays off whatever the dashboard setting says. Details in Payments.

AI (optional)

Variable Default
AI_BASE_URL empty base URL of an OpenAI-compatible API, e.g. https://api.openai.com/v1, https://openrouter.ai/api/v1, http://localhost:11434/v1 (Ollama)
AI_API_KEY empty sent as Authorization: Bearer ... when set
AI_MODEL gpt-4o-mini model name at that provider

Empty AI_BASE_URL turns AI off; see AI features.