🎰 S☉Lucky
Website: dailywin.sol Account: ArrZMZh5heYyy4hWzcEXbV2wbxyHxf7rugEvFuNzE3LE
Connect your wallet, pick your lucky number, and watch the pot grow in real-time ✨
SOLucky is a fully decentralized, transparent daily lottery built on Solana. Every ticket is stored on-chain with complete fairness and verifiability. The platform features real-time updates, live statistics, and seamless wallet integration.
- 🔒 Trustless & Transparent - All tickets stored on-chain
- ⚡ Real-time Updates - Watch the pot grow with Socket.IO
- 🌍 Global Participation - Track players by country
- 💰 Live SOL/USD Pricing - Real-time market rates
- 📊 Historical Analytics - Complete draw history and stats
- 🎨 Beautiful UI - Modern design with Tailwind CSS
graph LR
A[👛 Solana Wallet] --> B[🎨 Vue 3 Client]
B --> C[⚡ Node.js + Socket.IO]
C --> D[🐘 PostgreSQL]
C --> E[⛓️ Solana Program]
B --> E
| Layer | Technology | Location |
|---|---|---|
| Smart Contract | Rust + Anchor | solotto/*/src/program/lib.rs |
| Backend Server | Express + Socket.IO | solotto/server/ |
| Lottery dApp | Vue 3 + Tailwind | solotto/client/ |
| Landing Page | Vue 3 | web/ |
| Database | PostgreSQL | Remote/Local |
| Real-time | Socket.IO | Backend & Clients |
1. User connects Solana wallet 👛
2. Client commits ticket (number + country) 🎟️
3. Backend broadcasts update via Socket.IO 📡
4. On-chain ticket account created ⛓️
5. Stats aggregated in PostgreSQL 📊
6. Live updates pushed to all clients ⚡
- 🔐 Solana Wallet Integration - Phantom, Solflare, and more
- 🎟️ Ticket Commitment - Choose your lucky number (0-99)
- 🌍 Country Tracking - Geographic distribution of players
- ⏰ Daily Draws - Reset at 00:00:00 UTC
- 💰 Live Pot Value - Updated in SOL and USD
- 👥 Active Players - Connected users count
- ✅ Verified Tickets - Total committed tickets
- 🗺️ Global Map - Players by country
- ⚡ Socket.IO - Sub-second update latency
- 📈 Chart.js Integration - Historical data visualization
- 🎨 Tailwind CSS - Responsive, modern UI
- 🔄 Auto-rotation - Daily table creation at 08:00 UTC
- 💱 Live Ticker - Bitstamp SOL/USD feed
# Required
Node.js >= 16
npm or yarn
PostgreSQL >= 12
# Optional (for smart contract development)
Rust + Cargo
Solana CLI
Anchor Framework# 1. Clone the repository
git clone https://github.com/yourusername/77.git
cd 77
# 2. Install root dependencies
npm install
# 3. Install backend dependencies
cd solotto/server
npm install
# 4. Install client dependencies
cd ../client
npm install
# 5. Install web landing dependencies
cd ../../web
npm install# Terminal 1 - Backend Server (Port 5001)
cd solotto/server
node server.js
# Terminal 2 - Lottery Client (Port 8080)
cd solotto/client
npm run serve
# Terminal 3 - Landing Page (Port 8081)
cd web
npm run serveCreate solotto/server/.env:
# Database
POSTGRE_URL=postgres://user:password@localhost:5432/solucky
# CORS
CLIENT_URL=http://localhost:8080
# Server
PORT=5001Create solotto/client/.env:
# Backend WebSocket
VUE_APP_SOCKET_ENDPOINT=http://localhost:5001
# Solana Cluster
VUE_APP_CLUSTER_URL=https://api.devnet.solana.com
# For mainnet: https://api.mainnet-beta.solana.com
# Program ID
VUE_APP_PROGRAM_ID=fH2j1AXaGr14kCroRseuetQsJmi6rij1NNqkBicdksrCreate web/.env:
VUE_APP_SOCKET_ENDPOINT=http://localhost:5001
VUE_APP_CLUSTER_URL=https://api.devnet.solana.com💡 Tip: Check
.env.samplefiles in each directory for complete examples
Location: solotto/client/src/program/lib.rs
| Instruction | Parameters | Description |
|---|---|---|
send_ticket |
owner, number: i32, country: String |
Create new ticket |
delete_ticket |
- | Delete single ticket |
delete_tickets |
- | Delete all user tickets |
close |
- | Close account and reclaim rent |
force_defund |
- | Safety mechanism for closed accounts |
pub struct Ticket {
pub owner: Pubkey, // Wallet address
pub timestamp: i64, // Unix timestamp
pub number: i32, // Lucky number (0-99)
pub country: String, // ISO country code
}Program ID: fH2j1AXaGr14kCroRseuetQsJmi6rij1NNqkBicdksr
Location: solotto/server/
| Event | Direction | Payload | Description |
|---|---|---|---|
getPOT |
Server → Client | { sol: Number, usd: Number } |
Current pot value |
getTickets |
Server → Client | Array<Ticket> |
All active tickets |
nVerified |
Server → Client | Number |
Verified ticket count |
nPlayers |
Server → Client | Number |
Unique player count |
getHistory |
Server → Client | Array<Draw> |
Historical draws |
userNumber |
Client → Server | { number: Number, country: String } |
Commit ticket |
# Production
npm start
# Development (auto-reload)
npm run devMain application with:
- 🎮 Play panel (ticket submission)
- 💰 Pot display (SOL/USD)
- 📊 Statistics dashboard
- 📜 History viewer
Marketing site with:
- 🎨 Hero section
- 👛 Wallet status
- 📱 Call-to-action
# Development server
npm run serve
# Production build
npm run build
# Linting
npm run lintTables are auto-created at 08:00 UTC with format: _YYYY_MM_DD_
CREATE TABLE _2024_10_21_ (
id SERIAL PRIMARY KEY,
owner VARCHAR(44),
number INT,
country VARCHAR(2),
timestamp BIGINT,
verified BOOLEAN DEFAULT false
);Problem: Client can't connect to Socket.IO server
Solutions:
- ✅ Verify
VUE_APP_SOCKET_ENDPOINTmatches backend URL - ✅ Check CORS settings in
solotto/server/server.js - ✅ Ensure backend server is running on correct port
- ✅ Check firewall/network settings
Problem: No data displayed in UI
Solutions:
- ✅ Verify PostgreSQL connection via
POSTGRE_URL - ✅ Check if daily table exists (created at 08:00 UTC)
- ✅ Inspect browser console for errors
- ✅ Ensure backend has database permissions
Problem: Can't connect Solana wallet
Solutions:
- ✅ Check
VUE_APP_CLUSTER_URLis valid RPC endpoint - ✅ Verify wallet adapter is properly installed
- ✅ Test with different wallet (Phantom, Solflare, etc.)
- ✅ Check browser console for adapter errors
- ✅ Ensure wallet has SOL for transaction fees
Problem: npm install or build fails
Solutions:
- ✅ Use Node.js 16 or higher
- ✅ Clear
node_modulesand reinstall:rm -rf node_modules && npm install - ✅ Clear npm cache:
npm cache clean --force - ✅ Check for node-gyp issues on Windows
We welcome contributions! Please follow these steps:
- 🍴 Fork the repository
- 🌿 Create a feature branch (
git checkout -b feature/amazing-feature) - 💾 Commit your changes (
git commit -m '✨ Add amazing feature') - 📤 Push to the branch (
git push origin feature/amazing-feature) - 🎉 Open a Pull Request
- Ensure all linters pass before submitting
- Write clear commit messages
- Update documentation for new features
- Test thoroughly on devnet before proposing mainnet changes
- 🎨 UI/UX improvements
- 🔔 Push notifications for draws
- 📱 Mobile app (React Native)
- 🏆 Leaderboard system
- 🎁 Referral rewards
- 🌐 Multi-language support
- 🔐 Enhanced security audits
- 📈 Advanced analytics dashboard
This project is licensed under the MIT License - see the LICENSE file for details.
- Solana Foundation for the amazing blockchain
- Anchor Framework for smart contract development
- Vue.js community for excellent tooling
- Socket.IO for real-time communication
Built with ❤️ on Solana