Skip to content

craftkeg/relman

Repository files navigation

Relegation Manager

A relegation survival football management game inspired by Championship Manager 01/02. You take over a struggling side at gameweek 19 with 19 games to survive relegation.

Play

Live on GitHub Pages: https://craftkeg.github.io/relman/

Features

  • Squad selection, formation, and tactical instructions
  • Text-based match engine with live commentary
  • League table, fixtures, and results
  • AI-powered pre-match press room with journalist questions and manager replies
  • AI assistant manager tactical brief and dressing-room team talks
  • AI half-time pundit panel and post-match press conferences via Azure OpenAI
  • Auto-save and career history

Development

npm install
npm run dev

Runs on http://localhost:5173/relman/.

Environment variables (optional)

For AI features, create .env.local:

VITE_AZURE_FOUNDRY_ENDPOINT=https://your-resource.cognitiveservices.azure.com
VITE_AZURE_FOUNDRY_DEPLOYMENT=your-deployment
AZURE_FOUNDRY_API_KEY=your-key

Updating squads

The top five European leagues use real player names and positions. Each has its own JSON file:

The Scottish Premiership uses generated names.

To add or remove a player, edit the JSON directly. Each entry is {"nm": "Player Name", "pos": "CODE"}. Valid position codes:

  • GK — goalkeeper
  • DL, DC, DR — left/centre/right defender
  • DM — defensive midfielder
  • MC, ML, MR — central/left/right midfielder
  • AM — attacking midfielder
  • ST — striker

Team keys must match src/teams.json exactly. The loader prints a console warning on startup if a team is missing, a key is unknown, or a name is duplicated within a team.

Changes only apply to new careers — in-progress saves keep their existing squads. After editing, start a new career to see the updated squads. Pitch view displays the surname only via .split(" ").pop(), so "Virgil van Dijk" shows as "Dijk".

Azure Function Proxy (AI features on live site)

The GitHub Pages build is static, so the AI features need a server-side proxy to hold the API key. An Azure Function in api/ handles this.

Deploy the function

  1. Create an Azure Function App (Node.js 18+, Consumption plan)
  2. Set app settings:
    • AZURE_FOUNDRY_ENDPOINT — your Azure OpenAI resource URL
    • AZURE_FOUNDRY_API_KEY — API key from Azure Portal
    • AZURE_FOUNDRY_DEPLOYMENT — model deployment name (default: gpt-oss-120b)
  3. Deploy the api/ folder (VS Code Azure extension, func azure functionapp publish, or GitHub Actions)
  4. Set VITE_PRESS_API_URL in the GitHub Pages build environment to your function URL, e.g. https://your-func.azurewebsites.net/api/press-conference

Local dev

No function needed locally — the Vite dev proxy handles it via .env.local.

Stack

  • Vite + React
  • GitHub Pages (deploy on push to main)
  • Azure Function (press conference AI proxy)

License

MIT

About

A relegation survival football management game inspired by Championship Manager 01/02.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors