A modern Snake game with a retro aesthetic, featuring multiplayer spectator mode, leaderboards, and game persistence.

- Framework: React + TypeScript + Vite
- UI: Shadcn/ui components
- State Management: React Query
- Testing: Vitest
- Framework: FastAPI (Python)
- Package Manager: uv
- Testing: pytest + httpx
- Node.js (v18+)
- Python (3.12+)
- uv (Python package manager)
cd backend
make install # or: uv synccd frontend
npm installRun both frontend and backend with a single command:
npm run devIf you prefer to run them separately:
cd backend
make devcd frontend
npm run devThe application will be available at:
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
cd backend
make test # or: uv run pytest tests.pycd frontend
npm testcd backend
make verify # or: uv run python verify_api.pyvibe-coding-snake/
├── backend/
│ ├── src/
│ │ ├── models.py # Pydantic models
│ │ ├── mock_db.py # In-memory database
│ │ └── routers/ # API endpoints
│ ├── main.py # FastAPI app
│ ├── tests.py # Unit tests
│ ├── verify_api.py # Integration tests
│ ├── Makefile # Backend commands
│ └── pyproject.toml # Python dependencies
├── frontend/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API client
│ │ ├── lib/ # Game logic
│ │ └── __tests__/ # Tests
│ └── package.json # Node dependencies
└── openapi.yaml # API specification
make dev- Start development servermake test- Run testsmake verify- Verify API endpointsmake install- Install dependenciesmake clean- Clean cache filesmake help- Show all commands
npm run dev- Start development servernpm run build- Build for productionnpm test- Run testsnpm run lint- Lint code
The backend automatically generates interactive API documentation:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- OpenAPI Spec:
/openapi.yaml
- 🎮 Classic Snake gameplay with two modes (Pass-through & Walls)
- 👥 Spectator mode to watch other players
- 🏆 Global leaderboard with filtering
- 💾 Game state persistence
- 🔐 User authentication
- 📱 Responsive design
- ✅ Comprehensive test coverage
The easiest way to deploy this application is using Render.
- Click the button above.
- Connect your GitHub repository.
- Render will automatically detect the
render.yamlblueprint and set up:- PostgreSQL Database
- Web Service (Frontend + Backend)
Once deployed, your application will be available at your Render URL.
Mashel Odera
MIT