Shopnex

Configuration

Environment variables read from the root .env.

.env keeps infrastructure only. Shop name, currency, shipping, payments and storefront keys are changed in the admin under Settings.

VariableRequiredDescription
DATABASE_URLyesPostgreSQL connection string.
BETTER_AUTH_SECRETyesLong random string. Also used to encrypt provider keys at rest.
BETTER_AUTH_URLyesPublic origin of the app, e.g. https://shop.example.com.
APP_URLyesPublic origin used in hosted checkout links.
TENANCY_MODEnosingle (default) or multi. See Tenancy.
DEFAULT_SHOP_NAMEnoName of the default shop.
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRETnoEnables Google sign-in.
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRETnoEnables GitHub sign-in.
MARKETPLACE_URLnoApp Marketplace instances connect to.
STRIPE_APP_URLnoPublic URL of the bundled Stripe app.
STRIPE_APP_KEYnoThe Stripe app's private key, from pnpm app:keygen.

apps/admin-ui/.env is a symlink to the root .env; Vite loads it for the admin app.

Migrations

pnpm db:generate   # generate a migration after changing schema
pnpm db:migrate    # apply migrations

Migrations are idempotent. The container entrypoint runs them on every start, which also covers upgrades.

On this page