https://snake-game-self-five.vercel.app/
- React 18
- Vite
- Canvas API
- Lucide Icons
- Fetch API (REST communication with backend)
- Classic Snake gameplay using Canvas
- Mobile swipe controls
- Keyboard controls (Arrow keys / WASD)
- Live leaderboard (fetched from backend API)
- Auto-refresh leaderboard
- Score submission to backend
- Responsive UI with modern styling
- Optional sound effects
Frontend communicates with a Spring Boot API:
GET https://snakegame-api-fefxc8b8bcguajd0.polandcentral-01.azurewebsites.net/api/scoresPOST /api/scores
Content-Type: application/json
{
"playerName": "TestPlayer",
"score": 120
}- Game runs fully on client side (React state + Canvas rendering)
- Leaderboard is fetched every 10 seconds
- On Game Over → score is sent to backend
- UI updates automatically after response
cd frontend
npm install
npm run devApp runs on:
http://localhost:5173
npm run build- Hosted on Vercel
- CI/CD from GitHub main branch
- Backend hosted separately on Azure App Service
- No authentication (public demo project)
- Leaderboard rank is calculated on frontend (
index + 1) - Backend returns raw score data
- Designed for mobile + desktop
MIT