Next.js (Pages Router) frontend for the Tower Jackpot game. The UI connects to the backend over WebSockets and builds Anchor transactions to interact with on-chain programs via the user wallet.
- Next.js + React + TypeScript
- Tailwind CSS + Sass
- Solana Wallet Adapter (
@solana/wallet-adapter-*) - Anchor (
@project-serum/anchor) socket.io-client,axios,@tanstack/react-query
- Node.js 20+
Install dependencies:
npm installnpm run devnpm run lintnpm run buildStart the production server:
npm run startNote:
npm run startuses the port defined inpackage.json(next start -p 4578).
Update runtime endpoints and RPC in src/config.tsx:
- API base URLs (e.g.
API_URL,GRAVE_API_URL,INFINITE_API_URL) - Socket URLs (e.g.
SOCKET_URL,GRAVE_SOCKET_URL,INFINITE_SOCKET_URL) - RPC endpoint (
RPC_URL)
Wallet/network selection is configured in src/components/wallet/Wallet.tsx (currently WalletAdapterNetwork.Mainnet).
- Wallet does not connect: verify your wallet extension injects
window.solanaand that it supports transaction signing. - No real-time updates: verify the socket URLs in
src/config.tsxand confirm the backend emits the expected socket events.
If you need help: