Software Requirement Specification (SRS)

This SRS describes the technical requirements, interfaces and constraints of Streamix. For the business view see the BRD; for features see the FRD.

1. System overview

Streamix is one Next.js 16 App Router application. The same deployment serves:

  • the storefront (src/app/(site)): landing, browse, title pages, player, account, help;
  • the admin (src/app/admin/(panel));
  • the REST API (src/app/api/v1/**), used by the web client and available to future apps;
  • the install wizard (/install) and the in-app docs (/docs/v1).

Outside the web process there are two optional pieces: a scheduler that calls /api/v1/cron, and the transcode worker (npm run worker:transcode) that runs ffmpeg on a server or container.

2. Runtime requirements

Component Requirement
Node.js 20 or newer
Database PostgreSQL 14+ (Neon recommended). The pg_trgm extension is used for typo-tolerant search when the role may create it; search falls back to exact matching otherwise.
Object storage S3-compatible bucket (Cloudflare R2, DigitalOcean Spaces, Amazon S3, Google Cloud Storage) with CORS allowing your site origin.
Email SMTP (free) or an email add-on (SendGrid, Postmark, SES).
Payments At least one gateway: PayPal, bank transfer or cash (free), or a premium gateway add-on.
Transcode worker (optional) A machine with CPU, scratch disk about 2-3× the source file, and outbound access to the database and bucket. ffmpeg and ffprobe ship as npm packages (ffmpeg-static, ffprobe-static).
Browsers Current Chrome, Edge, Firefox and Safari. HLS uses hls.js, or native HLS on Safari/iOS.

3. Configuration

Configuration is split between a small .env and encrypted database settings.

Kind Where
Database URL, session secrets, cron secret .env (DATABASE_URL, JWT_SECRET, SECRET_KEY, CRON_SECRET)
Storage, payment, email, SMS and other provider credentials integration_connections table, encrypted with AES-256-GCM (key from SECRET_KEY, else JWT_SECRET), managed in admin → Settings → Add-ons
Streaming behaviour settings row streaming (admin → Settings → Streaming)
Landing copy settings row landing (admin → Content → Landing page)
Branding, theme, languages Admin settings tables

Storage has no environment-variable fallback; the bucket is configured only in the admin.

4. Data requirements

  • All tables are created and extended by idempotent ensure*Schema() functions (CREATE TABLE IF NOT EXISTS, ADD COLUMN IF NOT EXISTS). There are no migration files to run. DB_SCHEMA_READY=1 skips these checks once a database is fully provisioned.
  • Money is stored in minor units (integers) with a currency code.
  • Viewer state (My List, progress, ratings, reminders, notifications) is keyed by profile, not account.
  • Public identifiers (public_id) are used in URLs and APIs instead of serial ids where records are addressable.

See Database Documentation.

5. Interface requirements

5.1 User interface

  • The member area is dark by default. The admin supports light and dark.
  • Every data-loading page renders a layout-shaped skeleton.
  • Layouts are responsive: hover cards on desktop, tap-to-open on touch devices; rows show 6/5/4/3/2 items per breakpoint.
  • All user-facing strings go through the translation layer (t()), with catalogues per language.

5.2 API

  • JSON over HTTPS under /api/v1. Responses use ok(data) / err(message, status) helpers.
  • Member endpoints authenticate with the member_session cookie; the same JWT is accepted as Authorization: Bearer <token>. The active profile comes from the sx_profile cookie or an X-Profile-Id header, and is always re-checked against the account.
  • Admin endpoints use the admin_token session and role permissions (requirePermission(action, resource)).
  • The OpenAPI spec is generated from the route files (npm run gen:openapi) and served to signed-in admins at /api/docs/v1.

5.3 External interfaces

Interface Protocol
Object storage S3 API (AWS SDK v3), presigned PUT for browser uploads
Payment gateways Driver per provider (redirect or offline); PayPal built in
Email SMTP (nodemailer) or provider add-on
Web push VAPID (web-push), keys generated on first use and stored in settings
Scheduler HTTP GET/POST to /api/v1/cron with Authorization: Bearer <CRON_SECRET> or ?key=
Country detection x-vercel-ip-country or cf-ipcountry request headers

6. Non-functional requirements

Area Requirement
Security Auth check first in every route; owner-scoped queries; server-side price computation; bcrypt passwords; hashed one-time codes; rate limits on auth and public writes; admin RBAC. See Security Guide.
Performance Server-rendered first paint for browse pages and admin lists; lazy-loaded rows; title details prefetched on hover; HLS adaptive bitrate when transcoded.
Reliability Cron tasks are idempotent and bounded (claim-then-send, batch caps). Transcode jobs are claimed with FOR UPDATE SKIP LOCKED, lease 10 minutes, retry up to 3 times.
Privacy Search terms are logged with an HMAC of the profile, not the profile id. Members can download their data and delete their account.
Accessibility Keyboard control of the player, visible focus rings, captions/subtitles, audio-description flag on titles.
Internationalisation Locale-prefixed public URLs (/fr/...); translation catalogues shipped for da, de, es, fr, it, ru; RTL flag per language.

7. Constraints

  • Serverless hosts have a read-only filesystem: uploads must go to the bucket, and the transcode worker cannot run there.
  • There is no DRM and no URL signing for media; files are served from the bucket's public URL. Plan access is enforced when the playback API hands out the URL and when a stream session starts.
  • Recurring billing is pay-per-period; no card is stored or charged automatically.

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