Pasuk-level collaborative laining platform with:
- learner playback and sing-along mode
- teacher invites and assignments
- moderation queue for recording approval
- role-based auth (Google + NextAuth)
- optional AssemblyAI alignment for word timings
- Node 20+
- PostgreSQL 15+
- Google OAuth credentials
npm installCopy .env.example to .env and set values:
- DATABASE_URL
- AUTH_SECRET
- AUTH_GOOGLE_ID
- AUTH_GOOGLE_SECRET
- NEXTAUTH_URL
- NEXT_PUBLIC_APP_URL (recommended when using Stripe checkout redirects)
- ASSEMBLY_API_KEY (optional, required for auto-alignment)
- NEXT_PUBLIC_GA_MEASUREMENT_ID (optional, for analytics)
- TEACHER_FEATURE_PRICE_CENTS (optional, defaults to 0; set teacher feature price in cents)
- STRIPE_SECRET_KEY (required for paid teacher subscriptions)
- STRIPE_TEACHER_PRICE_ID (required for paid teacher subscriptions)
- STRIPE_WEBHOOK_SECRET (required for webhook confirmation)
- In Stripe test mode, create a product (for example "Teacher Access").
- Add a recurring monthly price of 5.99 USD and copy the Price ID (
price_...). - Set these environment variables:
TEACHER_FEATURE_PRICE_CENTS=599STRIPE_SECRET_KEY=sk_test_...STRIPE_TEACHER_PRICE_ID=price_...NEXT_PUBLIC_APP_URL=http://localhost:3000
- Start the Stripe webhook tunnel and copy the signing secret:
stripe listen --forward-to localhost:3000/api/paywall/checkout/webhook- Set
STRIPE_WEBHOOK_SECRET=whsec_...from the Stripe CLI output. - Restart
npm run devafter changing environment variables.
npx prisma generate
npx prisma migrate deployFor local development with a fresh DB:
npx prisma migrate devnpm run seed:textnpm run refresh:text:taamimnpm run devThis section assumes Vercel + managed Postgres. A VPS flow is similar, but you run build/start yourself.
- Create a production Postgres database.
- Copy its connection string.
- Ensure SSL is enabled if your provider requires it.
- In Google Cloud Console, create OAuth client credentials for web.
- Add authorized redirect URI:
- https://YOUR_DOMAIN/api/auth/callback/google
- Save client ID and client secret.
- Import this repo into Vercel.
- Framework preset: Next.js.
- Node version: 20+.
Set all variables from .env.example:
- DATABASE_URL
- AUTH_SECRET (generate a strong random value)
- AUTH_GOOGLE_ID
- AUTH_GOOGLE_SECRET
- NEXTAUTH_URL=https://YOUR_DOMAIN
- ASSEMBLY_API_KEY (if using alignment)
- NEXT_PUBLIC_GA_MEASUREMENT_ID (optional)
From your local machine (or CI) with production DATABASE_URL:
npx prisma migrate deploy- Trigger a production deployment from Vercel.
- Confirm build passes.
- Open the production URL and sign in.
- Authentication
- Google sign-in works
- user session persists
- Learner flow
- select pasuk
- play recordings
- sing-along highlights and clickable seek
- Teacher flow
- create invite
- accept invite
- assign recording
- Moderation flow
- pending approval appears
- approve/reject updates status
- Upload flow
- submission stores file under public/uploads
- Optional integrations
- AssemblyAI alignment works when API key is set
- GA events visible in Google Analytics Realtime report
- Terms page is available at /terms.
- Footer now includes copyright and licensing language.
- Navigation/header is now global and role-aware.
- Assignment count badge appears in the top nav for signed-in users.
npm run dev
npm run lint
npm run build
npm run seed:text
npm run refresh:text:taamim