Mainflux.mainflux/manager
Dejan Mijic 75a8cdfe3f
Unify service versioning
Services are versioned through top-level package. The package itself
contains an HTTP header that will be bound to the '/version' endpoint of
each of the available services.

Signed-off-by: Dejan Mijic <dejan@mainflux.com>
2017-09-23 15:52:39 +02:00
..
api Unify service versioning 2017-09-23 15:52:39 +02:00
bcrypt Integrate manager service 2017-09-23 01:03:27 +02:00
cassandra Integrate manager service 2017-09-23 01:03:27 +02:00
jwt Integrate manager service 2017-09-23 01:03:27 +02:00
mocks Integrate manager service 2017-09-23 01:03:27 +02:00
README.md Update readme files for monorepo 2017-09-23 02:27:49 +02:00
channels.go Integrate manager service 2017-09-23 01:03:27 +02:00
clients.go Integrate manager service 2017-09-23 01:03:27 +02:00
doc.go Integrate manager service 2017-09-23 01:03:27 +02:00
manager.go Unify service versioning 2017-09-23 15:52:39 +02:00
manager_test.go Integrate manager service 2017-09-23 01:03:27 +02:00
security.go Integrate manager service 2017-09-23 01:03:27 +02:00
service.go Unify service versioning 2017-09-23 15:52:39 +02:00
swagger.yaml Integrate manager service 2017-09-23 01:03:27 +02:00
users.go Integrate manager service 2017-09-23 01:03:27 +02:00

README.md

Mainflux manager

Mainflux manager provides an HTTP API for managing platform resources: users, devices, applications and channels. Through this API clients are able to do the following actions:

  • register new accounts and obtain access tokens
  • provision new clients (i.e. devices & applications)
  • create new channels
  • "connect" clients into the channels

For in-depth explanation of the aforementioned scenarios, as well as thorough understanding of Mainflux, please check out the official documentation.

Configuration

The service is configured using the environment variables presented in the following table. Note that any unset variables will be replaced with their default values.

Variable Description Default
MANAGER_DB_CLUSTER comma-separated Cassandra contact points 127.0.0.1
MANAGER_DB_KEYSPACE name of the Cassandra keyspace manager
MANAGER_SECRET string used for signing tokens manager

Deployment

Before proceeding to deployment, make sure to check out the Apache Cassandra 3.0.x documentation. Developers are advised to get acquainted with basic architectural concepts, data modeling techniques and deployment strategies.

Prior to deploying the service, make sure to set up the database and create the keyspace that will be used by the service.

The service itself is distributed as Docker container. The following snippet provides a compose file template that can be used to deploy the service container locally:

version: "2"
services:
  manager:
    image: mainflux/manager:[version]
    container_name: [instance name]
    ports:
      - [host machine port]:8180
    environment:
      MANAGER_DB_CLUSTER: [comma-separated Cassandra endpoints]
      MANAGER_DB_KEYSPACE: [name of Cassandra keyspace]
      MANAGER_SECRET: [string used for signing tokens]

To start the service outside of the container, execute the following shell script:

# download the latest version of the service
go get github.com/mainflux/manager

cd $GOPATH/github.com/mainflux/manager/cmd

# compile the app; make sure to set the proper GOOS value
CGO_ENABLED=0 GOOS=[platform identifier] go build -ldflags "-s" -a -installsuffix cgo -o app

# set the environment variables and run the service
MANAGER_DB_CLUSTER=[comma-separated Cassandra endpoints] MANAGER_DB_KEYSPACE=[name of Cassandra keyspace] MANAGER_SECRET=[string used for signing tokens] app

Usage

For more information about service capabilities and its usage, please check out the API documentation.