Add sponsors system with time slider, LNbits invoices, and UX improvements

- Sponsors table, LNbits createInvoice, webhook handler
- Sponsor routes: create, homepage, list, my-ads, click, extend, check-payment
- Admin routes for sponsor management
- Frontend: SponsorForm, SponsorTimeSlider, SponsorCard, SponsorsSection
- Sponsors page, My Ads page, homepage sponsor block
- Header login dropdown with My Ads, Create Sponsor
- Transactions integration for sponsor payments
- View/click tracking
- OG meta fetch for sponsor images
- Sponsor modal spacing, invoice polling fallback
- Remove Lightning address and Category fields from sponsor form

Made-with: Cursor
This commit is contained in:
Michilis
2026-03-16 00:01:19 +00:00
parent ac9b8dc330
commit dc7007f708
30 changed files with 3123 additions and 68 deletions

View File

@@ -69,3 +69,29 @@ CREATE INDEX IF NOT EXISTS idx_quotes_expires_at ON quotes(expires_at);
CREATE INDEX IF NOT EXISTS idx_quotes_status ON quotes(status);
CREATE INDEX IF NOT EXISTS idx_deposits_created_at ON deposits(created_at);
CREATE INDEX IF NOT EXISTS idx_deposits_lnbits_payment_hash ON deposits(lnbits_payment_hash);
CREATE TABLE IF NOT EXISTS sponsors (
id INTEGER PRIMARY KEY AUTOINCREMENT,
npub TEXT NOT NULL,
title TEXT NOT NULL,
description TEXT NOT NULL,
image_url TEXT,
link_url TEXT NOT NULL,
category TEXT,
lightning_address TEXT,
invoice_id TEXT,
payment_hash TEXT,
price_sats INTEGER NOT NULL,
duration_days INTEGER NOT NULL,
status TEXT NOT NULL CHECK(status IN ('pending_payment','pending_review','active','expired','removed')),
created_at INTEGER NOT NULL,
activated_at INTEGER,
expires_at INTEGER,
views INTEGER DEFAULT 0,
clicks INTEGER DEFAULT 0,
extends_sponsor_id INTEGER
);
CREATE INDEX IF NOT EXISTS idx_sponsors_status ON sponsors(status);
CREATE INDEX IF NOT EXISTS idx_sponsors_npub ON sponsors(npub);
CREATE INDEX IF NOT EXISTS idx_sponsors_expires_at ON sponsors(expires_at);
CREATE INDEX IF NOT EXISTS idx_sponsors_payment_hash ON sponsors(payment_hash);