aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 55477f946e970249db055e548cf954e51365f517 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# SkyBlock API

Backend for [skyblock.matdoes.dev](https://github.com/skyblockstats/skyblock-stats).

This is kinda like [Slothpixel](https://github.com/slothpixel/core), it fetches the SkyBlock API and cleans up the result for use without an API key.

## API conventions

If you (this is really just here for myself so I don't forget) are adding a new API thing, follow these rules so the API is consistent with how it responds:

- Use camelCase for keys.
- Use snake_case for values.
- Prefer arrays over dictionaries when the keys aren't static. For example `[ { name: "asdf", value: "dsfasg" } ]` rather than `{ "asdf": "dsfasg" }`.
- Dates are milliseconds since epoch.
- Fields that contain a snake_case ID should be called `id`. At the moment some of them are called `name`, this will be changed soon.

## Development

First, install the dependencies with `npm i`.
Then to run it, do `tsc -w` in one terminal, `npx nodemon build` in another. This makes it automatically restart when you make a change.
If you don't like it auto restarting, then just do `node build` instead of `npx nodemon build`.
It'll be running at [http://localhost:8080](http://localhost:8080)


## Terminology

Here's some words frequently used in the codebase that might potentially get confused:

- Profile: Sometimes known as a co-op, these contain one or more members.
- Member: Someone who is in a profile.
- Player: An individual account, it can be in multiple profiles and each instance of them in the profile is a different member.