API to track data about plants in your garden. Store data like soil moisture, humidity, light levels and temperature.
ExpressJS & MongoDB.
This API is hosted free with now
and uses a free mongo db with mLab. Now will randomly generate a URL for the API. Have the now CLI and NPM installed before running the below command.
- Step 1:
npm install
- Step 2:
now -e MONGO_DB=<mongo connection string>
Use an arduino/genuino or raspberry pi to send data to this API. Here are my example scripts for arduino and raspberry pi. Then create a front end to read data from the API or clone my front-end that already works for this API.
- GET
/api/gardens
Returns list of gardens - POST
/api/gardens
Returns newly saved garden - PUT
/api/gardens
Returns updated garden - DELETE
/api/gardens
Returns message if deleted garden - GET
/api/gardens/:id
Returns 1 garden
- GET
/api/pots
Returns list of pots - POST
/api/pots
Returns newly saved pot - PUT
/api/pots
Returns updated pot - DELETE
/api/pots
Returns message if deleted pot - GET
/api/pots/:id
Returns 1 pot - GET
/api/pots/garden/:id
Returns list of pots for a specific garden
- GET
/api/readings
Returns list of readings - POST
/api/readings
Returns newly saved reading - PUT
/api/readings
Returns updated readings - DELETE
/api/readings
Returns message if deleted reading - GET
/api/readings/:id
Returns 1 reading - GET
/api/readings/pot/:id
Returns list of readings for a specific pot
- name
String
required - description
String
- name
String
required - description
String
- gardenId
String
required
- date
Date
default = Date.now - potId
String
required - soilTemp
Float
- soilMoisture
Float
- humidity
Float
- light
Float