Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Snake Environment Variables
# Copy to .env.local for local development

# Supabase (optional - for global leaderboard)
# Get from Supabase: Project Settings > API
# VITE_SUPABASE_URL=https://xxxxx.supabase.co
# VITE_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ Try Snake here: https://snake-beryl-six.vercel.app/

---

## 🏆 Supabase Leaderboard (Optional)

To enable the global leaderboard:

1. Create a [Supabase](https://supabase.com) project
2. Run the migration in `supabase/migrations/001_snake_scores.sql` in the SQL Editor
3. Copy `.env.example` to `.env.local` and add your `VITE_SUPABASE_URL` and `VITE_SUPABASE_ANON_KEY`

Without Supabase, the game still works with local-only score storage.

---

## Contributing

We love contributions of all kinds! Whether it’s fixing a bug, suggesting a feature, or polishing docs, your help makes this game better.
Expand Down Expand Up @@ -124,18 +136,28 @@ Meet all our amazing [Contributors](./CONTRIBUTORS.md)
│ ├── assets
│ │ └── snake-gameplay.gif
│ ├── components
│ │ ├── Board.tsx
│ │ ├── CountdownOverlay.tsx
│ │ ├── GameOverOverlay.tsx
│ │ ├── HUD.tsx
│ │ ├── HowToPlayModal.tsx
│ │ ├── LeaderboardModal.tsx
│ │ ├── MenuScreen.tsx
│ │ ├── MobileControls.tsx
│ │ ├── SettingsModal.tsx
│ │ └── SnakeCanvas.tsx
│ ├── constants
│ │ └── game.ts
│ ├── hooks
│ │ ├── useBestScore.ts
│ │ ├── useCanvas2D.ts
│ │ ├── useGameScale.ts
│ │ ├── useGameSetup.ts
│ │ ├── useInput.ts
│ │ ├── useLeaderboard.ts
│ │ ├── usePauseHotkey.ts
│ │ ├── useSnake.ts
│ │ ├── useSettings.ts
│ │ ├── useSnakeGame.ts
│ │ ├── useSwipe.ts
│ │ └── useTicker.ts
│ ├── main.tsx
│ ├── styles
Expand All @@ -144,9 +166,15 @@ Meet all our amazing [Contributors](./CONTRIBUTORS.md)
│ │ ├── game.ts
│ │ ├── index.ts
│ │ └── ui.ts
│ ├── services
│ │ └── leaderboardService.ts
│ ├── supabase
│ │ └── client.ts
│ └── utils
│ ├── canvas.ts
│ └── logic.ts
│ ├── gameTick.ts
│ ├── logic.ts
│ └── speed.ts
├── tsconfig.json
├── tsconfig.node.json
└── vite.config.ts
Expand Down
8 changes: 7 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, viewport-fit=cover"
/>
<meta name="theme-color" content="#09090b" />
<link rel="icon" type="image/svg+xml" href="/snake.svg" />
</head>
<body>
Expand Down
Loading