Skip to content

gignus79/EPK-Generator

Repository files navigation

EPK Generator

Live Next.js TypeScript React Tailwind CSS Clerk Supabase Anthropic Vercel

AI-assisted Electronic Press Kit generator for artists, labels, and producers — part of the LabelTools suite.

Live app: epk-generator.labeltools.app

Powered by Tosky Records® · Developed by MediaMatter


Overview

EPK Generator turns raw release notes, metadata, and documents into a polished press kit in two controlled AI passes: first extract and confirm facts verbatim, then generate brand-voice prose only from confirmed data. Publish a shareable web EPK and export an A4 PDF one-sheet from the same content.

Features

Area Capabilities
Generation Two-pass pipeline (Pass 1 facts → Pass 2 prose), per-field regeneration, document import (PDF/DOCX/TXT/RTF)
Editing Prose editor, structured facts form, tracklist with durations, collapsible sections
Publishing Public web EPK at /[orgSlug]/[epkSlug], publish/unpublish, brand kit theming
Localization Dashboard UI in IT/EN/ES/FR; EPK content language detected from source material; translations IT/EN/ES/FR
Assets Cover art, artist photos, press folder; signed URLs for org-scoped storage
Export A4 PDF one-sheet with QR code, artist bio, release section; watermark removed after first credit purchase
Billing Pay-per-use credit packs (Stripe Checkout), live balance in header
Tenancy Clerk Organizations, Supabase RLS, org-scoped dashboard

Stack

  • Framework: Next.js 16 (App Router), React 19, Tailwind CSS 4
  • Auth: Clerk (organizations, production domain labeltools.app)
  • Database: Supabase (Postgres + Row Level Security)
  • AI: Anthropic Claude (claude-sonnet-4-6 Pass 1, claude-opus-4-8 Pass 2)
  • Payments: Stripe Checkout (one-time credit packs)
  • PDF: @react-pdf/renderer, QR via qrcode
  • Email: Brevo — transactional (welcome, purchase) + retargeting automation for non-paying signups
  • Hosting: Vercel (Analytics + Speed Insights)

Quick start

git clone https://github.com/gignus79/EPK-Generator.git
cd EPK-Generator
npm install
cp .env.example .env.local   # fill in keys (see below)
npm run dev

Open http://localhost:3000.

Environment variables

Copy .env.example to .env.local and set values. To sync from production:

vercel env pull .env.local --environment=production
Variable Purpose
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY Clerk client key
CLERK_SECRET_KEY Clerk server key
NEXT_PUBLIC_SUPABASE_URL Supabase project URL
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY Supabase anon/publishable key
SUPABASE_SECRET_KEY Supabase service role (server only)
ANTHROPIC_API_KEY LLM generation
NEXT_PUBLIC_APP_URL Public URL for PDF QR codes and redirects
STRIPE_SECRET_KEY Stripe server key (Live for production)
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY Stripe publishable key
STRIPE_WEBHOOK_SECRET Stripe webhook signing secret
GENERATION_STUB_CREDITS Set false in production when billing is live

Optional: CLERK_WEBHOOK_SIGNING_SECRET, BREVO_API_KEY, BREVO_RETARGETING_LIST_ID (retargeting automation), Upstash/KV vars for PDF rate limiting.

Clerk ↔ Supabase

Third-party auth links Clerk JWTs to Supabase RLS. Use your live Clerk Frontend API domain (e.g. clerk.labeltools.app).

  1. Clerk: Connect with Supabase
  2. Supabase: Third-party auth → Clerk
  3. Optional: npm run setup:auth (requires supabase login)

Webhook: POST /api/webhooks/clerk — events user.created, organization.created, organization.updated, organization.deleted.

Lifecycle email (Brevo)

Transactional messages (welcome on signup, receipt on purchase) plus a retargeting automation for non-paying signups:

  • On user.created, upsertRetargetingContact adds the user to the Brevo list BREVO_RETARGETING_LIST_ID with SIGNUP_DATE / EPK_USER_ID / EPK_PAID=false.
  • A Brevo automation on that list waits 1 day and sends the branded email (src/lib/email/templates/retargeting.ts, shared brand-kit layout) when EPK_PAID != true.
  • On checkout.session.completed, markContactPaid sets EPK_PAID=true and removes the contact from the list.

Contact sync is a safe no-op while BREVO_RETARGETING_LIST_ID is unset. The email body lives in Brevo; regenerate the importable HTML with node scripts/build-retargeting-email.mjs.

Scripts

npm run dev           # development server
npm run build         # production build
npm run lint          # ESLint
npm run setup:auth    # Clerk + Supabase integration helpers
npm run setup:stripe  # create/update Stripe credit pack catalog (reads .env.local)

# Lifecycle email helpers (see "Lifecycle email")
node scripts/build-retargeting-email.mjs        # render importable retargeting HTML → previews/
node scripts/backfill-retargeting-contacts.mjs  # sync existing non-paying signups to Brevo (--dry-run)

Billing (Stripe)

Pay-per-use credit packs — no subscription. New workspaces get 10 free starter credits (watermark on PDF until the first purchase).

Pack Price Credits Stripe lookup key
Starter €9.99 50 epk_credits_50
Standard €14.99 100 epk_credits_100
Studio €39.99 350 epk_credits_350

Credit costs: Pass 1 = 1 · Pass 2 = 2 · field regen / translation = 1.

Public pricing: /pricing. Checkout requires a signed-in Clerk user with an active organization.

Stripe setup

  1. Add STRIPE_SECRET_KEY, NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY, and STRIPE_WEBHOOK_SECRET to .env.local and Vercel (Production).

  2. Create catalog (Live mode keys):

    npm run setup:stripe

    Creates one product (EPK Generator Credits) with three one-time EUR prices and the lookup keys above.

  3. Webhook endpoint (Live): POST https://epk-generator.labeltools.app/api/webhooks/stripe
    Required event: checkout.session.completed (adds credits to the org in Supabase).

  4. Set GENERATION_STUB_CREDITS=false on Vercel Production and redeploy.

  5. Stripe Customer Portal (optional): configured in Dashboard for invoice history; API at POST /api/stripe/portal (requires prior purchase / Stripe customer id).

Low-credit alerts (≤5) and out-of-credits dialogs appear in the dashboard.

Deployment

Production: Vercel, domain epk-generator.labeltools.app. Apply Supabase migrations before first deploy:

supabase db push

Optional: Upstash Redis via Vercel integration (KV_REST_API_URL, KV_REST_API_TOKEN) for PDF rate limiting (12 req/min/IP).

Project structure

src/
  app/              # Routes, API, dashboard, public EPK
  components/       # UI (editor, public EPK, chrome, billing)
  lib/
    generation/     # Pass 1/2, translations, credits
    billing/        # Credit packs, Stripe sync
    epk/            # Content schema, language detection
    pdf/            # A4 one-sheet template + render
    supabase/       # Clients, types
scripts/            # setup-stripe, setup-clerk-supabase, retargeting email helpers
supabase/migrations/

License

Proprietary — Tosky Records® / MediaMatter. All rights reserved.

About

AI-assisted Electronic Press Kit generator — web EPK + PDF one-sheet. LabelTools Suite by Tosky Records® / MediaMatter.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors