Skip to content

h2sVision/test-antigravity

Repository files navigation

🐍 CyberSnake 2077

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

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

  1. Clone the repository:
git clone https://github.com/lakshya-pm/cybersnake2077.git
cd cybersnake2077
  1. Install dependencies:
npm install
  1. Set up environment variables: Create a .env.local file 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
  1. Run the development server:
npm run dev

🎮 How to Play

  • 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!

🛠️ Tech Stack

  • Frontend: React 18 + TypeScript
  • Styling: Tailwind CSS
  • Backend: Firebase (Realtime DB, Auth, Analytics, Storage)
  • AI: Google Gemini API integration
  • Build: Vite
  • Testing: Vitest

📁 Project Structure

├── 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

🔐 Security Features

  • Input sanitization for usernames
  • Rate limiting on API calls
  • Score validation on server
  • Secure storage for local data

📜 License

MIT License - feel free to use and modify!

👨‍💻 Author

Lakshya PM


Built with ❤️ and ☕ during a hackathon

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors