pixel-wall
a 20M × 20M real-time pixel canvas with its own economy
- 20M × 20M coordinate space
- 10k × 10k chunk rooms
- Stripe-settled zone pricing
- ~119K lines · 143 API routes
A real-time collaborative pixel-art platform on a ±10-million coordinate plane (a 20M × 20M space). A custom Node.js server runs Next.js and Socket.IO in a single process over PostgreSQL and Prisma.
The realtime layer shards the plane into 10k × 10k chunk rooms, so each client subscribes only to its viewport, and pixel and live-cursor broadcasts stay targeted. Every socket is pinned to a server-resolved identity (a DB-validated session, an admin token, or an HMAC-SHA256-signed anonymous id), and every write path is gated on it.
The standout engineering is the monetization: a dynamic viewport-zone pricing economy keyed to real screen resolutions. It settles through a signature-verified, idempotent Stripe webhook that activates premium codes and cosmetics and, on refund or dispute, revokes them and removes the placed art. Territory protection uses alpha-aware, pixel-perfect overlap detection that decodes images to raw RGBA via Sharp and fails closed, so paid artwork can never be silently overdrawn.
The codebase is large and coherent: 62 Prisma models, 143 API routes, ~119K lines of TypeScript, and a 21-page admin console. It ships chat/DMs, an in-game economy, full moderation, and custom Google/Discord/GitHub OAuth. Security runs throughout: per-request CSP nonces, CSRF protection, Turnstile and reCAPTCHA v3, tiered-trust rate limiting, and fail-fast env validation. CI spins up PostGIS, enforces migration-drift checks, and runs a production dependency audit.