A cyberpunk-themed Snake game built with React and Firebase, featuring:
- 🎮 Classic Snake Gameplay with neon cyberpunk aesthetics
- 🏆 Global Leaderboard powered by Firebase Realtime Database
- 📊 Firebase Analytics for gameplay tracking
- 🔐 Secure Score Validation to prevent cheating
- ☁️ Cloud Save for high scores
- ♿ Accessibility Features for inclusive gaming
- Node.js 18+
- npm or yarn
- Clone the repository:
git clone https://github.com/lakshya-pm/cybersnake2077.git
cd cybersnake2077- Install dependencies:
npm install- Set up environment variables:
Create a
.env.localfile with your Firebase credentials:
VITE_FIREBASE_API_KEY=your_firebase_api_key
VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-project.firebasestorage.app
VITE_FIREBASE_DATABASE_URL=https://your-project-default-rtdb.firebaseio.com
GEMINI_API_KEY=your_gemini_key
- Run the development server:
npm run dev- Use Arrow Keys or WASD to control the snake
- Eat the glowing food to grow and score points
- Avoid hitting walls and yourself
- Compete for the top spot on the global leaderboard!
- Frontend: React 18 + TypeScript
- Styling: Tailwind CSS
- Backend: Firebase (Realtime DB, Auth, Analytics, Storage)
- AI: Google Gemini API integration
- Build: Vite
- Testing: Vitest
├── App.tsx # Main game component
├── firebase.config.ts # Firebase configuration & API
├── index.html # Entry HTML
├── index.tsx # React entry point
├── utils/
│ └── security.ts # Security utilities
├── test/
│ ├── App.test.tsx # Component tests
│ └── integration.test.tsx
└── package.json
- Input sanitization for usernames
- Rate limiting on API calls
- Score validation on server
- Secure storage for local data
MIT License - feel free to use and modify!
Lakshya PM
Built with ❤️ and ☕ during a hackathon