Environment variables

Every setting in .env, what it does and what to put in it.

Copy .env.example to .env and edit it. Restart the server after every change. Settings that the owner may change at any time (company name, tax, check-in time, payment switches) are not here: they live in Dashboard > Company settings.

Required

Variable Example What it does
DATABASE_URL file:./nuzul.db Where the data is. SQLite file next to prisma/schema.prisma by default; a postgresql:// address for PostgreSQL (how)
SITE_URL https://stays.example.com The public address. Used for payment return links, the sitemap, structured data and the secure cookie
AUTH_SECRET 64 random hex characters Signs the dashboard session cookie. At least 16 characters; use 32+

First owner account

Variable Example What it does
OWNER_EMAIL owner@your-company.com Email of the owner account created by npm run db:seed if it does not exist yet
OWNER_PASSWORD 10+ characters Its password. Only read when the account is created; later passwords are set in Dashboard > Admins
OWNER_NAME Ahmed The name shown in the dashboard
DEMO_HINT 0 1 shows the owner email and password on the sign-in page. Only for public demos

Company

Variable Default What it does
COMPANY_TIMEZONE Asia/Muscat Time zone of the stays. Decides "today": which dates are in the past, when check-in is allowed and when the door code appears

Card payments (Thawani)

Variable Default What it does
THAWANI_MODE uat uat for Thawani's test environment, live for real payments
THAWANI_SECRET_KEY empty Secret key from the Thawani merchant portal. Server only
THAWANI_PUBLISHABLE_KEY empty Publishable key, used in the payment page link

With the keys empty, card payment is off whatever the dashboard switch says. See Payments.

AI (optional)

Variable Example What it does
AI_BASE_URL https://api.openai.com/v1 Any OpenAI-compatible endpoint. Empty = AI off
AI_API_KEY sk-... Sent as a bearer token. Leave empty for a local Ollama
AI_MODEL gpt-4o-mini Model name at that provider

See AI features.

Things that are not variables

  • The port: -p 3304 in the dev and start scripts of package.json.
  • Colours and fonts: src/app/globals.css and src/app/[locale]/layout.tsx (Branding).
  • Hold time of unpaid card bookings (30 minutes), the weekend nights (Thursday and Friday) and the longest stay (60 nights): constants at the top of src/lib/booking-rules.ts (Availability and pricing).