daos/area
daos/area
Static Members
Find area
Parameters
param (string)
Search parameter
daos/user
daos/user
Static Members
▸
authenticate(param, cb)
Authenticate user
Parameters
Find user
Parameters
param (Object)
Search parameter
daos/switch
daos/switch
Static Members
List of switch
Parameters
List of switch with node, floor name
Parameters
Find switch
Parameters
param (string)
Search parameter
▸
findAndUpdate(param, data, cb)
Find and update node
Parameters
param (Object)
Search parameter
services/area
services/area
Static Members
Find area by id
Parameters
utils/database
utils/database
Static Members
new Database()
Instance Members
Find all rows in table
Parameters
▸
find(table, param, op, cb)
Find row by search parameter
Parameters
param (Object)
Search parameter
▸
insert(table, data, cb)
▸
update(table, id, data, cb)
▸
findAndUpdate(table, param, data, cb)
Find and update
Parameters
param (Object)
Search parameter
daos/node
daos/node
Static Members
Find node
Parameters
param (string)
Search parameter
▸
findAndUpdate(param, data, cb)
Find and update node
Parameters
param (Object)
Search parameter
daos/floor
daos/floor
Static Members
Find floor
Parameters
param (string)
Search parameter
controllers/floor
controllers/floor
Static Members
List of floor
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express view
Save floor
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express redirect
Edit floor form
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express view
Update floor
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express redirect
Delete floor
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express redirect
services/floor
services/floor
Static Members
Find floor by id
Parameters
controllers/area
controllers/area
Static Members
List of area
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express view
Add area form
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express view
Save area
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express redirect
Edit area form
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express view
Update area
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express redirect
Delete area
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express redirect
services/logger
services/logger
controllers/user
controllers/user
Static Members
Authenticate user
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Object
:
URL redirect
▸
changePassword(req, res)
Change username / password form
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Object
:
Express view
▸
updatePassword(req, res)
Update username / password
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Object
:
URL redirect
Logout
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Object
:
URL redirect
services/node
services/node
Static Members
Find node by id
Parameters
services/socket
services/socket
Static Members
▸
updateSwitchState(param, data, cb)
Update switch dsate
Parameters
param (Object)
Search parameter
▸
updateNodeAliveState(param, data, cb)
Update node alive state
Parameters
param (Object)
Search parameter
Set node to dead
Parameters
controllers/node
controllers/node
Static Members
List of node
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express view
Add node form
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express view
Save node
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express redirect
Edit node form
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express view
Update node
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express redirect
Delete node
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express redirect
controllers/switch
Static Members
List of switch
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express view
Add switch form
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express view
Save switch
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express redirect
Edit switch form
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express view
Update switch
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express redirect
Delete switch
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express redirect
services/user
services/user
Static Members
▸
authenticate(param, cb)
Authenticate user
Parameters
Find user by id
Parameters
▸
updatePassword(id, data, cb)
Update password
Parameters
services/switch
services/switch
Static Members
List of switch
Parameters
Find switch by id
Parameters
app
Junkiri: Wireless electrical switch
app
Author: Deepak Adhikari <deeps.adhi@gmail.com>
nodeExists
Check node exists already or not
Parameters
areaExists
Check area exists already or not
Parameters
url
Get URL
Parameters
req (Object)
Express request object
Returns
string
:
URL
slugify
Slugify string
Parameters
Returns
string
:
Slug text
utils/common
utils/common
Parameters
floorExists
Check floor exists already or not
Parameters
controllers/auth
controllers/auth
Parameters
exports
Check user session
Parameters
req (Object)
Express request object
res (Object)
Express response object
next (Function)
Express next middleware function
Returns
Function
:
Express redirect
get
Junkiri app
get
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express view
get
Login page
get
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express view
exports
WebSocket connection
Parameters
wsServer (Object)
WebSocket server
init
Open database
init()
broadcast
Broadcast message to all clients connected to WebSocket server
Parameters
message (string)
Message to be sent
create
Add floor form
Parameters
req (Object)
Express request object
res (Object)
Express response object
Returns
Function
:
Express view
findNode
Find node
Parameters
param (Object)
Search parameter
publish
Publish message to NodeMCU
Parameters
close
Close database
close()