Configuration Reference

Every POSVelo setting and what it does. With the Docker setup you only edit one .env file in the Source-Code folder. With the manual setup the backend and frontend each have their own .env.

Docker .env (the one-command setup)

This file in Source-Code/.env configures the whole stack.

Required

SettingDescription
POSTGRES_PASSWORDPassword for the bundled PostgreSQL database. Choose a strong one.
JWT_ACCESS_SECRETRandom 64-char string that signs short-lived login tokens.
JWT_REFRESH_SECRETA different random 64-char string for refresh tokens.
MASTER_ENCRYPTION_KEYRandom key (openssl rand -hex 32) that encrypts sensitive HR data and saved keys (AI assistant, WhatsApp Cloud API, online shops). Do not change it after data is saved, or encrypted fields become unreadable and saved keys have to be entered again.
SETUP_ACCESS_CODEA code you invent; typed once in the setup wizard to create your first business.

Common

SettingDefaultDescription
POSTGRES_DBposveloDatabase name.
POSTGRES_USERposveloDatabase user.
FRONTEND_PORT3000Port the web app is served on.
BACKEND_PORT5000Port the API is served on.
NEXT_PUBLIC_API_URLhttp://localhost:5000/api/v1The address the browser uses to reach the API, including the /api/v1 suffix. On a server, set your real API URL (e.g. https://api.example.com/api/v1).
CORS_ORIGINShttp://localhost:3000Comma-separated sites allowed to call the API (your frontend URL). The first one is also the address in receipt links sent on WhatsApp.
RUN_SEEDfalsetrue loads demo data on first start.

Optional / advanced

SettingDefaultDescription
JWT_ACCESS_EXPIRY15mAccess token lifetime.
JWT_REFRESH_EXPIRY7dHow long people stay signed in without activity, until a length is chosen under Settings → System → Sign-in.
RATE_LIMIT_MAX100Max requests per window per IP.
RATE_LIMIT_WINDOW_MS60000Rate-limit window in ms.
LOG_LEVELinfodebug, info, warn, error.
SUPER_ADMIN_EMAIL / SUPER_ADMIN_PASSWORDblankOptional platform super-admin bootstrap.

Stripe billing (optional — only if you run POSVelo as paid SaaS)

Leave these blank to run without subscription billing. When set, the Super Admin plan catalog syncs to Stripe and businesses can check out and self-manage their subscription.

SettingDefaultDescription
STRIPE_SECRET_KEYblankYour Stripe secret key. Enables checkout, the billing portal and plan→Stripe sync.
STRIPE_WEBHOOK_SECRETblankSigning secret for your Stripe webhook endpoint. Required for plan changes to sync back — point a webhook at POST /api/v1/webhooks/stripe.
STRIPE_PUBLISHABLE_KEYblankYour Stripe publishable key.
STRIPE_CURRENCYusdCurrency used when auto-creating Stripe Prices for a plan.

Backend .env (manual setup)

SettingDescription
NODE_ENVdevelopment or production.
PORTAPI port (use 5000 to avoid clashing with the frontend's 3000).
DATABASE_URLFull PostgreSQL connection string.
REDIS_URLRedis connection string, e.g. redis://localhost:6379.
JWT_ACCESS_SECRET / JWT_REFRESH_SECRETToken signing secrets (≥32 chars).
MASTER_ENCRYPTION_KEYHR encryption key (openssl rand -hex 32). Without it, HR endpoints that touch encrypted fields fail by design.
CORS_ORIGINSAllowed frontend origins.
SETUP_ACCESS_CODEFirst-run wizard code.
RATE_LIMIT_MAX / RATE_LIMIT_WINDOW_MSRate limiting.
SMTP_HOST / SMTP_PORT / SMTP_USER / SMTP_PASS / SMTP_SECURE / MAIL_FROMOutgoing email; see below.

The backend validates all settings on startup (with Zod) and refuses to boot with a clear error if anything required is missing or invalid.

Set email up in the app under Settings → System → Email: choose an SMTP server (Gmail, Outlook, your host's mailbox, Mailgun, Brevo…), this server's own sendmail, or Don't send, enter the sender address and name, save, and press Send test to check it. The SMTP password is stored encrypted with MASTER_ENCRYPTION_KEY, so set that first. The System tab is shown to the super admin and to the admins of the first business created on the install; other businesses on a SaaS install never see it.

Until those settings are saved, the values below from the backend .env are used (the same settings go in the Docker .env); email stays off until SMTP_HOST and MAIL_FROM are set. Once saved in the app, the saved settings replace them as a whole.

SettingDefaultDescription
SMTP_HOSTblankYour provider's SMTP server, e.g. smtp.gmail.com or smtp.sendgrid.net.
SMTP_PORT587587 upgrades to TLS with STARTTLS; use 465 with SMTP_SECURE=true.
SMTP_USER / SMTP_PASSblankLogin for the SMTP server (an app password for Gmail).
SMTP_SECUREfalsetrue for port 465.
MAIL_FROMblankThe sender, e.g. Your Shop <reports@yourshop.com>.

Sign-in

Settings → System → Sign-in sets how long someone stays signed in without activity (30 minutes to 7 days; shorter is safer on shared counters) and whether Forgot password? on the sign-in page emails a reset link. The link works once and for 60 minutes, and a reset signs the person out on every other device. Reset links need working email: until it is set up, or when the switch is off, the page tells people to ask an admin, who sets a new password from Users. Links in the email use the first address in CORS_ORIGINS unless the request came from another allowed address.

Frontend .env (manual setup)

SettingDescription
NEXT_PUBLIC_API_URLAddress the browser uses to reach the backend API.
NEXT_PUBLIC_TEST_MODEtrue shows quick-login buttons on the login page (dev only). Keep false in production.
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAMEYour Cloudinary cloud name.
NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESETYour unsigned Cloudinary upload preset.
CLOUDINARY_API_KEY / CLOUDINARY_API_SECRETServer-side Cloudinary credentials (used to delete images).

🔒 Never put passwords or secrets in any NEXT_PUBLIC_* variable — these are shipped to the browser. The login quick-buttons only pre-fill an email; the password is always typed manually.

Cloudinary setup (image uploads)

POSVelo stores product images, logos and receipt branding on Cloudinary's CDN.

  1. Create a free account at https://cloudinary.com.
  2. On your Dashboard, copy your Cloud Name, API Key and API Secret.
  3. Go to Settings → Upload → Add upload preset, set Signing Mode to Unsigned, save, and copy the preset name.
  4. Put the four values into your .env:
    • NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
    • NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET
    • CLOUDINARY_API_KEY
    • CLOUDINARY_API_SECRET
  5. Rebuild/restart so the new values take effect:
    docker compose up -d --build      # Docker setup
    

POSVelo runs fine without Cloudinary — image uploads are simply unavailable until it is configured.

Sample data

RUN_SEED=true loads a sample shop (products, customers, sales and staff) once on first start, so you can explore every feature. For a real business, leave it false and use the setup wizard.