Projects
Sinuquinha do Pix
Online 3D pool for playing with friends in the browser, no sign-up: create a table, share the link, play.

What it does
Sinuquinha do Pix is a bar pool table on the web. One person creates a table, shares the link in the group chat, and up to 8 friends sit down to play (up to 4 in Mata-mata). Anyone not playing watches live. You aim with the mouse or a finger, pick the power and the spin point on the cue ball, and shoot. The aim line already shows where the cue ball and the object ball will go. There are 6 modes: 8-ball, Brazilian sinuca, Snooker, Snooker with powers, Mata-mata and Free table.
- No account, no install: a table is a link, with up to 8 players plus anyone who wants to watch.
- Aim that shows spin: ghost ball and cue-ball path already include spin and ball-to-ball throw.
- Everyone sees the shooter's aim, power and spin point live.
- 6 modes, including Mata-mata, the Brazilian bar game.
- Made for friends: a YouTube video the whole table hears, a per-turn time limit, votes to kick and a shot-by-shot log.
How it is built
Deterministic 2D physics, written from scratch
No sine, cosine or atan2: only arithmetic and square roots, which give the same result in every browser, with a fixed 1/240 s step. It covers cue-ball spin, ball-to-ball throw and collisions solved at the exact moment of contact.
Real time on Cloudflare Durable Objects
Each table is one object, with its state in the object's own SQLite-backed storage; a separate object keeps the list of tables. Hibernatable WebSockets, with pings answered without waking the object.
Rules and table state as pure functions
The table state machine and each mode's rules know nothing about Cloudflare; the Durable Object only delivers messages, stores state and schedules alarms. The shot is simulated in the shooter's browser, and if the shooter drops, the server accepts another player's result after 10 s.
Protocol as the trust boundary
Every browser message goes through a single validation step. Other players' aim arrives at most 20 times per second, always with the latest adjustment, and is smoothed on the watcher's screen.
Tests and CI
139 tests (Vitest) for physics, aim, rules, table state and protocol, plus a smoke test that opens a real table with two people. GitHub Actions CI on every PR. The client checks the live version every 60 s and reloads itself, never during a shot.
Stack
- TypeScript
- Three.js (WebGL)
- Vite
- Web Audio
- Cloudflare Workers
- Durable Objects
- WebSocket
- Vitest
- GitHub Actions
Screens


