Getting started with Vape
Clone the source, configure PostgreSQL, sessions, and S3 storage, apply migrations, create the first operator, run onboarding, and deploy.
Requirements
- Node.js matching
package.jsonengines(>=20.9.0); the README recommends Node.js 22 for Next.js 16. - npm (the repository ships a
package-lock.json). - A PostgreSQL database you are allowed to migrate.
- S3-compatible object storage for product and claim images in production.
Install
git clone https://github.com/openshiporg/openfront-vape.git
cd openfront-vape
npm ci
cp .env.example .envEnvironment
features/keystone/index.ts refuses to start without DATABASE_URL and SESSION_SECRET, and rejects a session secret shorter than 32 characters. The S3 values fall back to development placeholders outside production and are required when NODE_ENV=production.
DATABASE_URL=postgresql://user:password@127.0.0.1:5432/openfront_vape
SESSION_SECRET=replace-with-at-least-32-random-characters # openssl rand -hex 32
S3_BUCKET_NAME=your-bucket
S3_REGION=your-region
S3_ACCESS_KEY_ID=your-access-key-id
S3_SECRET_ACCESS_KEY=your-secret-access-key
S3_ENDPOINT=https://your-s3-compatible-endpointOptional settings read by the code:
| Variable | Used for |
|---|---|
SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD, SMTP_FROM, SMTP_STORE_LINK | Transactional email and links in emails |
NEXT_PUBLIC_STRIPE_KEY, STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET | Stripe payment adapter |
NEXT_PUBLIC_PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET, PAYPAL_WEBHOOK_ID, NEXT_PUBLIC_PAYPAL_SANDBOX | PayPal payment adapter |
AUTHORIZENET_API_LOGIN_ID, AUTHORIZENET_TRANSACTION_KEY, AUTHORIZENET_SIGNATURE_KEY, AUTHORIZENET_ENV, NEXT_PUBLIC_AUTHORIZENET_CLIENT_KEY | Authorize.net payment adapter (AUTHORIZENET_ENV=production for live) |
OPENROUTER_API_KEY, OPENROUTER_MODEL, OPENROUTER_MAX_TOKENS | Dashboard AI chat (/api/completion) |
NEXT_PUBLIC_DEFAULT_REGION | Default storefront country code |
HIDE_OPENFRONT_BRANDING | Hide Openfront branding in the storefront |
TRUSTED_PROXY_IPS | Comma-separated proxies whose x-forwarded-for is trusted for client IP |
CUSTOMER_TOKEN_MAX_AGE_DAYS | Customer token lifetime (default 90) |
CREDENTIAL_PEPPER | Pepper for hashed credentials (falls back to SESSION_SECRET) |
Keep .env out of source control.
Migrations and local run
npm run devnpm run dev runs keystone build --no-ui, applies checked-in migrations with prisma migrate deploy, and starts Next.js. To change the schema, run npm run migrate:gen against a disposable database; it rebuilds the schema, regenerates the dashboard view order, and runs keystone prisma migrate dev. Commit model changes and their migrations together.
npm run dev applies migrations to whatever DATABASE_URL points at.
Once running:
- Storefront:
/[countryCode](for example/us) - Operator dashboard:
/dashboard - GraphQL API:
/api/graphql
First operator and onboarding
- Visit
/dashboard/initon an empty database to create the first administrator, then sign in. - Open the onboarding dialog from the dashboard. Setup seeds a store, a
usregion (tax rate 0), currency, country, three shipping options, four categories, three collections, ten draft products, Manual and Authorize.net payment providers, a manual fulfillment provider, and, if your role hascanManageCompliance, a draftRegulatedMerchantProfilewith the kill switch on. - Fill in store business details and the five required policies (shipping, returns, age verification, privacy, terms) at
/dashboard/platform/store. - Work through the blockers listed on
/dashboard/platform/overviewand/dashboard/platform/compliance: activate a merchant profile, add launch jurisdictions and an active signed rule set, classify and authorize variants, and record provider approvals.
Onboarding leaves the kill switch on, so sales stay closed until you finish the checklist in Go live. Storefront checkout refuses the Manual payment provider.