Wild Rift Counter Lab is a full-stack draft assistant that recommends champion picks from role, lane matchup, and enemy-team composition. It demonstrates deterministic recommendation design, Clean Architecture, full-stack API integration, and responsible use of generative AI.
Design principle: the recommendation engine decides; AI explains.
- Frontend: wild-rift-app-mocha.vercel.app
- API health: replace
YOUR-BACKEND-DOMAINwith the active Railway domain and openhttps://YOUR-BACKEND-DOMAIN/api/health
Draft decisions involve more than a single counter matchup. A useful recommendation must also consider role fit, team composition, safety, scaling, and utility. Wild Rift Counter Lab combines those signals into transparent ranked recommendations with reasons and an actionable game plan.
- Deterministic multi-category recommendation scoring
- Score breakdowns for lane, team fit, role fit, safety, scaling, and utility
- Rule-based reasons and game plans
- Optional cached AI explanations generated only after ranking is complete
- Champion and matchup-rule management APIs
- Idempotent initial dataset with 62 champions
- Standardized API errors, Scalar API reference, OpenAPI document, and health endpoint
- Responsive React draft workflow with loading, fallback, error, and empty states
React + TypeScript
|
| HTTP / JSON
v
ASP.NET Core API
|
v
Application services + deterministic engines
|
v
Domain entities and rules
^
|
Infrastructure: PostgreSQL / EF Core / configurable Groq or Gemini provider
Dependency direction:
Api -> Application <- Infrastructure
|
v
Domain
Application contains the recommendation pipeline and contracts. Infrastructure implements persistence and AI contracts. Domain remains dependency-free. See docs/architecture.md for details.
- Validate role and enemy champion selections.
- Load champions and matching rules from PostgreSQL.
- Calculate deterministic score categories.
- Build rule/tag-based reasons and plans.
- Rank and select the top recommendations.
- Optionally enrich the top recommendations with asynchronous explanations from the configured AI provider.
Groq and Gemini cannot change scores, ranking, reasons, plans, or score breakdowns.
| Area | Technologies |
|---|---|
| Frontend | React, Vite, TypeScript, Tailwind CSS, Framer Motion, axios |
| Backend | ASP.NET Core Web API, Clean Architecture |
| Data | PostgreSQL, Entity Framework Core |
| AI | GroqCloud chat completions, optional Gemini fallback, PostgreSQL explanation cache |
| Testing | xUnit, ASP.NET Core integration testing, EF Core InMemory |
backend/
WildRiftCounterLab.Api
WildRiftCounterLab.Application
WildRiftCounterLab.Domain
WildRiftCounterLab.Infrastructure
WildRiftCounterLab.Api.Tests
WildRiftCounterLab.Application.Tests
frontend/
docs/
DEVELOPMENT.md
The frontend separates API clients, hooks, reusable components, draft-specific components, and pages. The backend follows strict Clean Architecture dependency boundaries.
Detailed PostgreSQL, AI provider secrets, troubleshooting, and demo instructions are in DEVELOPMENT.md.
# Backend
cd backend
dotnet user-secrets set "ConnectionStrings:DefaultConnection" "Host=localhost;Port=5432;Database=wildriftcounterlab;Username=postgres;Password=YOUR_PASSWORD" --project WildRiftCounterLab.Api
dotnet run --project WildRiftCounterLab.Api --launch-profile http
# Frontend
cd frontend
corepack pnpm install
corepack pnpm devThe production target is:
- Vercel for the React frontend
- Railway for the ASP.NET Core API, with Render as fallback
- Supabase PostgreSQL
The repository includes:
frontend/vercel.jsonbackend/Dockerfilebackend/railway.tomlrender.yaml- Optional startup migration configuration
- Environment-driven production CORS
See docs/deployment.md for the complete environment-variable list, Supabase migration procedure, AI provider verification, health checks, and platform steps.
GET /api/healthGET /api/championsPOST /api/draft/recommendationsPOST /api/ai/explainGET|POST|PUT|DELETE /api/championsGET|POST|PUT|DELETE /api/matchup-rules
See docs/api.md for request and response details.
In Development, the interactive Scalar API reference is available at http://localhost:5069/scalar.
# Backend
cd backend
dotnet restore
dotnet build --warnaserror --configuration Release
dotnet test# Frontend
cd frontend
corepack pnpm install
corepack pnpm run lint
corepack pnpm run buildThe repository includes Application unit tests and API integration tests covering validation, deterministic ranking, AI failure safety, CRUD behavior, seed idempotency, standard errors, and health checks.
GitHub Actions validates every pull request targeting main, every push to main, and manual runs:
- Backend restore, warnings-as-errors Release builds, Application/API tests, and API publish validation
- Frontend frozen pnpm install, lint, and production build
- Production Docker image build using the same
backend/Dockerfileandbackendcontext as Railway
Railway and Vercel continue to deploy the backend and frontend from main through their existing Git integrations. The workflows do not deploy or require platform tokens. Configure branch protection so the three CI jobs are required before merging:
Backend build and testsFrontend lint and buildBackend Docker build
The scheduled and manually triggered production smoke workflow checks the deployed backend health endpoint, champions endpoint, and frontend. Configure these public URLs as GitHub repository variables:
PRODUCTION_BACKEND_URL: backend origin without/apior a trailing slash, such ashttps://YOUR-BACKEND-DOMAINPRODUCTION_FRONTEND_URL: frontend origin without a trailing slash, such ashttps://YOUR-FRONTEND-DOMAIN
Completed work, near-term improvements, and later ideas are tracked in docs/roadmap.md.



