Skip to content

Implement public API #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
atomflunder opened this issue May 10, 2025 · 0 comments
Closed

Implement public API #20

atomflunder opened this issue May 10, 2025 · 0 comments

Comments

@atomflunder
Copy link
Owner

When I am doing a rewrite of this project, I want to include a free, publicly accessible API.
The frontend will probably just call that instead of doing the calculations itself.

Possible request body:

{
  "config": {
    "beta": 4.166,
    "tau": 0.0833,
    "drawProbability": 0.1
  },
  "teams": [
    {
      "name": "Team Alpha",
      "players": [
        {
          "name": "Alice",
          "rating": [25, 8.333],
          "weight": 1
        },
        {
          "name": "Bob",
          "rating": [27, 7.5],
          "weight": 1
        }
      ],
      "rank": 1
    },
    {
      "name": "Team Beta",
      "players": [
        {
          "name": "Charlie",
          "rating": [23, 9.0],
          "weight": 1
        },
        {
          "name": "Dana",
          "rating": [26, 8.0],
          "weight": 1
        }
      ],
      "rank": 2
    }
  ]
}

Possible response body:

{
  "teams": [
    {
      "name": "Team Alpha",
      "rank": 1,
      "expectedScore": 0.67,
      "players": [
        {
          "name": "Alice",
          "rating": [25, 8.333],
          "weight": 1,
          "ratingChanges": [1.2, -0.4]
        },
        {
          "name": "Bob",
          "rating": [27, 7.5],
          "weight": 1,
          "ratingChanges": [0.9, -0.3]
        }
      ]
    },
    {
      "name": "Team Beta",
      "rank": 2,
      "expectedScore": 0.33,
      "players": [
        {
          "name": "Charlie",
          "rating": [23, 9.0],
          "weight": 1,
          "ratingChanges": [-1.1, 0.5]
        },
        {
          "name": "Dana",
          "rating": [26, 8.0],
          "weight": 1,
          "ratingChanges": [-0.8, 0.4]
        }
      ]
    }
  ],
  "matchQuality": 0.91
}
atomflunder added a commit that referenced this issue May 10, 2025
Only has the API for now, the UI will be implemented later

Solves #20 when merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant