Skip to content

punkouter26/PoSnakeGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

133 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PoSnakeGame

Battle Royale Snake — compete against 15 AI opponents in a 30-second arena.

.NET React Vite Tailwind CSS

Architecture

PoSnakeGame/
├── web/                              # React 19 + Vite + Tailwind CSS v4
│   └── src/
│       ├── components/               # GameCanvas, HighScoreModal, HighScoreTable
│       ├── pages/                    # HomePage, GamePage, DiagPage
│       └── lib/api.ts                # API client with offline fallback
├── PoSnakeGame.Api/                  # .NET 10 API (high scores, health, diag)
├── PoSnakeGame.Core/                 # Domain models (HighScore) & interfaces
├── PoSnakeGame.Infrastructure/       # Azure Table Storage repositories
├── tests/
│   ├── PoSnakeGame.Tests.Unit/       # xUnit — model tests
│   ├── PoSnakeGame.Tests.Integration/# xUnit — API + Testcontainers
│   └── e2e/                          # Playwright E2E (TypeScript)
└── infra/                            # Bicep IaC for Azure deployment

Quick Start

# 1. Start Azurite (local Azure Storage emulator)
azurite --silent --location ./AzuriteData

# 2. Start the API
dotnet run --project PoSnakeGame.Api

# 3. Start the React dev server
cd web && npm install && npm run dev

Open http://localhost:5173 to play.

API Endpoints

Method Route Description
GET /health Health check (JSON)
GET /diag Diagnostics (masked secrets)
GET /api/highscores?count=10 Top scores
POST /api/highscores Submit score
GET /api/highscores/check/{score} Check if score qualifies
GET /openapi/v1.json OpenAPI spec
GET /swagger Scalar API docs

Testing

# Unit tests
dotnet test tests/PoSnakeGame.Tests.Unit

# Integration tests (requires Docker for Testcontainers)
dotnet test tests/PoSnakeGame.Tests.Integration

# E2E tests (requires API + React running)
cd tests/e2e && npx playwright test

Tech Stack

  • Frontend: React 19, Vite 6, Tailwind CSS v4, TypeScript
  • Backend: .NET 10 Minimal API, Serilog, OpenTelemetry
  • Storage: Azure Table Storage (Azurite for local dev)
  • Testing: xUnit, FluentAssertions, Testcontainers, Playwright
  • Infra: Azure Static Web Apps + App Service, Bicep IaC

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •