๐ฐ SโLucky
Website: dailywin.sol Account: ArrZMZh5heYyy4hWzcEXbV2wbxyHxf7rugEvFuNzE3LE
Connect your wallet, pick your lucky number, and watch the pot grow in real-time โจ
Quick Start โข Features โข Architecture โข Configuration
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