Files
LightningLotto/front_end
Michilis 918d3bc31e feat: Add configurable draw cycles, improve UX
Backend:
- Add configurable draw cycle settings (minutes/hourly/daily/weekly/custom)
- Add CYCLE_TYPE, CYCLE_INTERVAL_*, CYCLE_DAILY_TIME, CYCLE_WEEKLY_* env vars
- Add SALES_CLOSE_BEFORE_DRAW_MINUTES and CYCLES_TO_GENERATE_AHEAD
- Fix SQLite parameter issue in scheduler

Frontend:
- Add 'Save This Link' section with copy button on ticket status page
- Improve draw animation to show immediately when draw starts
- Show 'Waiting for next round...' instead of 'Drawing Now!' after draw
- Hide Buy Tickets button when waiting for next round
- Skip draw animation if no tickets were sold
- Keep winner screen open longer (15s) for next cycle to load
- Auto-refresh to next lottery cycle after draw

Telegram Bot:
- Various improvements and fixes
2025-11-28 03:24:17 +00:00
..

Lightning Lottery Frontend

Next.js-based frontend for the Lightning Lottery system.

Features

  • Responsive Design: Mobile-first, works on all devices
  • Real-time Updates: Live countdown and automatic status polling
  • Lightning Payments: QR code invoice display
  • Nostr Authentication: Optional user login via NIP-07
  • User Dashboard: View tickets, wins, and statistics

Tech Stack

  • Framework: Next.js 14 (App Router)
  • Language: TypeScript
  • Styling: TailwindCSS
  • State Management: Redux Toolkit
  • QR Codes: qrcode.react

Setup

Prerequisites

  • Node.js 18+
  • Backend API running

Installation

  1. Install dependencies:
npm install
  1. Configure environment:
cp .env.example .env.local
# Edit .env.local with your configuration
  1. Run development server:
npm run dev

Open http://localhost:3001

Production Build

npm run build
npm start

Environment Variables

  • NEXT_PUBLIC_API_BASE_URL - Backend API URL
  • NEXT_PUBLIC_APP_BASE_URL - Frontend public URL

Pages

  • / - Home page with current jackpot
  • /buy - Buy lottery tickets
  • /tickets/[id] - Ticket status page (public)
  • /dashboard - User dashboard (Nostr auth required)
  • /dashboard/tickets - User's ticket history
  • /dashboard/wins - User's wins

Components

Reusable Components

  • TopBar - Navigation header
  • Footer - Site footer
  • JackpotCountdown - Live countdown timer
  • JackpotPotDisplay - Pot amount display
  • LightningInvoiceCard - Invoice QR code and copy
  • TicketList - Display ticket serial numbers
  • PayoutStatus - Payout status indicator
  • NostrLoginButton - Nostr authentication

Deployment

Vercel

vercel

Netlify

netlify deploy --prod

Docker

docker build -t lightning-lotto-frontend .
docker run -p 3001:3000 lightning-lotto-frontend

License

MIT