A small Next.js web app that accepts Bitcoin Lightning tips. Pick (or type) a sat amount, leave an optional message, and pay the generated invoice from any Lightning wallet. The page polls invoice status and celebrates with confetti on payment.
Built by ATL BitLab.
- Next.js 15 (App Router, Turbopack dev)
- React 19
- TypeScript 5
- TailwindCSS 4
- Lightning via
@getalby/sdkover Nostr Wallet Connect (NWC) qrcode.react,react-confetti,axios
POST /api/invoice— server creates a Lightning invoice via NWCmakeInvoiceand returns{ paymentRequest, paymentHash }.GET /api/invoice?paymentHash=...— server calls NWClookupInvoice; client polls every 3s untilsettled_atis set.- The
wspackage is shimmed ontoglobalThis.WebSocketso the NWC client can connect from a Next.js Route Handler.
- Clone:
git clone https://github.com/ATLBitLab/lntipjar.git cd lntipjar - Install:
yarn install - Create
.env.localwith a Nostr Wallet Connect URL from your wallet (Alby, Mutiny, Coinos, etc.):SeeNOSTR_WALLET_CONNECT_URL=nostr+walletconnect://<your-connect-url>.env.example. - Run:
yarn dev - Open http://localhost:3000.
| Command | What it does |
|---|---|
yarn dev |
Dev server (Turbopack) on :3000 |
yarn build |
Production build |
yarn start |
Start production server |
yarn lint |
ESLint (next/core-web-vitals) |
app/
api/invoice/route.ts # POST creates invoice, GET checks status
components/
TipJar.tsx # Main UI (client)
TipJarWrapper.tsx # Dynamic import wrapper, ssr: false
Button.tsx # Shared button
layout.tsx # Root layout, metadata, OG tags
page.tsx # Home
globals.css
public/ # Images, favicon
NOSTR_WALLET_CONNECT_URL (required) — NWC URI of the wallet that will issue and look up invoices.
Built by ATL BitLab.
