Skip to content

eklinkhammer/voltvoice-io

Repository files navigation

CryptoSuperChat

CI

A Bitcoin donation platform for streamers powered by BTCPay Server.

Features

  • Accept Bitcoin donations via Lightning Network or on-chain
  • Self-custodial - you control your own wallet
  • Customizable donation pages
  • Real-time payment notifications
  • Admin dashboard for managing donations

Prerequisites

  • Docker and Docker Compose
  • Git

Quick Start

  1. Clone the repository:
git clone https://github.com/yourusername/cryptosuperchat.git
cd cryptosuperchat
  1. Create environment file:
cp .env.example .env
  1. Edit .env and set your secrets:
# Generate a secure JWT secret
JWT_SECRET=$(openssl rand -hex 32)
  1. Start all services:
make dev
# or
docker-compose up
  1. Wait for all services to start (this may take a while on first run as Bitcoin Core syncs headers).

  2. Access the services:

BTCPay Server Setup

After the containers are running, you need to configure BTCPay Server:

  1. Open http://localhost:49392
  2. Create an admin account
  3. Generate an API key with the following permissions:
    • btcpay.store.cancreateinvoice
    • btcpay.store.canmodifystoresettings
    • btcpay.store.canviewstoresettings
    • btcpay.store.webhooks.canmodifywebhooks
  4. Add the API key to your .env file as BTCPAY_API_KEY
  5. Restart the backend: docker-compose restart backend

Architecture

┌─────────────────┐     ┌─────────────────┐
│    Frontend     │────▶│     Backend     │
│  (React/Vite)   │     │    (Go/Gin)     │
└─────────────────┘     └────────┬────────┘
                                 │
                                 ▼
┌─────────────────┐     ┌─────────────────┐
│   PostgreSQL    │◀────│  BTCPay Server  │
│   (Database)    │     │   (Payments)    │
└─────────────────┘     └────────┬────────┘
                                 │
                                 ▼
                        ┌─────────────────┐
                        │   NBXplorer     │
                        └────────┬────────┘
                                 │
                                 ▼
                        ┌─────────────────┐
                        │  Bitcoin Core   │
                        │   (Pruned)      │
                        └─────────────────┘

Development

Available Make Commands

make dev          # Start in development mode with hot-reload
make up           # Start all services in background
make down         # Stop all services
make logs         # View logs from all services
make backend-logs # View backend logs
make frontend-logs # View frontend logs
make btcpay-logs  # View BTCPay logs
make db-shell     # Open PostgreSQL shell
make clean        # Remove all containers, volumes, and images

Project Structure

cryptosuperchat/
├── backend/           # Go backend
│   ├── cmd/server/    # Entry point
│   ├── internal/
│   │   ├── config/    # Configuration
│   │   ├── entity/    # Domain models
│   │   ├── repository/# Database layer
│   │   ├── usecase/   # Business logic
│   │   ├── handler/   # HTTP handlers
│   │   └── middleware/# Middleware
│   └── pkg/btcpay/    # BTCPay client
├── frontend/          # React frontend
│   └── src/
│       ├── pages/     # Page components
│       ├── components/# Reusable components
│       ├── services/  # API layer
│       └── context/   # React contexts
├── btcpay/           # BTCPay config
└── scripts/          # Setup scripts

API Endpoints

Public

  • GET /api/v1/streamers/:username - Get streamer profile
  • POST /api/v1/donations - Create a donation
  • GET /api/v1/donations/:id/status - Check payment status

Authentication

  • POST /api/v1/auth/register - Register new streamer
  • POST /api/v1/auth/login - Login
  • POST /api/v1/auth/refresh - Refresh token
  • POST /api/v1/auth/logout - Logout

Admin (Protected)

  • GET /api/v1/admin/profile - Get profile
  • PUT /api/v1/admin/profile - Update profile
  • GET /api/v1/admin/donations - List donations
  • PUT /api/v1/admin/donations/:id/display - Mark donation as displayed
  • GET /api/v1/admin/stats - Get statistics

Webhooks

  • POST /api/v1/webhooks/btcpay - BTCPay webhook handler

Production Deployment

For production deployment:

  1. Use proper SSL/TLS certificates
  2. Set strong passwords and secrets
  3. Configure proper firewall rules
  4. Use a reverse proxy (nginx, Caddy, etc.)
  5. Consider using a managed database
  6. Monitor Bitcoin Core sync status

License

MIT

About

Bitcoin/Lightning donation platform for streamers — like YouTube SuperChat, but with crypto payments via BTCPay Server

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors