SSIOT Backend (Summer internship 2018 - AppModule)
SSIOT Backend is an application which supports SSIOT Frontend application and SSIOT iOS application. It is written in javascript (node.js) and express framework. Data storage is done in MongoDB noSQL database.
- Restful API
- Data storage
These instructions will get you a copy of the project up and running on your local machine for development.
SSIOT Backend requires:
Install the dependencies and devDependencies and start the server.
$ npm install
$ npm start
// Starting on port 3000
Optionally instead npm start use npm run watch if you want to build on every change .
$ npm run watch
Edit env.json file to setup enviroment variables.
{
"app": {
"port": PORT
},
"mqtt": {
"host": MQTT-BROKER,
"port": MQTT-BROKER-PORT
},
"mongodb": {
"host": MONGO-DB-HOST,
"db": DB-NAME
}
}
POST [server]/layout/save
input: {
widgets: Object
name: String
}
output: {
message: "Saved successfully: [layout.name]"
}
POST [server]/layout/load
input: {
name: String // Layout name
}
output: {
Layout: Object
}
POST [server]/sensor/load
output: {
Sensors: Object // All sensors
}
POST [server]/ssiot/mnf/:guid/:sensorid
input:
:guid
:sensorid
{
format: Object
}
output: {
message: "Sensor manifested successfully: [sensor]!" // if doesn't already exist
||
message: "Sensor updated successfully: [sensor]!" // if doesn't already exist
}
POST [server]/user/create
input: {
username: String,
password: String
}
output: {
message: "Succesufully created [username]!"
}
POST [server]/user/login
input: {
username: String,
password: String
}
output: {
message: "Successfully logged in!"
}
POST [server]/user/logout
output: {
message: "Successfully logged out!"
}
POST [server]/widget/save
input: {
name: String,
design: String,
functions: Object,
scheme: Object,
format: Object,
coords: Ovject
}
output: {
message: "Widget [widget.name] successfully saved!"
}
POST [server]/widget/load
output: {
widgets: [Objects]
}
POST [server]/widget/:id/delete
input:
:id
output: {
message: "Successfully deleted!"
}
POST [server]/widget/delete
input: {
_id: String
}
output: {
message: "Successfully deleted!"
}
POST [server]/widget/deleteall
output: {
message: "All widgets successufully deleted!"
}
- Node.js - Javascript server environment
- npm - Dependency Management
- express - Web framework for Node.js
- bcrypt
- chalk
- connect-mongo
- cookie-parser
- cors
- debug
- ejs
- express
- express-session
- generate-schema
- http-errors
- jsonschema
- mongoose
- morgan
- mqtt
- rxjs
- rxjs-compat
- uuid
This project is licensed under the MIT License - see the LICENSE.md file for details