This is a backend app for Kebunby. Kebunby is a platform that can be used for people who want to plant. This platform has a lot of plant informations, such as ornamental plants, vegetable plants, and fruit trees. The informations that served are plant description, tools and materials, also steps for planting. On this platform we can contribute to uploading other plant informations too. Then, we can also see our planting and planted plants, and favorite plants.
Base URL: https://kebunby-backend.herokuapp.com
All endpoints (except /register and /login) must use this authorization
Request :
- Header :
- Authorization : "Bearer {token}"
POST /api/v1/register
Body :
{
"username": "string, unique",
"email": "string",
"password": "string",
"name": "string"
}
POST /api/v1/login
Body :
{
"username": "string, unique",
"password": "string"
}
GET /api/v1/plants
Parameter | Type | Description |
---|---|---|
page |
number |
Required. Used to load the next data |
size |
number |
Required. Set limit of result in one page |
isTrending |
boolean |
Optional. Get trending plants |
searchQuery |
string |
Optional. Get plants based on user search query |
GET /api/v1/plants/{id}
POST /api/v1/plants
Body (form-data) :
- name: text
- latinName: text
- image: file
- category: text
- wateringFreq: text
- growthEst: text
- desc: text
- tools: text (can be multiple)
- materials: text (can be multiple)
- steps: text (can be multiple)
- author: text
PUT /api/v1/plants/{id}
Body (form-data) :
- name: text
- latinName: text
- image: file (optional)
- category: text
- wateringFreq: text
- growthEst: text
- desc: text
- tools: text (can be multiple
- materials: text (can be multiple)
- steps: text (can be multiple)
- author: text
DELETE /api/v1/plants/{id}
GET /api/v1/categories/{id}/plants
GET /api/v1/categories
GET /api/v1/users/{username}/plants
Parameter | Type | Description |
---|---|---|
page |
number |
Required. Used to load the next data |
size |
number |
Required. Set limit of result in one page |
isPlanting |
boolean |
Optional. Get user planting plants |
isPlanted |
boolean |
Optional. Get user planted plants |
isFavorited |
boolean |
Optional. Get user favorite plants |
GET /api/v1/users/{username}
Node, Hapi, PostgreSQL, Cloudinary