Skip to content

jalgoarena/JAlgoArena-Ranking

Repository files navigation

JAlgoArena Ranking Build Status codecov GitHub release

JAlgoArena Ranking is service dedicated for collecting accepted users submissions with best results and exposing that data together with calculating ranking for all problems as well as for particular problem.

Introduction

  • JAlgoArena Ranking is responsible for calculating ranking and exposing it via REST API

Component Diagram

REST API

Endpoint Description
[GET /ranking] Get general ranking list
[GET /ranking/:problemId] Get ranking for particular problem
[GET /solved-ratio] Get all problems solved by users ratio

API

Get individual user ranking

Returns list of users sorted by their score for individual ranking

URL Method
/ranking GET
  • Success Response:

    Sorted list of users based on their score

    • Code: 200
      Content: [{"hacker":"mikolaj19","score":78.0,"solvedProblems":["sum-lists","string-rotation","2-sum","word-ladder"],"region":"Kraków","team":"Team B"},{"hacker":"mikolaj16,...},...]
  • Sample Call:

    curl http://localhost:5006/ranking

Get problem user ranking

Returns list of users sorted by their score for problem ranking

URL Method
/ranking/problem/:problemId GET
  • Success Response:

    Sorted list of users based on their score

    • Code: 200
      Content: [{"hacker":"julia73","score":11.0,"elapsedTime":0.008186},{"hacker":"madzia70","score":10.0,",...},...]
  • Sample Call:

    curl http://localhost:5006/ranking/problem/fib

Get stats of problems solved by users ratio

Returns stats of amount of users solutions per problem

URL Method
/solved-ratio GET
  • Success Response:

    Solved problems ratio

    • Code: 200
      Content: [{"problemId":"2-sum","solutionsCount":12},{"problemId":"fib","solutionsCount":11},...]
  • Sample Call:

    curl http://localhost:5006/solved-ratio

Running locally

There are two ways to run it - from sources or from binaries.

Running from binaries

  • go to releases page and download last app package (JAlgoArena-Ranking-[version_number].zip)
  • after unpacking it, go to folder and run ./run.sh (to make it runnable, invoke command chmod +x run.sh)
  • you can modify port in run.sh script, depending on your infrastructure settings. The script itself can be found in here: run.sh

Running from sources

  • run git clone https://github.com/spolnik/JAlgoArena-Ranking to clone locally the sources
  • now, you can build project with command ./gradlew clean stage which will create runnable jar package with app sources. Next, run java -jar build/libs/jalgoarena-auth-*.jar which will start application
  • there is second way to run app with gradle. Instead of running above, you can just run ./gradlew clean bootRun

Notes

Component Diagram