Skip to content

hboylan/peaknode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Peak Home Automation

Dependencies

  • NodeJS

  • NPM

  • MySQL, PostgreSQL, or SQLite

    • Create admin with password

    • Create database peaknode

    • Grant user priviledges

  • Omnilink


Description

NodeJS - API Server ExpressJS - API Middleware SequelizeJS - PostgreSQL, MySQL, MariaDB, SQLite Middleware.

File structure

  • /app.js: Load and serve API resources

  • /config.json: Configuration info for port, DB, session, static models, etc.

  • /routes.js: API endpoints

  • /controllers: API endpoint handlers

  • /models: SequelizeJS models

  • /lib: NodeJS helper classes

    • /lib/database.js: Setup SequelizeJS models, relationships, and triggers

    • /lib/fitbit.js: Fitbit OAuth helper

    • /lib/omnilink.js: TCP connection to Java server

    • /lib/xbmc.js: XBMC connection/command helper


Routes

* - Requires sessionID

Method Endpoint Action
POST /user Create User
POST /login Login User
POST /logout *Logout User
POST /auth *Check Auth
GET /users List Users
GET /user/:uid Show User
Method Endpoint Action
GET /appliances List Appliances
POST /appliance/:id *Switch Appliance
Method Endpoint Action
GET /appliances List Audio Zones
GET /appliance/:id Show Audo Zone
POST /appliance/:id *Set Audio Zone
Method Endpoint Action
GET /security Security Status
GET /security/:id
POST /security/:id *Set Audio Zone

### User Routes #### Create User
  • @body username
  • @body password
  • @body realname
  • @body pinkey (4 digits)
#### Login User
  • @body username
  • @body password
#### Logout User #### Check Auth #### List Users #### Show User
  • @param uid

### Appliance Routes #### List Appliances #### Switch Appliance
  • @body state (on|off)
  • @body node (left|right)

### Audio Routes #### List Audio Zones #### Show Audio Zone

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published