Like Wordle, but with blocks.
One daily sequence. Same pieces for everyone. Only your best run counts.
Free, no ads, and built for your phone.
Swipetris is a mobile-first PWA built around one-thumb controls:
- Drag to move
- Tap to rotate
- Flick down to drop
- Play the same seeded piece sequence as everyone else each day
- Submit your best run to the daily arcade leaderboard
- Install it to your home screen and play offline
There are no accounts, ads, cookies, tracking, or product analytics. Gameplay stays local; only leaderboard requests and score submissions send game data to the Swipetris server.
- The game is rendered with three.js in
public/app.js - The play UI uses Alpine.js in
public/play.html - Landing-page motion is mostly CSS; the phone demo is driven by
public/landing.js - Local development runs on Bun and Hono
- Production is static Cloudflare Pages plus dependency-free Pages Functions
- Scores are stored in Turso
The README lockup is rendered from the landing-page .brand-lockup with Vercel Satori:
bun run generate:brandThis updates public/brand.svg and public/play-button.svg from the brand and CTA markup in public/index.html.
Requirements: Bun 1.2 or newer.
git clone https://github.com/bitbonsai/swipetris.git
cd swipetris
bun install
bun run devOpen http://localhost:3000. Without environment variables, the server creates a local swipetris.db SQLite database.
To use Turso instead:
cp .env.example .env
# Fill in TURSO_URL and TURSO_TOKEN
bun run devCareful: a Turso-backed local server writes to that remote database. Use a development database unless you intentionally want to write to production.
cp .env.example .env
bunx wrangler pages dev publicWrangler serves public/ and loads the routes in functions/api/. The Pages Functions intentionally use the raw libSQL HTTP API and have no npm imports; this repository has no production build step.
- Create a Turso database and apply
schema.sql, for example withturso db shell <database> < schema.sql. - Create a Cloudflare Pages project connected to your fork.
- Leave the build command empty and set the output directory to
public. - Add
TURSO_URLandTURSO_TOKENin the Pages project settings. - Deploy the
mainbranch.
Cloudflare discovers functions/ automatically. Environment-variable changes only apply to new deployments.
public/ Static site, game, PWA assets, and vendored browser libraries
functions/api/ Cloudflare Pages leaderboard endpoints
src/ Bun/Hono local development server and database schema
schema.sql Production database bootstrap
Scores are untrusted client input. The API validates payload shape, daily seeds, score plausibility, timing, and submission rate before storing a result. These checks discourage casual abuse; they are not cryptographic proof of gameplay. Production operators should also configure platform-level rate limiting and monitor anomalous scores.
See SECURITY.md for reporting vulnerabilities.
Bug reports and focused pull requests are welcome. Read CONTRIBUTING.md before opening a PR.
Swipetris is released under the MIT License. Vendored dependencies retain their own licenses; see THIRD_PARTY_NOTICES.md.
This is an independent project and is not affiliated with or endorsed by The Tetris Company. Third-party names and trademarks belong to their respective owners.
