leaderboard

command module
v0.0.0-...-d909f5c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2022 License: MIT Imports: 8 Imported by: 0

README

Leaderboard

GitHub Maintainability

Standalone REST web service to generate Fantasy MMOG Leaderboard.

Leaderboards are the most accessed screens in any MMOGs. What makes leaderboard calculation little complex than any other rank-based leaderboards is that two or more players can share the same rank. The ranks of the players holding the same score should remain the same and the next succeeding rank to be allocated to the next player and so on.

In this project, we are using the SQL rank function to calculate user ranks.

The OVER() clause In the SQL RANK function is used to define that the entire table is being considered for calculation of the rank. The ORDER BY clause is used to sort the results in descending order.

To see the database queries being generated while fetching data, set database.logmode: true in the config.yml file.

Run in local environment

Prerequisites
  1. Go with minimum version 1.13
  2. make
  3. PostgreSQL
Setup
# Get the code
git clone https://github.com/souvikmaji/leaderboard
cd leaderboard

# initialize database and tables
make init

# Build and run
make

The application follows 12 factor principals for configuration management. Configurations are read in the following manner config.yml > .env > Exported Enviroment variables > Program Flags.

Visit: <127.0.0.1:8000>

Live Reload Server

During development use the autoreload server

make devrun

Technologies Used

TODO

  • CRUD apis for game
  • CRUD apis for users
  • Integrate validators
  • Use datatable sorting feature
  • Datatable filter by game id/ name
  • User auth apis
  • Gameplay apis
  • DB script sample size from flag
  • Use redis for db
  • Benchmark with a larger dataset
  • Read database credentials at app start for the first time.
  • Integrate Swagger
  • AutomaticEnv not working
  • Add logger
  • Hosting
  • Unit tests

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL