Skip to content

bnonni/bitping.me

Repository files navigation

bitping.me

Bitcoin price alert service. Set a BTC/USD target price, pay a Lightning invoice, get notified by SMS or email when the price hits. No accounts, no subscriptions — just alerts.

Live at bitping.me

How It Works

  1. Enter a target BTC/USD price and choose above/below trigger logic.
  2. Select an exchange for price data (Kraken, Coinbase, Binance, Bitstamp, CoinGecko, Mempool).
  3. Choose SMS or email notification.
  4. Pay the Lightning invoice.
  5. A scheduled job monitors prices and sends your alert when the target is hit.

Tech Stack

Layer Technology
App Next.js (Pages Router), TypeScript, Tailwind CSS v4
Database PostgreSQL via Prisma ORM
Payments Bitcoin Lightning Network (Bitvora / Speed LSP)
Notifications Mailgun (SMS via email-to-SMS gateway, email via SMTP)
Deployment Docker on DigitalOcean App Platform

Local Development

# Clone and install
git clone https://github.com/bnonni/bitping.me.git
cd bitping.me
pnpm install

# Configure environment
cp template.env .env
# Fill in your values — see Environment Variables below

# Set up database
pnpm db:generate
pnpm db:migrate-dev-init

# Start dev server
pnpm dev

The app runs at http://localhost:3000.

Commands

Command Description
pnpm dev Start dev server
pnpm build Generate Prisma client + build app
pnpm lint Run ESLint
pnpm db:generate Generate Prisma client
pnpm db:migrate-dev-init Initial dev migration
pnpm db:migrate-dev Subsequent dev migrations
pnpm db:migrate-prod Production migration (deploy only)

Environment Variables

Copy template.env to .env and fill in the values:

Variable Description
APP_NAME Application name
APP_API_URL Base URL (e.g. http://localhost:3000 for dev)
APP_API_KEY Internal API key (UUID) for service-to-service auth
APP_DATABASE_URL PostgreSQL connection string
SESSION_SECRET Min 32 characters, required in production
MAILGUN_DOMAIN Mailgun domain (sandbox or custom)
MAILGUN_FROM_EMAIL Sender email address
MAILGUN_API_USER Mailgun API username
MAILGUN_SMTP_PASSWORD Mailgun SMTP password
MAILGUN_SENDING_API_KEY Mailgun sending API key
MAILGUN_API_KEY Mailgun API key (optional)
SPEED_PUBLIC_KEY Speed LSP public key
SPEED_SECRET_KEY Speed LSP secret key
SPEED_API_KEY Speed LSP API key
SPEED_API_URL Speed API base URL

Alert Processing

The GET /api/alert/process endpoint is the core alert loop. It checks all paid, unsent alerts against live exchange prices and sends notifications when targets are hit. This endpoint needs to be called on a schedule (e.g. cron job, cloud scheduler) — it does not run automatically.

It requires Authorization: Basic <APP_API_KEY> to prevent unauthorized access.

Payments

Alerts are paid individually via Lightning invoices. Compatible with any Lightning wallet — Phoenix, Zeus, Breez, Muun, or any Lightning-enabled exchange.

Docker

The included Dockerfile builds a Node 18 Alpine image with pnpm. The entrypoint script (scripts/docker-start.sh) runs database migrations on startup and starts the app. A health check endpoint at /api/health verifies database connectivity and required environment variables.

License

Unlicense — public domain.

Contributing

Issues and PRs welcome at github.com/bnonni/bitping.me.

About

Lightning-Powered Bitcoin Price Alerts via SMS/Email

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors