Skip to content

Commit 7556400

Browse files
committed
update new docs
1 parent d2c3e4c commit 7556400

File tree

5 files changed

+417
-7
lines changed

5 files changed

+417
-7
lines changed

README.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,23 @@
22

33
An open-source API for managing recipes, built with Express and TypeScript using Prisma.
44

5+
# API Documentation
6+
7+
#### Table of Contents
8+
- [Items](./docs/api/items.md)
9+
- [Blocks](./docs/api/blocks.md)
10+
- [Recipes](./docs/api/recipes.md)
11+
- [Foodstuffs](./docs/api/foods.md)
12+
- [Entities](./docs/api/entities.md)
13+
- [Biomes](./docs/api/biomes.md)
14+
15+
516
#### Quick Nav
617
- [Installation](#installation)
718
- [Architecture](#project-structure)
819
- [Running the Api](#development)
920
- [API documentation](#api-documentation)
1021

11-
1222
## Installation
1323

1424
1. **Clone the repository**
@@ -206,9 +216,3 @@ $ npm run dev
206216
```
207217
208218
> Ensure that you have correctly performed the [Installation](#installation).
209-
210-
# API Documentation
211-
212-
#### Table of Contents
213-
- [Recipes](./docs/api/recipes.md)
214-
- [Foodstuffs](./docs/api/foods.md)

docs/api/biomes.md

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Biomes
2+
3+
Minecraft Biomes:
4+
5+
```json
6+
{
7+
"id": 0,
8+
"name": "the_void",
9+
"category": "none",
10+
"temperature": 0.5,
11+
"precipitation": "none",
12+
"dimension": "overworld",
13+
"displayName": "The Void",
14+
"color": 0,
15+
"rainfall": 0.5
16+
}
17+
```
18+
19+
## Usage
20+
21+
### (GET) **`/api/biome`**
22+
23+
Returns an array of all biome objects.
24+
25+
```json
26+
[
27+
{
28+
"id": 0,
29+
"name": "the_void",
30+
"category": "none",
31+
"temperature": 0.5,
32+
"precipitation": "none",
33+
"dimension": "overworld",
34+
"displayName": "The Void",
35+
"color": 0,
36+
"rainfall": 0.5
37+
},
38+
{
39+
"id": 1,
40+
"name": "plains",
41+
"category": "plains",
42+
"temperature": 0.8,
43+
"precipitation": "rain",
44+
"dimension": "overworld",
45+
"displayName": "Plains",
46+
"color": 9286496,
47+
"rainfall": 0.4
48+
},
49+
...
50+
]
51+
```
52+
53+
### (GET) **`/api/biome/search?q=<query>`**
54+
55+
Returns an array of biome objects whose fields satisfy the query `/search?q=<query>`
56+
57+
_(query may either be of type 'string' or 'number')_
58+
59+
`/api/biome/search?q=void`
60+
61+
```json
62+
[
63+
{
64+
"id": 0,
65+
"name": "the_void",
66+
"category": "none",
67+
"temperature": 0.5,
68+
"precipitation": "none",
69+
"dimension": "overworld",
70+
"displayName": "The Void",
71+
"color": 0,
72+
"rainfall": 0.5
73+
},
74+
]
75+
```
76+
77+
### (GET) **`/api/biome/:biomeId`**
78+
79+
Returns a single biome item whose `biomeId` exists
80+
81+
_(`:biomeId` may only be of type 'number')_
82+
83+
`/api/biome/0`
84+
85+
```json
86+
{
87+
"id": 0,
88+
"name": "the_void",
89+
"category": "none",
90+
"temperature": 0.5,
91+
"precipitation": "none",
92+
"dimension": "overworld",
93+
"displayName": "The Void",
94+
"color": 0,
95+
"rainfall": 0.5
96+
}
97+
```

docs/api/blocks.md

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Blocks
2+
3+
Minecraft Blocks:
4+
5+
```json
6+
{
7+
"id": 32,
8+
"name": "gravel",
9+
"displayName": "Gravel",
10+
"hardness": 0.6,
11+
"resistance": 0.6,
12+
"stackSize": 64,
13+
"diggable": true,
14+
"material": "mineable/shovel",
15+
"transparent": false,
16+
"emitLight": 0,
17+
"filterLight": 15,
18+
"defaultState": 109,
19+
"minStateId": 109,
20+
"maxStateId": 109,
21+
"boundingBox": "block",
22+
"image": "/images/1.19/gravel.png",
23+
"states": [],
24+
"drops": [
25+
42
26+
],
27+
"harvestTools": null
28+
}
29+
```
30+
31+
## Usage
32+
33+
### (GET) **`/api/block`**
34+
35+
Returns an array of all blocks.
36+
37+
```json
38+
[
39+
{
40+
"id": 32,
41+
"name": "gravel",
42+
"displayName": "Gravel",
43+
"hardness": 0.6,
44+
"resistance": 0.6,
45+
"stackSize": 64,
46+
...
47+
},
48+
{
49+
"id": 2,
50+
"name": "granite",
51+
"displayName": "Granite",
52+
"hardness": 1.5,
53+
"resistance": 6,
54+
"stackSize": 64,
55+
...
56+
},
57+
...
58+
]
59+
```
60+
61+
### (GET) **`/api/block/search?q=<query>`**
62+
63+
Returns an array of block objects whose fields satisfy the query `/search?q=<query>`
64+
65+
_(query may either be of type 'string' or 'number')_
66+
67+
`/api/block/search?q=block`
68+
69+
```json
70+
[
71+
{
72+
"id": 1,
73+
"name": "stone",
74+
"displayName": "Stone",
75+
"hardness": 1.5,
76+
"resistance": 6,
77+
"stackSize": 64,
78+
"boundingBox": "block",
79+
...
80+
},
81+
{
82+
"id": 2,
83+
"name": "granite",
84+
"displayName": "Granite",
85+
"hardness": 1.5,
86+
"resistance": 6,
87+
"stackSize": 64,
88+
"boundingBox": "block",
89+
...
90+
},
91+
...
92+
]
93+
```
94+
95+
### (GET) **`/api/block/:blockId`**
96+
97+
Returns a single block whose `blockId` exists
98+
99+
_(`:blockId` may only be of type 'number')_
100+
101+
`/api/block/200`
102+
103+
```json
104+
{
105+
"id": 200,
106+
"name": "deepslate_redstone_ore",
107+
"displayName": "Deepslate Redstone Ore",
108+
"hardness": 4.5,
109+
"resistance": 3,
110+
"stackSize": 64,
111+
...
112+
}
113+
```

docs/api/entities.md

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Entities
2+
3+
Minecraft Entities:
4+
5+
```json
6+
{
7+
"id": 117,
8+
"internalId": 117,
9+
"name": "fishing_bobber",
10+
"displayName": "Fishing Bobber",
11+
"width": 0.25,
12+
"height": 0.25,
13+
"type": "projectile",
14+
"category": "Projectiles"
15+
}
16+
```
17+
18+
## Usage
19+
20+
### (GET) **`/api/entity`**
21+
22+
Returns an array of all entity objects.
23+
24+
```json
25+
[
26+
{
27+
"id": 81,
28+
"internalId": 81,
29+
"name": "skeleton",
30+
"displayName": "Skeleton",
31+
"width": 0.6,
32+
"height": 1.99,
33+
"type": "hostile",
34+
"category": "Hostile mobs"
35+
},
36+
{
37+
"id": 82,
38+
"internalId": 82,
39+
"name": "skeleton_horse",
40+
"displayName": "Skeleton Horse",
41+
"width": 1.3964844,
42+
"height": 1.6,
43+
"type": "animal",
44+
"category": "Hostile mobs"
45+
},
46+
...
47+
]
48+
```
49+
50+
### (GET) **`/api/entity/search?q=<query>`**
51+
52+
Returns an array of entity objects whose fields satisfy the query `/search?q=<query>`
53+
54+
_(query may either be of type 'string' or 'number')_
55+
56+
`/api/entity/search?q=player`
57+
58+
```json
59+
[
60+
{
61+
"id": 116,
62+
"internalId": 116,
63+
"name": "player",
64+
"displayName": "Player",
65+
"width": 0.6,
66+
"height": 1.8,
67+
"type": "player",
68+
"category": "UNKNOWN"
69+
},
70+
...
71+
]
72+
```
73+
74+
### (GET) **`/api/entity/:entityId`**
75+
76+
Returns a single entity item whose `entityId` exists
77+
78+
_(`:entityId` may only be of type 'number')_
79+
80+
`/api/entity/8`
81+
82+
```json
83+
{
84+
"id": 8,
85+
"internalId": 8,
86+
"name": "boat",
87+
"displayName": "Boat",
88+
"width": 1.375,
89+
"height": 0.5625,
90+
"type": "other",
91+
"category": "Vehicles"
92+
}
93+
```

0 commit comments

Comments
 (0)