0f9d4518aad8c15cccb2afa73419b71cb5e62a79
⚡ LNPaywall
Turn any link into paid access in 60 seconds.
LNPaywall is a platform that lets creators monetize any URL with Lightning Network payments. Paste a link, set a price, share or embed, and get paid instantly.
✨ Features
- 60 Second Setup - Paste a URL, set your price, start earning
- Lightning Payments - Instant, low-fee Bitcoin payments
- Embed Anywhere - Works with Webflow, WordPress, Framer, any website
- No Custody - Funds go directly to your Lightning wallet
- Works with Any Link - Notion, Google Docs, PDFs, videos, private pages
🚀 Quick Start
Prerequisites
- Node.js 18+
- PostgreSQL
- Redis (optional, for sessions)
- LNbits account (for payments)
Backend Setup
cd backend
# Install dependencies
npm install
# Set up environment variables
cp env.example .env
# Edit .env with your configuration
# Generate Prisma client and push schema
npm run db:generate
npm run db:push
# Seed demo data (optional)
npm run db:seed
# Start development server
npm run dev
Frontend Setup
cd frontend
# Install dependencies
npm install
# Set up environment variables
cp env.example .env
# Edit .env with your configuration
# Start development server
npm run dev
Access the app
- Frontend: http://localhost:5173
- Backend API: http://localhost:3001
- API Health: http://localhost:3001/health
Demo Accounts
After running the seed script:
- Admin: admin@lnpaywall.com / admin123
- Creator: creator@demo.com / demo123
📁 Project Structure
LNPaywall/
├── backend/
│ ├── src/
│ │ ├── config/ # Database and app configuration
│ │ ├── controllers/ # Route handlers
│ │ ├── middleware/ # Auth, logging, error handling
│ │ ├── models/ # Prisma schema
│ │ ├── routes/ # API routes
│ │ ├── services/ # Business logic
│ │ └── utils/ # Helpers and validation
│ ├── prisma/
│ │ ├── schema.prisma # Database schema
│ │ └── seed.js # Demo data seeder
│ └── env.example
├── frontend/
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components
│ │ ├── services/ # API client
│ │ ├── store/ # Zustand state management
│ │ └── styles/ # Global CSS
│ ├── public/
│ └── env.example
└── specs.md # Full product specification
🔌 API Endpoints
Authentication
POST /api/auth/signup- Create accountPOST /api/auth/login- Log inPOST /api/auth/logout- Log outPOST /api/auth/refresh- Refresh tokenGET /api/auth/me- Get current user
Paywalls
POST /api/paywalls- Create paywallGET /api/paywalls- List paywallsGET /api/paywalls/:id- Get paywallPATCH /api/paywalls/:id- Update paywallPOST /api/paywalls/:id/archive- Archive paywall
Checkout
POST /api/checkout/:paywallId- Create checkout sessionGET /api/checkout/:sessionId- Get sessionGET /api/checkout/:sessionId/status- Check payment status
Public
GET /p/:slugOrId- Public paywall page dataGET /embed/:id- Embed iframe
🔧 Configuration
LNbits Setup
- Create an LNbits wallet at https://legend.lnbits.com or self-host
- Get your Admin Key and Invoice/Read Key
- Add to your
.env:LNBITS_URL=https://legend.lnbits.com LNBITS_ADMIN_KEY=your-admin-key LNBITS_INVOICE_KEY=your-invoice-key
Database
The app uses PostgreSQL with Prisma ORM. Update your DATABASE_URL in .env:
DATABASE_URL="postgresql://user:password@localhost:5432/lnpaywall"
📦 Embedding
Iframe Embed
<iframe
src="https://your-domain.com/embed/PAYWALL_ID"
width="100%"
height="400"
frameborder="0"
></iframe>
Button + Modal
<script
src="https://your-domain.com/js/paywall.js"
data-paywall="PAYWALL_ID"
data-theme="auto"
></script>
🛡️ Security
- JWT-based authentication with refresh tokens
- HTTPS-only URLs for paywalls
- SSRF protection on URL fetching
- Rate limiting on checkout creation
- Device fingerprinting for access control
- Signed access tokens
📈 Roadmap
- Email receipts
- Custom branding
- Team accounts
- Subscriptions
- Analytics dashboard
- Custom domains
- BTCPay Server integration
📄 License
MIT License - see LICENSE file for details.
🤝 Contributing
Contributions are welcome! Please read the contributing guidelines first.
Built with ⚡ for the Bitcoin ecosystem
Description
Languages
JavaScript
98.5%
CSS
1.1%
HTML
0.4%