Flappy Nexus is a browser-based Web3 Flappy-style game with an on-chain leaderboard and optional staking flow.
- Privy Session Login for wallet access.
- Offchain Mode for casual gameplay.
- Onchain Mode to submit score to smart contract.
- Leaderboard to view top players.
- NFT Mint support for game skin flow.
- Stake Page auto-connects wallet from existing Privy session (no manual connect button).
- Open: https://flappynexus.vercel.app/
- Login with Privy.
- Choose Play Offchain or Play Onchain.
- Submit score after game over (onchain mode).
- Open leaderboard to view ranking.
- Frontend: HTML5 Canvas + Vanilla JavaScript + TailwindCSS
- Web3: Ethers.js v5
- Auth: Privy
- Backend verifier: Native Node.js (
http/https)
Use the backend verifier to securely validate Privy identity tokens using server-side secrets.
Untuk verifikasi auth token Privy secara aman (pakai PRIVY_APP_SECRET di server), gunakan backend kecil di folder backend/ (tanpa dependency npm tambahan).
cd backend
cp .env.example .env
node privy-auth-server.jsPORT(default:8787)PRIVY_APP_IDPRIVY_APP_SECRETPRIVY_VERIFY_URL(optional, default:https://auth.privy.io/api/v1/sessions/verify)
GET /api/healthPOST /api/privy/verify
Request body:
{
"identityToken": "<privy_identity_token>"
}- Never put
PRIVY_APP_SECRETin frontend code. - Frontend should verify session through backend endpoint:
POST /api/privy/verify.
Body:
{
"identityToken": "<token-dari-privy-frontend>"
}Jangan pernah simpan
PRIVY_APP_SECRETdi frontend. Frontend FlappyNexus diarahkan memverifikasi sesi Privy ke endpoint backendPOST /api/privy/verify.
Built by @0xzvan for the Web3 gaming community.