# I dont know how to create a leaderboard

**URL:** <https://forum.heroiclabs.com/t/i-dont-know-how-to-create-a-leaderboard/4838>\
**Category:** Runtime Framework\
**Tags:** server-framework\
**Created:** [January 5, 2024, 2:47pm UTC](https://forum.heroiclabs.com/t/i-dont-know-how-to-create-a-leaderboard/4838 "2024-01-05T14:47:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghasem167](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/ghasem167/32/1701_2.png) [@ghasem167](https://forum.heroiclabs.com/u/ghasem167)\
**Post date:** [January 5, 2024, 2:47pm UTC](https://forum.heroiclabs.com/t/i-dont-know-how-to-create-a-leaderboard/4838/1 "2024-01-05T14:47:16Z")

</div>

I don’t know how to create any runtime function. I wanna create a leaderboard and I made its .ts file and copy it in modules folder. but I don’t know how to run at start up. In documenting there is no complete explanation.

---

<div class="post-metadata">

**Author:** ![lugehorsam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/lugehorsam/32/314_2.png) [@lugehorsam](https://forum.heroiclabs.com/u/lugehorsam)\
**Post date:** [January 5, 2024, 7:26pm UTC](https://forum.heroiclabs.com/t/i-dont-know-how-to-create-a-leaderboard/4838/2 "2024-01-05T19:26:43Z")

</div>

Hey @ghasem167 have you taken a look at our Typescript runtime setup guide? I recommend taking a look at that guide for how to setup your `tsconfig.json`, Docker, and NPM for your runtime code.

> **[TypeScript Runtime](https://heroiclabs.com/docs/nakama/server-framework/typescript-runtime/)**
>
> Learn how to configure and develop your project using JavaScript for your game server custom logic.

As for creating a basic leaderboard yourself, you’ll want to invoke `nk.leaderboardCreate(...)` in your runtime code. For example:

```auto
let id = '4ec4f126-3f9d-11e7-84ef-b7c182b36521';
let authoritative = false;
let sort = nkruntime.SortOrder.DESCENDING;
let operator = nkruntime.Operator.BEST;
let reset = '0 0 * * 1';

let metadata = {
  weatherConditions: 'rain',
};

try {
    nk.leaderboardCreate(id, authoritative, sort, operator, reset, metadata);
} catch(error) {
    // Handle error
}

```

---

<div class="post-metadata">

**Author:** ![ghasem167](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/ghasem167/32/1701_2.png) [@ghasem167](https://forum.heroiclabs.com/u/ghasem167)\
**Post date:** [January 6, 2024, 2:04pm UTC](https://forum.heroiclabs.com/t/i-dont-know-how-to-create-a-leaderboard/4838/3 "2024-01-06T14:04:45Z")

</div>

I watched it and do anything but I have this problem

> [@Nakama/Docker Path Issues](https://forum.heroiclabs.com/t/nakama-docker-path-issues/2749):
>
> Trying to set up a Dockerfile, docker-compose.yml, and configuration file to use the JavaScript runtime. I was able to get this set up manually however when I tried to move to Dockerfile/docker-compose the server\_nakama container is unable to find files moved by the Dockerfile container. Namely: When I bind the /nakama/data relative path to ./data in the docker-compose file, neither the configuration file nor index.js can be located. The only way I found to resolve this is by manually placing…

---

<div class="post-metadata">

**Author:** ![lugehorsam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/lugehorsam/32/314_2.png) [@lugehorsam](https://forum.heroiclabs.com/u/lugehorsam)\
**Post date:** [January 8, 2024, 1:54pm UTC](https://forum.heroiclabs.com/t/i-dont-know-how-to-create-a-leaderboard/4838/4 "2024-01-08T13:54:49Z")

</div>

@ghasem167 there’s a reply in that thread to your issue.
