Easy to setup and highly customizable leaderboard with built-in score validation system.

Overview

EasyLeaderboard

EasyLeaderboard

Add a leaderboard to your game in under 10 minutes!

πŸƒ Ready to go game clients make adding a leaderboard quick and easy

πŸ•΅οΈ Extendable score validation system to protect against cheaters

πŸ‘¨β€πŸ’» Open source and easily setup for custom implementations

πŸ’Έ Optional free-hosting provided at https://lb.userdefined.io by User Defined

Table of Contents

πŸ’» API

Postman Collection

There is an up to date Postman collection included in this repo to help test!

You can see it here

And it's under the Release section!


Submit a new score

/games/submit - POST

Request Payload

{
    name: <player name>,
    score: <player score>,
    game: <game key>,
    metaData: { <optional game metadata> },
    validation: <optional validation string>
}

Response

{
    "score": {
        "game": "easy-leaderboard-example",
        "name": "Player Name",
        "score": 12,
        "metaData": "{test: \"test\"}",
        "date": "2022-09-10T00:25:41.068Z"
    },
    "scoresGreater": 20,
    "scoresLesser": 5
}

NOTE: Using a game key that ends with -basic-validation will cause that game to automatically use the basic hash check for payload tampering.


Get game scores

/games/<game key> - GET

Response

[
    {
        "game": "easy-leaderboard-example",
        "name": "Garrett",
        "score": 1003,
        "metaData": "{\"metaData\":\"yo\"}",
        "date": "2022-09-02T01:42:53.376Z"
    },
    {
        "game": "easy-leaderboard-example",
        "name": "Garrett",
        "score": 123,
        "metaData": "{\"metaData\":\"yo\"}",
        "date": "2022-09-02T01:31:41.070Z"
    }
]

Optional query params

asc - true Sorts by ascending order if true else defaults to descending by score

pagesize - <number> Number of results to return per page

page - <number> Page to return


πŸ“¦ Setup

There are two requirements to run EasyLeaderboard.

MongoDB

The recommended way to quickly get an instance of MongoDB running is to use the free tier of MongoDB Cloud. You can find more about that here.

NodeJS

To run the application itself, you will need to make a copy of .env.example and name it .env. Fill out the details in the file with your configuration settings. The app can be started via npm start.

To make the application reachable and always online, you will want to host it somewhere. Here are a few suggestions.

πŸ«™ Dockerized Setup

If you have Docker installed, you can simply run the docker compose up -d command to run the whole project in a containerized environment.
Even though this setup is best-suited for local development, it can be used in production too on your own server (VPS, AWS, Digital Ocean...).

You can also use docker compose --profile=admin-panel up -d to run a local admin panel for your mongo database.

Docker will use the same .env file used by the Node web server to resolve internal variables. In this way the containers are highly customizable together with the web server itself.

# example configuration of .env in development
MONGO_USERNAME=root
MONGO_PASSWORD=example
MONGO_HOST=mongo
MONGO_PORT=27017
MONGO_DB=mygame
PORT=6999

πŸ”§ Customization

βœ… Validators

Validators are custom scripts which can be run to validate a submitted score before it is saved.

Validators are defined under the /validators folder. You can make a copy of /validators/example.js and fill in your own game's key.

Fill out the validateScore function with logic to validate scores that are submitted!

Your app will need to be rebooted for changes to take effect.

Example validator

Validates the score by checking if the validation value is equal to the score + 9. You can get creative using the submission metadata to playback game events or check for other anomalies in submissions to make cheating more difficult.

module.exports = {
  games: ["my-game-key"],
  validateScore(game, name, score, metaData, validation){
    return validation == score + 9;
  },
};

Note: You can define more than one validator for a given game, and they will all be run to validate a score. If any fail, then the submission will be rejected.

πŸš€ Ready To Go Clients

Godot 4 Client

Godot 3.5 Client

πŸ’‘ Game Jam Advice

For game jams, you likely will not need more than basic validation.

By using a game key ending with -basic-validation, all scores will automatically be checked for payload tampering via a validation hash. This is easily circumvented by anyone that really tries to cheat, but for the sake of quick/short games it will generally suffice to prevent spoofed scores.

If your game can't use a client above, you can see how basic validation works here

You can optionally use the free hosted version of EasyLeaderboard by pointing your game at https://lb.userdefined.io.

πŸ‘¨β€πŸ”¬ Future Goals

  • Human readable HTML leaderboards for maximum easy mode setup 😏
  • Landing page clean-up
  • Repl.it DB support
  • Firebase support
  • SQLite support
  • Discord integration
You might also like...

The leaderboard website displays scores submitted by different players. It also allows you to submit your score. All data is preserved thanks to the external Leaderboard API service.

The leaderboard website displays scores submitted by different players. It also allows you to submit your score. All data is preserved thanks to the external Leaderboard API service.

Leaderboard πŸ“— Table of Contents πŸ“– About the Project πŸ›  Built With Tech Stack Key Features πŸš€ Live Demo πŸ’» Getting Started Setup Prerequisites Instal

Mar 20, 2023

`raaghu-mfe` is an opensource micro front end framework built on top of `raaghu-elements`, Bootstrap 5 and Storybook offering highly customizable UI components and built-in pages

 `raaghu-mfe` is an opensource micro front end framework built on top of `raaghu-elements`, Bootstrap 5 and Storybook offering highly customizable UI components and built-in pages

`raaghu-mfe` is an opensource micro front end framework built on top of `raaghu-elements`, Bootstrap 5 and Storybook offering highly customizable UI components and built-in pages. Raaghu mfe can be used as a base to build complex components and UI layouts whilst maintaining a high level of reusability,flexibility with ease of maintenance.

Dec 30, 2022

A Leaderboard app that pulls from a LeaderboardGameAPI and allows users to view recent scores and add more scores to the score board. Built with HTML5, CSS, JavaScript, and Webpack.

A Leaderboard app that pulls from a LeaderboardGameAPI and allows users to view recent scores and add more scores to the score board. Built with HTML5, CSS, JavaScript, and Webpack.

Leaderboard A Leaderboard app that pulls from a LeaderboardGameAPI and allows users to view recent scores and add more scores to the score board. Buil

Dec 21, 2022

This is a project based on a game Leaderboard. You can interact with an API inserting your user name and score. Built with HTML, CSS, JavaScript and WEBPACK

This is a project based on a game Leaderboard. You can interact with an API inserting your user name and score. Built with HTML, CSS, JavaScript and WEBPACK

Leaderboard: Leaderboard project - Microverse Acces link Check the live version here Built With HTML CSS JavaScript VScode Webpack GitFlow Quick view

Oct 8, 2022

This website displays scores submitted by different players. It also allows you to submit your score. All data is preserved thanks to the external Leaderboard API service. Built with Webpack and ES6

Leaderboard This website displays scores submitted by different players. It also allows you to submit your score. All data is preserved thanks to the

Sep 30, 2022

The leaderboard website displays scores submitted by different players. It also allows you to submit your score. Built with HTML, CSS, JavaScript with APIs

LeaderBoard The leaderboard website displays scores submitted by different players. It also allows you to submit your score. Built With Html,JS,CSS We

Nov 1, 2022

jQuery easy ticker is a news ticker like plugin, which scrolls the list infinitely. It is highly customizable, flexible with lot of features and works in all browsers.

jQuery Easy Ticker plugin jQuery easy ticker is a news ticker like plugin which scrolls a list infinitely. It is highly customizable, flexible with lo

Dec 20, 2022

The Frontend of Escobar's Inventory Management System, Employee Management System, Ordering System, and Income & Expense System

The Frontend of Escobar's Inventory Management System, Employee Management System, Ordering System, and Income & Expense System

Usage Create an App # with npx $ npx create-nextron-app my-app --example with-javascript # with yarn $ yarn create nextron-app my-app --example with-

Jan 2, 2023
Comments
  • Dockerize project

    Dockerize project

    Hi, I've made a simple Docker configuration to run everything together in a containerized environment. As I've mentioned in the Readme, the project can be run with docker compose up -d after setting up the .env file properly. By default it will first run a container with a MongoDB image, and then the Node server running the application. Containers communicate directly through networking so it is not required to expose ports.

    Running docker compose --profile=admin-panel up -d will also start up a container with a mongo-express image to manage the mongo database thorugh a web interface on port 8081. The panel will only be accessible in localhost.

    CONTAINER ID   IMAGE                    NAMES              PORTS
    a1ee1d4a0e02   easyleaderboard_server   ezlb-server        0.0.0.0:6999->6999/tcp, :::6999->6999/tcp
    820320e894a9   mongo-express            ezlb-mongo-panel   127.0.0.1:8081->8081/tcp
    a1ddeec65bb7   mongo                    ezlb-db            27017/tcp
    

    This could be useful for users that don't want to execute manually every single component, and also create an environment which can be easily moved in an hosted solution like AWS or a private server.

    opened by fenix-hub 4
Releases(v1.1.0)
Owner
Garrett Allen
Software engineer. Indie game dev. Hobbyist mechanic. Builder of things.
Garrett Allen
A leaderboard created using Leaderboard API service, Webpack, and Gitflow. The user can add a new score and refresh to see his ranking in the leaderboard.

Leaderboard A leaderboard created using Leaderboard API service, webpack, and gitflow. The user can add a new score and refresh to see his ranking in

ABDUL ALI 13 Dec 26, 2022
The leaderboard website displays scores submitted by different players. It also allows you to submit your score. All data is preserved thanks to the external Leaderboard API service. Built with Html, CSS and JavaScript

Leaderboard App ?? Table of Contents ?? About the Project ?? Built With Tech Stack Key Features ?? Live Demo ?? Getting Started Setup Prerequisites In

Tetteh Kodjo-Sarso 4 Mar 21, 2023
This simple project aims to connect to an API to fetch score data and display it on a LeaderBoard box, as well as provide the tool to submit a new score.

Leader Board: Hit the API! This simple project aims to connect to an API to fetch score data and display it on a LeaderBoard box, as well as provide t

AndrΓ©s Felipe Arroyave Naranjo 12 Apr 6, 2022
PAC-MAN Leaderboard includes the Leaderboard API. You can add your name and score, and see other player's scores.

PAC-MAN Leaderboard includes the Leaderboard API. You can add your name and score, and see other player's scores.

Pedro Guerreiro 7 Oct 26, 2022
The leaderboard website displays scores submitted by different players. It also allows you to submit your score. All data is preserved thanks to the external Leaderboard API service. Build with Html, CSS, JS, API, and Webpack.

The leaderboard website displays scores submitted by different players. It also allows you to submit your score. All data is preserved thanks to the external Leaderboard API service. Build with Html, CSS, JS, API, and Webpack.

Kyrillos Hany 9 Mar 11, 2022
The Leaderboard App displays scores submitted by different players, allows you to submit your score and all data is preserved in the Leaderboard API service.

Leaderboard The Leaderboard App displays scores submitted by different players, allows you to submit your score and all data is preserved in the Leade

Jonathan Kayizzi 6 Nov 9, 2022
The leaderboard website displays scores submitted by different players. It also allows you to submit your score. All data is preserved thanks to the external Leaderboard API service.

Leaderboard The leaderboard website displays scores submitted by different players. It also allows you to submit your score. All data is preserved tha

Jihane Haddad 5 Feb 10, 2022
The leaderboard website displays scores submitted by different players. It also allows you to submit your score. All data is preserved thanks to the external Leaderboard API service.

Leaderboard The leaderboard website displays scores submitted by different players. It also allows you to submit your score. All data is preserved tha

Regiss Mukubiza 2 Apr 8, 2022
The leaderboard website displays scores submitted by different players. It also allows you to submit your score. All data is preserved thanks to the external Leaderboard API service.

Leaderboard- DESCRIPTION The leaderboard website displays scores submitted by different players. It also allows you to submit your score. All data is

Andres Garzon 2 Jun 16, 2022