← all docs
← all docs
atproto-snake
atprotosveltekitgame
atproto-snake is a browser-based Snake game built with SvelteKit that uses AT Protocol for authentication and saves your high score directly to your PDS. Login is available through browser OAuth (recommended) or an app password.
How to Play
- Log in with your AT Protocol handle using OAuth, or switch to the App Password tab and enter your handle and app password
- The game starts after a three-second countdown
- Use the arrow keys or WASD to steer the snake; swipe on touch devices; press Space to pause
- Eat the red food to grow and score points
- Avoid walls and your own tail
- On game over, positive scores are written to your PDS as
uk.ewancroft.snake.scorerecords (best-effort; write failures are logged)
The OAuth flow requests only the atproto repo:uk.ewancroft.snake.score scope, so it can write score records but nothing else in your repository.
Setup
git clone git@github.com:ewanc26/atproto-snake
cd atproto-snake
npm install
npm run dev
Build for production:
npm run build
Project Structure
src/lib/auth/— OAuth and app-password authentication logicsrc/lib/snake/— Core game logic and canvas renderersrc/routes/— Landing, login, game, and game-over pagessrc/lib/components/— Reusable Svelte componentsstatic/client-metadata.json— Production OAuth client metadatastatic/lexicons/uk/ewancroft/snake/score.json— Score record lexicon
Tech Stack
SvelteKit, Tailwind CSS 4, @atproto/lex, @bsky/sdk, @atproto/oauth-client-browser, and Vite. The client-only app builds with @sveltejs/adapter-vercel using a Node.js 22 runtime.
Licence
MIT.
← all docs