smart-home

command module
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2019 License: MIT Imports: 24 Imported by: 0

README

The program complex Smart House

Project site | Configurator | Node | Development Tools | Smart home Socket

Build Status Coverage Status

smart-home logo

Attention! The project is under active development.

Overview

Basic principles Underlying the system being developed, ease of configuration and content, cheapness and availability of the component base. So you can manage a lot of devices based on AVR microcontrollers and not only. A distributed network does not have geographic boundaries and allows you to manage devices anywhere in the Internet through System of nodes - microservices. And you will be able to interact with these devices in the way that they are In your local network. Create scripts, and respond to events in the web interface of the configurator through a flexible scripting system. Manage the state of devices from any subnet where the management server is available.

The project is in active development stage.

Supported system
  • macOS 386 10.6
  • macOS amd64 10.6
  • linux 386
  • linux amd64
  • linux arm-5
  • linux arm-6
  • linux arm-7
  • linux arm-64
  • linux mips64
  • linux mips64le
  • windows 386
  • windows amd64

Schematic smart home map

smart-home map
Quick installation

Installation help

Server
curl -sSL http://e154.github.io/smart-home/server-installer.sh | bash /dev/stdin --install
Configurator
curl -sSL http://e154.github.io/smart-home/configurator-installer.sh | bash /dev/stdin --install
Node
curl -sSL http://e154.github.io/smart-home/node-installer.sh | bash /dev/stdin --install
Database mysql
mysql -u root -p
CREATE DATABASE smarthome;
CREATE USER 'smarthome'@'localhost' IDENTIFIED BY 'smarthome';
GRANT ALL PRIVILEGES ON smarthome . * TO 'smarthome'@'localhost';
FLUSH PRIVILEGES;
use smarthome
source /opt/smart-home/server/dump.sql

Run server

/opt/smart-home/server/server

Server can by run on the port: 3000

Run configurator

/opt/smart-home/configurator/configurator

The configurator console will be available in the browser at http://localhost:8080

Run node

/opt/smart-home/node/node

The same commands, but without binding to the console

/opt/smart-home/server/server > /dev/null 2>&1 &
/opt/smart-home/configurator/configurator > /dev/null 2>&1 &
/opt/smart-home/node/node > /dev/null 2>&1 &

It's all:)

PS very soon an example will be added hello world

Installation for development
main server install
go get -u github.com/golang/dep/cmd/dep

git clone https://github.com/e154/smart-home $GOPATH/src/github.com/e154/smart-home

cd $GOPATH/src/github.com/e154/smart-home

dep ensure

go build

./smart-home -reset
./smart-home

editing configuration files

cp conf/app.sample.conf conf/api.conf
cp conf/dev/app.sample.conf conf/dev/app.conf
cp conf/dev/db.sample.conf conf/dev/db.conf
cp conf/prod/app.sample.conf conf/prod/app.conf
cp conf/prod/db.sample.conf conf/prod/db.conf

manually create the database and run the command

./smart-home migrate

run server

./smart-home

for test

./examples/scripts/auth.sh

It's all

Testing

The system supports self-testing of internal components, and is started by the command

go test ./tests -v
Support

Smart home Wiki: e154.github.io/smart-home Bugs and feature requests: GitHub issues

Contributors

All the contributors are welcome. If you would like to be the contributor please accept some rules.

  • The pull requests will be accepted only in "develop" branch
  • All modifications or additions should be tested

Thank you for your understanding!

See also
LICENSE

MIT Public License

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
server/v1
Smart home This documentation describes APIs found under https://github.com/e154/smart-home BasePath: /api/v1 Version: 1.0.0 License: MIT https://raw.githubusercontent.com/e154/smart-home/master/LICENSE Contact: Alex Filippov <support@e154.ru> https://e154.github.io/smart-home/ Consumes: - application/json Produces: - application/json Security: - BasicAuth - ApiKeyAuth SecurityDefinitions: ApiKeyAuth: type: apiKey name: Authorization in: header BasicAuth: type: basic swagger:meta
Smart home This documentation describes APIs found under https://github.com/e154/smart-home BasePath: /api/v1 Version: 1.0.0 License: MIT https://raw.githubusercontent.com/e154/smart-home/master/LICENSE Contact: Alex Filippov <support@e154.ru> https://e154.github.io/smart-home/ Consumes: - application/json Produces: - application/json Security: - BasicAuth - ApiKeyAuth SecurityDefinitions: ApiKeyAuth: type: apiKey name: Authorization in: header BasicAuth: type: basic swagger:meta
server/v2
Smart home This documentation describes APIs found under https://github.com/e154/smart-home BasePath: /api/v2 Version: 2.0.0 License: MIT https://raw.githubusercontent.com/e154/smart-home/master/LICENSE Contact: Alex Filippov <support@e154.ru> https://e154.github.io/smart-home/ Consumes: - application/json Produces: - application/json Security: - BasicAuth - ApiKeyAuth SecurityDefinitions: ApiKeyAuth: type: apiKey name: Authorization in: header BasicAuth: type: basic swagger:meta
Smart home This documentation describes APIs found under https://github.com/e154/smart-home BasePath: /api/v2 Version: 2.0.0 License: MIT https://raw.githubusercontent.com/e154/smart-home/master/LICENSE Contact: Alex Filippov <support@e154.ru> https://e154.github.io/smart-home/ Consumes: - application/json Produces: - application/json Security: - BasicAuth - ApiKeyAuth SecurityDefinitions: ApiKeyAuth: type: apiKey name: Authorization in: header BasicAuth: type: basic swagger:meta
system
dig
Package dig provides an opinionated way of resolving object dependencies.
Package dig provides an opinionated way of resolving object dependencies.
orm
uuid
Package uuid provides implementation of Universally Unique Identifier (UUID).
Package uuid provides implementation of Universally Unique Identifier (UUID).
validation
Package validation for validations import ( "github.com/astaxie/beego/validation" "log" ) type User struct { Name string Age int } func main() { u := User{"man", 40} valid := validation.Validation{} valid.Required(u.Name, "name") valid.MaxSize(u.Name, 15, "nameMax") valid.Range(u.Age, 0, 140, "age") if valid.HasErrors() { // validation does not pass // print invalid message for _, err := range valid.Errors { log.Println(err.Key, err.Message) } } // or use like this if v := valid.Max(u.Age, 140, "ageMax"); !v.Ok { log.Println(v.Error.Key, v.Error.Message) } } more info: http://beego.me/docs/mvc/controller/validation.md
Package validation for validations import ( "github.com/astaxie/beego/validation" "log" ) type User struct { Name string Age int } func main() { u := User{"man", 40} valid := validation.Validation{} valid.Required(u.Name, "name") valid.MaxSize(u.Name, 15, "nameMax") valid.Range(u.Age, 0, 140, "age") if valid.HasErrors() { // validation does not pass // print invalid message for _, err := range valid.Errors { log.Println(err.Key, err.Message) } } // or use like this if v := valid.Max(u.Age, 140, "ageMax"); !v.Ok { log.Println(v.Error.Key, v.Error.Message) } } more info: http://beego.me/docs/mvc/controller/validation.md
tests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL