Installation Guide

Streamix is a single Next.js application: the storefront, admin, API and installer run in one process. You install dependencies, point it at PostgreSQL, run the install wizard, then connect storage and payments in the admin. The optional transcode worker is a separate long-running process (see Deployment Guide).

The short version is the Quick Start. This page has the details and the full environment-variable reference.

Prerequisites

Requirement Notes
Node.js 20+ (LTS) with npm 10+
PostgreSQL Neon recommended (HTTP driver), or any PostgreSQL 14+ reached over the standard protocol
Object storage An S3-compatible bucket: Cloudflare R2, DigitalOcean Spaces, Amazon S3 or Google Cloud Storage. Configured in the admin after install.
Email SMTP or an email add-on, for verification codes, sign-in codes and billing emails
Payment gateway PayPal, bank transfer or cash are free; Stripe, Razorpay and others are premium add-ons
Terminal
node -v   # v20 or higher

Step 1: install dependencies

Terminal
npm install

postinstall runs prisma generate (a few legacy core screens use the generated client).

Step 2: environment

Create .env (or .env.local) in the project root. On a writable filesystem the wizard's database step writes DATABASE_URL for you and generates JWT_SECRET and CRON_SECRET if they are missing. On read-only hosts (Vercel) set them in the host's environment settings.

ENV
# Required
DATABASE_URL="postgresql://user:password@host/dbname?sslmode=require"
JWT_SECRET="a-long-random-string"

# Recommended
SECRET_KEY="another-long-random-string"   # encrypts integration credentials (falls back to JWT_SECRET)
CRON_SECRET="a-random-string"             # protects /api/v1/cron
NEXT_PUBLIC_SITE_URL="https://watch.example.com"

Environment variable reference

These are the variables the app and scripts read. Storage and payment credentials are not environment variables; they live encrypted in the database.

Variable Needed Purpose
DATABASE_URL Required PostgreSQL connection string. Use the Neon pooler URL for the app.
JWT_SECRET Required in production Signs member and admin session tokens. The app refuses to start sessions in production without it.
SECRET_KEY Recommended Key for AES-256-GCM encryption of integration credentials, web-push private key and search-log hashing. Falls back to JWT_SECRET. Keep it stable: changing it makes stored credentials unreadable.
CRON_SECRET Recommended Shared secret for /api/v1/cron. Without it the cron endpoint stays closed.
NEXT_PUBLIC_SITE_URL Recommended Public base URL, used in emails, web push and the install finish step.
BASE_URL Optional Fallback base URL for emails; also used by the e2e tests.
ADMIN_EMAIL / ADMIN_PASSWORD Optional Bootstrap admin when the users table is empty. In production, a missing password is replaced by a random one printed once in the logs.
JWT_EXPIRES_IN Optional Admin session lifetime (default 7d).
DB_SCHEMA_READY Optional Set to 1 once the schema is fully provisioned to skip the idempotent schema checks on each cold start.
NOTIFY_EMAIL Optional Last-resort recipient for admin notifications (after the contact and general settings emails).
PEXELS_API_KEY Optional Demo media for scripts/seed-ott.ts and the admin Pexels picker.
OPENAI_API_KEY / OPENAI_MODEL, ANTHROPIC_API_KEY / ANTHROPIC_MODEL Optional Machine translation of content when no AI add-on connection is configured.
LICENSE_SERVER_URL, LICENSE_PUBLIC_KEY, LICENSE_DOMAIN, LICENSE_DEV_BYPASS Optional License server overrides. You normally leave these unset.
DISABLE_IMAGE_OPT Optional 1 turns off Next image optimisation.
TRANSCODE_POLL_SECONDS Optional Worker poll interval (default 10 s).
WORLDVECTORLOGO_API_KEY Optional Logo search in the (hidden) Partners module.

The e2e tests also read BASE_URL, CHROME_PATH, E2E_EMAIL and E2E_PASSWORD.

Step 3: create the schema

Terminal
npm run db:init   # scripts/init-db.ts + scripts/init-core.ts

Streaming tables (titles, profiles, rows, sessions…) are created by the wizard and by the app on first use through idempotent ensure*Schema() functions. Nothing breaks if you run db:init twice.

Step 4: run the wizard

Terminal
npm run dev

Open http://localhost:3000/install. The wizard has six steps:

Step What happens
Welcome Requirement checks
Database Test the connection, write .env, generate secrets, create tables and seed the essentials (maturity ratings, genres, moods, avatars, email templates, FAQs, legal copy). The "Add starter content" box lives here.
License Activate your purchase code for this domain (skipped on local development hosts)
Admin account Create the first administrator
Site settings Site name, timezone, default currency
Finish Locks the installer and links to the admin

After the wizard, restart the app once so all new settings load.

The wizard does not download demo titles, because that needs network access to Pexels and a configured bucket. Use the seed scripts below.

Step 5: connect storage

  1. Sign in at /admin/login.
  2. Settings → Add-ons → Storage: add a connection (R2, Spaces, S3 or GCS) with access key, secret, bucket and public URL. Mark it Active and Default.
  3. Allow the browser to upload and play from your domain:
Terminal
npx tsx scripts/setup-r2-cors.ts https://watch.example.com

Local dev ports and the site URL from settings are always allowed; there is no wildcard origin.

Step 6: payments and email

  • Settings → Add-ons → Payments: connect a gateway and mark it active. Without one, members cannot subscribe.
  • Settings → Add-ons → Email: SMTP or a provider, so verification and sign-in codes arrive.

Step 7: demo content (optional)

Terminal
npx tsx scripts/seed-ott.ts                 # plans, ~35 titles, cast, trailers, rows, billboards, Top 10
npx tsx scripts/seed-demo-users.ts          # demo members, password Password@1
npx tsx scripts/seed-subtitles.ts           # English subtitles on a few demo titles
npx tsx scripts/seed-recommendation-rows.ts # only for databases seeded before personalised rows existed

All seed scripts are idempotent and copy media into your bucket; nothing is hot-linked.

Verify

  • / shows the landing page, /browse asks you to sign in.
  • Sign in as standard@streamix.test, pick a profile, press Play.
  • /admin/titles lists the demo catalogue.

© CreativeCape Solutions · creative-cape.com · support@creative-cape.com