Coder Social home page Coder Social logo

parkour-api's Introduction

Parkour leaderboard API

Global architecture

  • Events are the basis entity on this API; think of them like Overwatch seasons, for instance. They have a beginning and an ending date (start and end fields, in seconds since Epoch), and link to several maps;
  • Maps associate a parkour configuration to an in-game map; each map features a global scoreboard;
  • Scores store players performances for each map;
  • MapConfigurations contain in-game coordinates for map entities such as checkpoints and ziplines (a configuration example for the mp_thaw map is available in the docs directory).

All entities are stored in JSON files under the data directory.

Routes

  • /v1/events:

    • GET: obtain the list of events
    • POST: create a new event
  • /v1/events/:event_id/maps

    • GET: obtain the list of maps associated to the event
    • POST: create a new map associated to the event
  • /v1/maps/:map_id/scores

    • GET: obtain the list of scores associated to the map
    • POST: create a new score entry on the map scoreboard
  • /v1/maps/:map_id/configuration

    • GET: get the map configuration
    • POST: update the map configuration

A web scoreboard displaying current event scores is served on /.

Security

Before launching, you need to set up a secret which will be used to authenticate servers.

# On Windows:
$Env:PARKOUR_API_SECRET = "your_secret_here"
cargo run

# On Linux
PARKOUR_API_SECRET=your_secret_here cargo run

Development

# Run debug build
cargo run

# Build release build
cargo build -r

# Build release build without glibc
cargo build --target x86_64-unknown-linux-musl -r

Environment variables

  • PARKOUR_API_SAVE_TIMER: duration (in minutes) between two state saves;
  • PARKOUR_API_SECRET: token that must be provided by clients under the authentication header to access API resources

parkour-api's People

Contributors

alystrasz avatar

Stargazers

 avatar Jared Ketterer avatar  avatar

Watchers

 avatar  avatar

Forkers

geckoeidechse

parkour-api's Issues

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.