Code Monkey home page Code Monkey logo

jalgoarena-submissions's Introduction

JAlgoArena Submissions Build Status codecov GitHub release

JAlgoArena Submissions is service dedicated for collecting users submissions and exposing that data. Querying submissions and submitting it has to be secure operation - methods require passing token which is then checked with Auth service.

Introduction

  • JAlgoArena Submissions exposes Submissions data via REST API

Component Diagram

API

Find all user submissions

Given user token - find all user submissions

URL Method
/submissions/:userId GET
  • Data Params

    User id path parameter has to be in sync with token based user id set in headers

    GET /submissions/1

    'Accept': 'application/json',
    'X-Authorization': 'Bearer <token>'
    
  • Success Response:

    List of all submissions

    • Code: 200
      Content: [{"sourceCode":"<source code>",...}, ...]
  • Sample Call:

    curl --header "Content-Type: application/json" \
         --header "X-Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ1c2VyMSIsInNjb3BlcyI6WyJST0xFX1VTRVIiXSwiaXNzIjoiamFsZ29hcmVuYS5jb20iLCJpYXQiOjE1MzI2ODUyMDUsImV4cCI6MTUzNTI3NzIwNX0.45Ilu0GnQyBVYprAcgtvPHmq5tdvbwiUZucSRAFDDPU2RYY-N8cDoM8k3gl1i2r4FPV7ECZaHgcc20fZwqj_CQ" \
         http://localhost:5004/submissions/1

Find user submission by given submission id

Given user token and submission id - find user submission

URL Method
/submissions/find/:userId/:submissionId GET
  • Data Params

    User id path parameter has to be in sync with token based user id set in headers

    GET /submissions/find/1/fib

    'Accept': 'application/json',
    'X-Authorization': 'Bearer <token>'
    
  • Success Response:

    List of all submissions

    • Code: 200
      Content: {"sourceCode":"<source code>",...}
  • Sample Call:

    curl --header "Content-Type: application/json" \
         --header "X-Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ1c2VyMSIsInNjb3BlcyI6WyJST0xFX1VTRVIiXSwiaXNzIjoiamFsZ29hcmVuYS5jb20iLCJpYXQiOjE1MzI2ODUyMDUsImV4cCI6MTUzNTI3NzIwNX0.45Ilu0GnQyBVYprAcgtvPHmq5tdvbwiUZucSRAFDDPU2RYY-N8cDoM8k3gl1i2r4FPV7ECZaHgcc20fZwqj_CQ" \
         http://localhost:5004/submissions/find/1/fib

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-Submissions-[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-Submissions 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

jalgoarena-submissions's People

Contributors

spolnik avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jalgoarena-submissions's Issues

Improve submission ID.

Now submissionId is UUID (Guid) and there is submissionTime, plus db generated ID.

Think about better way to represent it in sortable way - as we use db generated ID and it's cockroach DB - is it safe to consider it ordered?

Can we represent time as part of ID?

check few additional sources:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.