Skip to content

Repository files navigation

Create a real-time leaderboard system for ranking and scoring.

Tech Stack

  • Nodejs
  • TypeSript
  • Nestjs
  • Postgresql
  • Web socket (socket.io)
  • Redis

Features

  • User Authentication and Authorization

    • login
    • register
    • JWT Authorization
  • Leader board

    • user submit score
    • update user score
    • get game leaderbord
    • Display a global leaderboard showing the top users across all games.
  • User Rankings

    • ranks CRUD
  • Top Players Report

    • Generate reports on the top 10 players
  • Handel web socket errors

    • on listen event (error)
    // error
    {
      "message": [
        "gameId must be a UUID",
        "score must be a number conforming to the specified constraints"
      ],
      "error": "Bad Request",
      "statusCode": 400
    }

How To Install

> npm i -g pnpm
> pnpm install

Run App (in dev env)

> pnpm start:dev

Run App (in dev production)

> pnpm build
> pnpm start:prod

Env file

// APP
PORT: number;
JWT_KEY: string;
NODE_ENV: 'test' | 'dev' | 'prod';
HOST: string;
REDIS_URL: string;
// DB
DB_NAME: string;
DB_HOST: string;
DB_PORT: number;
DB_USERNAME: string;
DB_PASSWORD: string;

With thanks and appreciation to roadmap.sh

About

Create a real-time leaderboard system for ranking and scoring.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages