Giter VIP home page Giter VIP logo

wattapp-backend's Introduction

⚡WattApp⚡

Sensor Logging API, Backend and Frontend

This is a project made for learning backend development, frontend development and IoT (Front end, hardware and firmware for the Logging sensor is in a separate repository).

Backend: https://wattapp-backend.herokuapp.com/api

Frontend: https://wattapp-frontend.herokuapp.com/

Frontend repo: https://github.com/Agustin-Q/WattApp-frontend

Arduino library repo: coming soon... 😁

Backend is built using Node.js and the following libraries:


ToDo's 💪

  • Update User Creation to new schema
  • Drop the user collection
  • Add route for creating Devices
  • Modify route for generating DeviceKey
  • Hash passwords before storing in DB
  • Add route for creating Sensors
  • Modify api/ route for new incoming data
  • Migrate to Mongo DB
  • Handle DB connection error
  • Define schema for incoming sensor data
  • Validate incoming sensor data
  • Handel bad request when creating devices
  • Handel bad request when creating sensors

User Data Scheme

{
  UserName: "myName",
  Password: "myPassword",
  Devices: [
    {
    DeviceName: "myDeviceName", 
    DeviceDescription: "deviceDescription",
    DeviceKey: "gRfgGHr4H54fghsfdg"
    Sensors:[
      {
      SensorIndex:0, // igual al index en el array
      SensorType:"sensorType",
      SensorUnit: "sensorUnit",
      },
    ]
    },
  ]
}

Adding a new user:

{
  UserName: "myName",
  Password: "myPassword",
  Devices: [
    {
    DeviceName: "myDeviceName", 
    DeviceDescription: "deviceDescription",
    DeviceKey: "gRfgGHr4H54fghsfdg"
    Sensors:[]
    },
  ]
}
{
  UserName: "myName",
  Password: "myPassword",
  Devices: [  ]
}

Sensor Data Scheme

{
  UserName:"myName", //added by server
  DeviceName: "myDeviceName",  //added by server
  SensorData: [
    {
    sensorIndex: 0,
    sensorName: "mySensor name", //added by server
    value: 1234,
    unit: "kW", //added by server
    timeStamp: 164855498
    },
    {
    sensorIndex: 1,
    sensorName: "my other sensor name", //added by server
    value: 1234,
    unit: "amps", //added by server
    timeStamp: 164855498
    },
  ],
  ServerTimeStamp: 1604190950 // added by the server
  }

Sensor data schema send by device:

{
  deviceKey: "gRfgGHr4H54fghsfdg",
  values: [
   {sensorIndex: 1, value:123, timeStamp:1601010515},
   {sensorIndex: 2, value:123, timeStamp:1601010515},
   {sensorIndex: 1, value:123, timeStamp:1601010515},
   ...
   {sensorIndex: 1, value:123, timeStamp:1601010515},
  ]
}

wattapp-backend's People

Contributors

agustin-q avatar

Watchers

 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.