A self-hosted Patreon alternative powered by Bitvora Commerce & Nostr Wallet Connect (NWC). Create premium content and get paid in Bitcoin.
- 🟠 Bitcoin Payments: Accept subscriptions with Bitcoin using Nostr Wallet Connect
- 🏠 Self-Hosted, Self-Custodial: Complete control over your content, subscriber data and money.
- 🎨 Content Management: Support for videos, images, and blog posts (Markdown)
- 👥 User Management: Separate admin and subscriber roles
- 📊 Analytics Dashboard: Track subscriber count, MRR, and other key metrics
- 🔐 Access Control: Paywall content for subscribers only
- 🎨 Beautiful UI: Modern, responsive design with dark mode support
- Frontend: Next.js 15, React 19, Tailwind CSS
- Backend: Next.js API Routes, NextAuth.js
- Database: PostgreSQL with Prisma ORM
- Authentication: NextAuth.js with credentials
- Payments: Webhook-based integration (BTCPay Server, etc.)
- File Storage: Local file uploads with access control
git clone <your-repo>
cd satsclub
npm install
Copy the environment variables and update them:
cp .env.example .env.local
Update .env.local
with your settings:
# Database
DATABASE_URL="postgresql://satsclub_user:satsclub_password@localhost:5477/satsclub"
# NextAuth.js
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secret-key-here-change-in-production"
# Bitvora Commerce Configuration
BITVORA_COMMERCE_HOST="https://api.bitvora.com"
BITVORA_COMMERCE_API_KEY="your-bitvora-api-key"
BITVORA_COMMERCE_PRODUCT_ID="your-product-id"
# File uploads
UPLOAD_DIR="./uploads"
MAX_FILE_SIZE=50000000
# Payment webhook secret
WEBHOOK_SECRET="your-webhook-secret-here"
# Default admin credentials
DEFAULT_ADMIN_EMAIL="admin@satsclub.local"
DEFAULT_ADMIN_PASSWORD="admin123"
docker-compose up -d
# Generate Prisma client
npm run db:generate
# Push database schema
npm run db:push
# Optional: Open Prisma Studio to view/edit data
npm run db:studio
# Create the default admin account
npm run seed:admin
This will create an admin with:
- 📧 Email:
admin@satsclub.local
- 🔑 Password:
admin123
- 👤 Name: SatsClub Admin
npm run dev
Visit http://localhost:3000
to see your SatsClub instance!
- Access Admin Login: Visit
http://localhost:3000/auth/signin
- Sign In: Use your admin credentials (
admin@satsclub.local
/admin123
) - Admin Dashboard: You'll be automatically redirected to
http://localhost:3000/admin
The admin dashboard includes:
- 📊 Analytics Overview: Subscriber count, content count, monthly revenue
- 🎯 Quick Actions: Create posts, upload videos/images, manage settings
- 👑 Admin Interface: Full control over your SatsClub instance
npm run admin:list
Shows all admin accounts with email, name, and creation date.
# Interactive method - set environment variables
EMAIL=john@example.com PASSWORD=securepass123 NAME="John Doe" npm run admin:create
# Reset password for existing admin
EMAIL=admin@satsclub.local PASSWORD=newpassword123 npm run admin:reset-password
# If you need to create another default admin
npm run seed:admin
# Create a new content manager
EMAIL=manager@satsclub.local PASSWORD=manager123 NAME="Content Manager" npm run admin:create
# Create a technical admin
EMAIL=tech@satsclub.local PASSWORD=tech123 NAME="Technical Admin" npm run admin:create
# Reset forgotten password
EMAIL=admin@satsclub.local PASSWORD=mynewpassword npm run admin:reset-password
# List all current admins
npm run admin:list
- Change Default Credentials: Immediately change the default
admin123
password - Use Strong Passwords: Minimum 12 characters with mixed case, numbers, symbols
- Unique Email Addresses: Each admin should have a unique email
- Regular Password Updates: Reset passwords periodically
- Limit Admin Accounts: Only create admin accounts for trusted users
- User: NextAuth.js user management with subscription status
- Admin: Content creators and site administrators
- Content: Videos, images, and blog posts with access control
- Settings: Site configuration (name, description, pricing, etc.)
- PaymentEvent: Webhook events from payment providers
SatsClub is designed to work with Bitvora Commerce for Bitcoin subscription payments.
- Create Bitvora Commerce Account: Sign up at Bitvora Commerce
- Create a Product: Set up your subscription product in the Bitvora dashboard
- Get API Credentials: Copy your API key and product ID
- Configure Environment Variables:
BITVORA_COMMERCE_HOST="https://api.bitvora.com"
BITVORA_COMMERCE_API_KEY="your-bitvora-api-key"
BITVORA_COMMERCE_PRODUCT_ID="your-product-id"
SatsClub implements a complete Bitcoin subscription flow:
- User clicks "Subscribe" → Creates checkout via Bitvora API
- User enters Nostr Wallet Connect string → Processes payment
- Payment confirmation → Updates user to subscriber status
- Success page → User gains access to premium content
The subscription system includes these API routes:
POST /api/subscription/create-checkout
- Creates Bitvora checkoutPOST /api/subscription/process
- Processes payment with wallet connectGET /api/subscription/status/[checkoutId]
- Checks payment status
Users pay with their Nostr-enabled Bitcoin wallet by:
- Providing their wallet connect string (e.g.,
nostr+walletconnect://...
) - Approving the payment in their wallet
- Automatic confirmation and account upgrade
Configure webhooks in your payment provider to send events to:
POST /api/webhooks/payment
- Create/edit/delete blog posts, videos, and images
- Markdown support for blog posts
- File upload for media content
- Publish/unpublish content
- Subscriber count
- Monthly Recurring Revenue (MRR)
- Payment history
- Content performance
- Site name and description
- Profile and banner images
- Subscription pricing
- Payment provider configuration
- Visit Home Page → See beautiful landing page with pricing
- Sign Up → Create account with email/password
- Subscribe → Pay with Bitcoin via payment provider
- Access Content → View premium content in dashboard
- Admin Login → Sign in with admin credentials
- Dashboard Overview → View analytics and quick actions
- Create Content → Add videos, images, or blog posts
- Manage Settings → Configure site metadata and pricing
- Monitor Subscribers → Track growth and revenue
# Generate Prisma client
npm run db:generate
# Create a new migration
npm run db:migrate
# Push schema changes (development)
npm run db:push
# Reset database (development only)
npx prisma migrate reset
# Open database browser
npm run db:studio
# List all administrators
npm run admin:list
# Create new admin (with environment variables)
EMAIL=admin@example.com PASSWORD=pass123 NAME="Admin Name" npm run admin:create
# Reset admin password
EMAIL=admin@example.com PASSWORD=newpass123 npm run admin:reset-password
# Create default admin
npm run seed:admin
Make sure to update these for production:
NEXTAUTH_SECRET="a-very-secure-secret-key"
DATABASE_URL="your-production-database-url"
WEBHOOK_SECRET="your-webhook-secret-from-payment-provider"
# Admin credentials for production
DEFAULT_ADMIN_EMAIL="your-admin@yourdomain.com"
DEFAULT_ADMIN_PASSWORD="very-secure-password"
The included docker-compose.yml
can be used for production with modifications:
- Update PostgreSQL credentials
- Add environment file mounting
- Configure reverse proxy (nginx, Caddy, etc.)
- Setup SSL certificates
By default, uploaded files are stored locally in the uploads
directory. For production, consider:
- Setting up proper file permissions
- Using a CDN for media delivery
- Implementing backup strategies
# Check if admin exists
npm run admin:list
# Reset admin password
EMAIL=admin@satsclub.local PASSWORD=newpassword npm run admin:reset-password
# Recreate admin account
npm run seed:admin
# Check if database is running
docker ps | grep postgres
# Restart database
docker-compose restart postgres
# Check database connectivity
npm run db:studio
# Clear browser cookies and localStorage
# Restart development server
pkill -f "next dev"
npm run dev
# Kill any running processes
pkill -f "next dev"
# Clear Next.js cache
rm -rf .next
# Restart development
npm run dev
- Change default admin credentials immediately
- Use strong secrets for production
- Implement rate limiting for API endpoints
- Regular database backups
- Monitor webhook endpoints for abuse
- Validate file uploads properly
- Use HTTPS in production
- Secure admin email addresses
- Update Prisma schema in
prisma/schema.prisma
- Run
npm run db:generate
to update Prisma client - Create migration with
npm run db:migrate
- Update API routes and UI components
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - feel free to use this for your own projects!
- Documentation: Check this README and inline code comments
- Issues: Create issues on GitHub for bugs or feature requests
- Community: Join the discussion in GitHub Discussions
Made with ❤️ and ⚡ for the Bitcoin community