This app lets you create an on-chain prize wheel on Sui Testnet, spin to pick winners, and track results. Connect your wallet, configure entries and prizes, and spin fairly using on-chain randomness.
Note: This app supports both off-chain and on-chain on Sui. To use on-chain features, please connect your wallet.
The wheel uses on-chain randomness to select winners from the remaining entries without replacement (unique winners). Each spin removes the winner and all their duplicate entries if any. Winners are assigned prizes in the order of spins. Claims are time-locked with a delay and must occur within the claim window after their spin. The organizer controls spins and can cancel the wheel before spins to reclaim the pool.
Built with Svelte 5, Tailwind CSS 4 and daisyUI.
Create a .env file (copy from .env.example) to configure optional features:
DATABASE_URL: MongoDB connection string. Optional. Required if you want to enable analytics.X_API_KEY: X (Twitter) API Key. Optional. Required for importing entries from X posts.PUBLIC_ENOKI_API_KEY & PUBLIC_GOOGLE_CLIENT_ID: Required for Google login (use Enoki ZkLogin). Visit https://enoki.mystenlabs.com/ to setup.netlify.toml)package.json)Enable Corepack to use the exact pnpm version:
corepack enable
corepack prepare [email protected] --activate
pnpm --version
Use the scripts from package.json:
pnpm install
pnpm dev # start the dev server
pnpm build # build the app
pnpm preview # preview the production build locally
This project is already configured with the Netlify adapter and netlify.toml:
pnpm buildbuild22.12.0 (already in netlify.toml)# Log in and initialize the site (first time)
pnpm dlx netlify-cli@latest login
pnpm dlx netlify-cli@latest init
# Build using the package.json script
pnpm build
# Deploy the build directory to production
pnpm dlx netlify-cli@latest deploy --dir=build --prod
Note: This is a front-end app using SvelteKit + the Netlify adapter, no separate backend required. If you need environment variables, set them in your Netlify site settings.