A production-ready, full-stack gaming platform on Cloudflare Workers.
- Frontend: vanilla JS SPA with hand-rolled hyperscript + router. Zero build step.
- Backend: Hono on Cloudflare Workers.
- Database: Cloudflare D1 (SQLite).
- Realtime multiplayer: Cloudflare Durable Objects over WebSockets.
- Static assets: Workers Static Assets.
- Auth: cookie sessions + PBKDF-style salted SHA-256 password hashes (upgrade to Argon2id via WebCrypto when ready).
- Domain:
getnexa.space+www.getnexa.space(Cloudflare Custom Domain). - Ads: Google AdSense-ready markup,
ads.txt,robots.txt,sitemap.xml.
Snake · 2048 · Tetris · Memory Match · Brick Breaker · Minesweeper · Tic-Tac-Toe (realtime multiplayer) · Pong (singleplayer vs. CPU).
- AdSense ad slots in homepage, in-game sidebar, article pages.
- Shop with 18+ products: coin packs, Nexa Pro / Nexa Legend subscriptions, Remove Ads subscription, cosmetic themes, avatar frames, XP boosts, power-ups, tournament entries, private rooms.
- Coin economy earned from gameplay.
npm install
npx wrangler d1 create getnexa-db
# put the returned database_id into wrangler.jsonc d1_databases[0].database_id
npm run db:init-local
npm run devnpm run db:init # push schema to production D1
npm run deploy- Apply at https://adsense.google.com with
https://getnexa.space. - Once approved, replace
ca-pub-0000000000000000inpublic/index.htmland the AdSense publisher ID insrc/index.ts/ads.txthandler. - Replace the placeholder
.ad-slotdivs with proper<ins class="adsbygoogle">units (seepublic/core.jsAdSlot).
src/
index.ts # Hono API + static asset serving
game-room.ts # Durable Object for realtime multiplayer
public/
index.html
styles.css
app.js core.js # SPA shell + router
pages/ # home, games, account, shop, leaderboards, static
games/ # per-game modules (snake, 2048, tetris, …)
schema.sql # D1 schema
wrangler.jsonc # Cloudflare config