Giter VIP home page Giter VIP logo

smart-farm-backend's Introduction

Smart Farming API

Powered by Express JS | ACES Labs

Build Status

Installation

Clone repositories:

git clone https://github.com/ghofaralhasyim/smart-farm-backend.git

Open directory:

cd smart-farm-backend

Install dependencies:

npm i

Start smart-farm-backend:

nodemon start

*notes : if nodemon unrecognized command, you need to install nodemon globaly: npm install -g nodemon

Environment

DB_URI={your_mongo_uri_access}
JWT_KEY={your_jwt_secret_key}

Documentation

API URL : https://smart-farm-backend.vercel.app

Get all data logs (admin)

GET  /api/data-logs

Get data log by id(admin)

GET  /api/data-logs/{id_log}

Post single data

POST  /api/data-logs/add-single-data

body: { "timestamp": 1664264826855, "idNode": 3, "airTemp": 0.5, "airHum": 25.5, "soilHum": 25.5, "gps": { "lat": 12.2823, "long": -34.23 } }

Post multiple data

POST  /api/data-logs/add-data

body: [object, object, ...] object : { "timestamp": 1664264826855, "idNode": 3, "airTemp": 0.5, "airHum": 25.5, "soilHum": 25.5, "gps": { "lat": 12.2823, "long": -34.23 } }

Generate gateway token:

POST  /api/gateways/generate

body: { "name" : "testt" }

User sign in

POST  /api/user/signin

body: { "email": "[email protected]", "password": "VerySecurePassword" }

List all users(admin)

GET /api/user/all

Sign up new user

POST /api/user/all

body: { "email": "[email protected]", "password": "VerySecurePassword" }

Sign up new admin(admin)

POST /api/user/adminSignup

body: { "email": "[email protected]", "password": "VerySecurePassword" }

Verify a user(admin)

PUT /api/user/userVerify

body: { "_id": "akdfainadlanf" }

smart-farm-backend's People

Contributors

ghofaralhasyim avatar camejuanm avatar larasmrwn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.