A mini snake game built with C# and ASP.NET Core with real-time multiplayer support using SignalR.
- Real-time snake game with smooth gameplay
- Multiple power-ups (Speed Boost, Score Multiplier, Invincibility, etc.)
- Particle effects and visual feedback
- High Score Leaderboard - Top 5 scores saved to PostgreSQL database
- Input validation and security features to prevent malicious attacks
- .NET 9.0 SDK
- PostgreSQL database (for high scores feature)
dotnet runThe application will be available at http://localhost:8080
For local development with the high scores feature, set the DATABASE_URL environment variable:
export DATABASE_URL="postgres://user:password@localhost:5432/snakegame"
dotnet runThis application is configured to deploy to Railway using Docker.
- Push code to GitHub
- Create a new project in Railway
- Connect your GitHub repository
- Railway will automatically detect the Dockerfile and deploy
- Add PostgreSQL database - See RAILWAY_SETUP.md for detailed instructions
The application listens on the PORT environment variable provided by Railway.
The game includes a high score system that saves the top 5 scores to a PostgreSQL database.
- Automatic prompt when achieving a top 5 score
- Input validation to prevent offensive language and malicious attacks
- SQL injection and XSS protection
- Leaderboard accessible from the main menu
See RAILWAY_SETUP.md for complete PostgreSQL setup instructions on Railway.
The application includes multiple security layers:
- Input sanitization and validation
- Parameterized database queries (via Entity Framework Core)
- Offensive language filtering
- SQL injection pattern detection
- XSS attack prevention