A full-stack SaaS platform for DJs to discover music, manage channels, and get AI-powered recommendations powered by the Deezer API.
- π Authentication β GitHub OAuth + Email/Password via NextAuth.js
- π³ Stripe Subscriptions β Free, Pro ($19.99/mo), Enterprise ($99.99/mo)
- π΅ Deezer Integration β Music search, recommendations by genre/BPM/energy
- π» Channel Management β Create, organize, and share curated music channels
- ποΈ Music Preferences β Configure genre, BPM, energy, danceability filters
- π€ Smart Recommendations β Personalized track suggestions from Deezer
- π¨ shadcn/ui β Beautiful, accessible UI components
- π Production Ready β Docker, GitHub Actions CI/CD, Vercel deployment
| Layer | Technology |
|---|---|
| Framework | Next.js 14 (App Router) |
| Language | TypeScript |
| Database | SQLite (via Prisma ORM) |
| Auth | NextAuth.js v4 |
| Payments | Stripe |
| Music API | Deezer API |
| UI | shadcn/ui + Tailwind CSS |
| Deployment | Vercel / Docker |
dj-hub/
βββ prisma/
β βββ schema.prisma # Database schema
β βββ seed.ts # Database seeding
βββ src/
β βββ app/
β β βββ (auth)/ # Login, Register pages
β β βββ (dashboard)/ # Protected dashboard routes
β β βββ api/ # REST API endpoints
β β β βββ auth/ # NextAuth + Register
β β β βββ users/ # User CRUD
β β β βββ preferences/ # Music preferences
β β β βββ channels/ # Channel management
β β β βββ recommendations/ # Deezer recommendations
β β β βββ subscriptions/ # Subscription info
β β β βββ stripe/ # Checkout, Portal, Webhook
β β β βββ health/ # Health check
β β βββ pricing/ # Pricing page
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Landing page
β βββ components/
β β βββ auth/ # Login/Register forms
β β βββ dashboard/ # Dashboard components
β β βββ layout/ # Navigation, Providers
β β βββ ui/ # shadcn/ui components
β βββ hooks/ # Custom React hooks
β βββ lib/
β β βββ auth.ts # NextAuth config
β β βββ deezer.ts # Deezer API client
β β βββ prisma.ts # Prisma client singleton
β β βββ stripe.ts # Stripe config & helpers
β β βββ utils.ts # Utility functions
β β βββ validations.ts # Zod schemas
β βββ types/ # TypeScript types
βββ .github/
β βββ workflows/
β βββ ci.yml # CI pipeline
β βββ deploy.yml # Vercel deployment
βββ Dockerfile
βββ docker-compose.yml
βββ next.config.js
βββ tailwind.config.ts
βββ vercel.json
- Node.js 18+
- npm or yarn
- A Stripe account (for payments)
- A GitHub OAuth App (for auth)
git clone https://github.com/your-org/dj-hub.git
cd dj-hub
npm installcp .env.example .env.localEdit .env.local with your credentials:
# Database
DATABASE_URL="file:./dev.db"
# NextAuth
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secret" # openssl rand -base64 32
# GitHub OAuth (https://github.com/settings/applications/new)
GITHUB_CLIENT_ID="your-github-client-id"
GITHUB_CLIENT_SECRET="your-github-client-secret"
# Stripe (https://dashboard.stripe.com)
STRIPE_SECRET_KEY="sk_test_..."
STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."
STRIPE_PRO_PRICE_ID="price_..."
STRIPE_ENTERPRISE_PRICE_ID="price_..."
# App
NEXT_PUBLIC_APP_URL="http://localhost:3000"# Push schema to database
npm run db:push
# (Optional) Seed with demo data
npm run db:seednpm run devDemo accounts (after seeding):
| Password | Plan | |
|---|---|---|
| admin@djhub.com | admin123 | Enterprise |
| pro@djhub.com | pro123 | Pro |
| free@djhub.com | free123 | Free |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/auth/register |
Register new user |
POST |
/api/auth/[...nextauth] |
NextAuth handler |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/users/:id |
Get user details |
PATCH |
/api/users/:id |
Update user profile |
DELETE |
/api/users/:id |
Delete account |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/preferences |
Get user preferences |
PUT |
/api/preferences |
Update preferences |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/channels |
List user channels |
POST |
/api/channels |
Create channel |
GET |
/api/channels/:id |
Get channel |
PATCH |
/api/channels/:id |
Update channel |
DELETE |
/api/channels/:id |
Delete channel |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/recommendations?limit=20 |
Get recommendations |
POST |
/api/recommendations |
Submit track feedback |
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/subscriptions |
Get subscription |
POST |
/api/stripe/checkout |
Create Stripe checkout |
POST |
/api/stripe/portal |
Open billing portal |
POST |
/api/stripe/webhook |
Stripe webhook handler |
- Go to Stripe Dashboard
- Create Pro product: $19.99/month recurring
- Create Enterprise product: $99.99/month recurring
- Copy the Price IDs to your
.env.local
# Install Stripe CLI
stripe listen --forward-to localhost:3000/api/stripe/webhook
# Copy the webhook secret to STRIPE_WEBHOOK_SECRETThe following Stripe events are handled:
checkout.session.completedinvoice.payment_succeededinvoice.payment_failedcustomer.subscription.updatedcustomer.subscription.deleted
# Build image
docker build -t dj-hub .
# Run with Docker Compose
docker-compose up -dCreate a .env file (not committed) with all production variables.
- Connect your GitHub repo to Vercel
- Set all environment variables in Vercel Dashboard
- Deploy automatically on push to
main
Note: For Vercel deployment, use a persistent database (e.g., PlanetScale, Turso, or Neon) instead of SQLite.
Required secrets in your repo:
VERCEL_TOKENVERCEL_ORG_IDVERCEL_PROJECT_ID
User ββββ Account (OAuth)
ββββ Session
ββββ Subscription (Stripe)
ββββ Preference (music settings)
ββββ Channel[] ββββ Track[]
ββββ Recommendation[]
npm run dev # Start development server
npm run build # Production build
npm run start # Start production server
npm run lint # Run ESLint
npm run type-check # TypeScript check
npm run db:push # Push Prisma schema
npm run db:migrate # Run migrations
npm run db:generate # Regenerate Prisma client
npm run db:studio # Open Prisma Studio
npm run db:seed # Seed demo data- Passwords hashed with bcrypt (12 rounds)
- JWT sessions via NextAuth
- API routes protected with session checks
- Stripe webhook signature verification
- Input validation with Zod schemas
- CORS headers configured
MIT License β see LICENSE for details.
Built with β€οΈ for the DJ community. Powered by Next.js and Deezer API.