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
| Setting | Description |
|---|---|
POSTGRES_PASSWORD | Password for the bundled PostgreSQL database. Choose a strong one. |
JWT_ACCESS_SECRET | Random 64-char string that signs short-lived login tokens. |
JWT_REFRESH_SECRET | A different random 64-char string for refresh tokens. |
MASTER_ENCRYPTION_KEY | Random 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_CODE | A code you invent; typed once in the setup wizard to create your first business. |
Common
| Setting | Default | Description |
|---|---|---|
POSTGRES_DB | posvelo | Database name. |
POSTGRES_USER | posvelo | Database user. |
FRONTEND_PORT | 3000 | Port the web app is served on. |
BACKEND_PORT | 5000 | Port the API is served on. |
NEXT_PUBLIC_API_URL | http://localhost:5000/api/v1 | The 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_ORIGINS | http://localhost:3000 | Comma-separated sites allowed to call the API (your frontend URL). The first one is also the address in receipt links sent on WhatsApp. |
RUN_SEED | false | true loads demo data on first start. |
Optional / advanced
| Setting | Default | Description |
|---|---|---|
JWT_ACCESS_EXPIRY | 15m | Access token lifetime. |
JWT_REFRESH_EXPIRY | 7d | How long people stay signed in without activity, until a length is chosen under Settings → System → Sign-in. |
RATE_LIMIT_MAX | 100 | Max requests per window per IP. |
RATE_LIMIT_WINDOW_MS | 60000 | Rate-limit window in ms. |
LOG_LEVEL | info | debug, info, warn, error. |
SUPER_ADMIN_EMAIL / SUPER_ADMIN_PASSWORD | blank | Optional 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.
| Setting | Default | Description |
|---|---|---|
STRIPE_SECRET_KEY | blank | Your Stripe secret key. Enables checkout, the billing portal and plan→Stripe sync. |
STRIPE_WEBHOOK_SECRET | blank | Signing secret for your Stripe webhook endpoint. Required for plan changes to sync back — point a webhook at POST /api/v1/webhooks/stripe. |
STRIPE_PUBLISHABLE_KEY | blank | Your Stripe publishable key. |
STRIPE_CURRENCY | usd | Currency used when auto-creating Stripe Prices for a plan. |
Backend .env (manual setup)
| Setting | Description |
|---|---|
NODE_ENV | development or production. |
PORT | API port (use 5000 to avoid clashing with the frontend's 3000). |
DATABASE_URL | Full PostgreSQL connection string. |
REDIS_URL | Redis connection string, e.g. redis://localhost:6379. |
JWT_ACCESS_SECRET / JWT_REFRESH_SECRET | Token signing secrets (≥32 chars). |
MASTER_ENCRYPTION_KEY | HR encryption key (openssl rand -hex 32). Without it, HR endpoints that touch encrypted fields fail by design. |
CORS_ORIGINS | Allowed frontend origins. |
SETUP_ACCESS_CODE | First-run wizard code. |
RATE_LIMIT_MAX / RATE_LIMIT_WINDOW_MS | Rate limiting. |
SMTP_HOST / SMTP_PORT / SMTP_USER / SMTP_PASS / SMTP_SECURE / MAIL_FROM | Outgoing 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.
Email (password reset links, scheduled reports)
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.
| Setting | Default | Description |
|---|---|---|
SMTP_HOST | blank | Your provider's SMTP server, e.g. smtp.gmail.com or smtp.sendgrid.net. |
SMTP_PORT | 587 | 587 upgrades to TLS with STARTTLS; use 465 with SMTP_SECURE=true. |
SMTP_USER / SMTP_PASS | blank | Login for the SMTP server (an app password for Gmail). |
SMTP_SECURE | false | true for port 465. |
MAIL_FROM | blank | The 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)
| Setting | Description |
|---|---|
NEXT_PUBLIC_API_URL | Address the browser uses to reach the backend API. |
NEXT_PUBLIC_TEST_MODE | true shows quick-login buttons on the login page (dev only). Keep false in production. |
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME | Your Cloudinary cloud name. |
NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET | Your unsigned Cloudinary upload preset. |
CLOUDINARY_API_KEY / CLOUDINARY_API_SECRET | Server-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.
- Create a free account at https://cloudinary.com.
- On your Dashboard, copy your Cloud Name, API Key and API Secret.
- Go to Settings → Upload → Add upload preset, set Signing Mode to Unsigned, save, and copy the preset name.
- Put the four values into your
.env:NEXT_PUBLIC_CLOUDINARY_CLOUD_NAMENEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESETCLOUDINARY_API_KEYCLOUDINARY_API_SECRET
- 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.