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
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
- Install dependencies:
npm install
- Configure environment:
cp .env.example .env.local
# Edit .env.local with your configuration
- Run development server:
npm run dev
Production Build
npm run build
npm start
Environment Variables
NEXT_PUBLIC_API_BASE_URL- Backend API URLNEXT_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 headerFooter- Site footerJackpotCountdown- Live countdown timerJackpotPotDisplay- Pot amount displayLightningInvoiceCard- Invoice QR code and copyTicketList- Display ticket serial numbersPayoutStatus- Payout status indicatorNostrLoginButton- 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