Skip to content
Kuldeep Sinh Chauhan edited this page May 17, 2016 · 22 revisions

Welcome to the yams_mqtt_lib wiki!

How I've set my dev environment!

I like the fish shell. I have installed and made it my default shell as follows.

# Shell
# add repository and update
$ sudo apt-add-repository ppa:fish-shell/release-2
$ sudo apt-get update
# install fish
$ sudo apt-get install fish
# make fish as your default shell
$ chsh -s /usr/bin/fish
# Note: Logout and re-login in order to get the effect of changed default shell.

[Documentation] (http://www.rebar3.org/docs/getting-started) on rebar3, shows how to install rebar3.

# Shell
$ git clone https://github.com/rebar/rebar3.git
$ cd rebar3
$ ./bootstrap
$ ./rebar3 local install
===> Extracting rebar3 libs to $HOME/.cache/rebar3/lib...
===> Writing rebar3 run script $HOME/.cache/rebar3/bin/rebar3...
===> Add to $PATH for use: export PATH=$HOME/.cache/rebar3/bin:$PATH

Once, installed as mentioned in the blog, path to the rebar3 binary is required to be exported in the $PATH variable. This would be tricky on [Fish Shell] (https://fishshell.com/docs/current/tutorial.html). It can be set as mentioned [here] (https://fishshell.com/docs/current/tutorial.html#tut_path). Following the tutorial, I have configured it on my machine, with following commands.

# Shell
# Open file named config.fish with following command
$ cd ~/.config/fish
$ emacs config.fish
  ;;emacs
  ;;Enter followng line in the file and then save it.
  set -gx PATH $HOME/.cache/rebar3/bin $PATH
  ;;Save file
  Cc + Cs
# restart terminal.

Creating a new application library with rebar3, and push it on github

# Shell
# Create new application library
$ rebar3 new lib yams_mqtt_lib
# Change to the project directory
$ cd yams_mqtt_lib
# Create/Initialize git repository
$ git init

My Git Workflow

Please refer [this page] (https://github.com/yams-mqtt/yams_mqtt_lib/wiki/My-Git-Workflow), which shows how I have setup my git workflow.

[Travis CI] (https://travis-ci.org/) - How to set it with the GitHub!

  1. Select Repository
  2. Go to Settings
  3. Select Workhook and Services
  4. Select TravisCI and follow the instructions.
    • As part of the instruction, I was required to create a user and provide OAuth
    • Also, I was required to create a file named .travisci.yaml, in the root folder of the project.
  5. Ultimately, an [account page] (https://travis-ci.org/profile/yams-mqtt) is created.
  6. Follow [Embedding Status Images] (https://docs.travis-ci.com/user/status-images/) to embed TravisCI status image on your README.md of the project.
  7. Following are the contents of .travis.yaml file.
language: erlang
notifications:
  email: yet.another.mqtt.server@gmail.com
otp_release:
  - 18.3
script:
  - rebar compile
  - rebar skip_deps=true eunit
  - dialyzer --build_plt --apps erts kernel stdlib mnesia
  - dialyzer -r src/ --src

(Buzzwords) To be stuffed in the Dev Env...

  1. Dialyzer
  2. Typer
  3. EUnit - Erlang Unit Testing
  4. Proper/Quick Check/Triq - for property based testing
  5. Erlang Doc - for documentation
  6. Elvis - Erlang Style Reviewer
  7. Percept2 - Erlang Profiler
  8. Tsung/MZBench - load testing tool
  9. Cover
  10. [CutEr] (https://www.youtube.com/watch?v=XVOV0KQAf-8&utm_source=dlvr.it&utm_medium=twitter)
  11. [Coding Standard] (https://github.com/inaka/erlang_guidelines/blob/master/README.md)

(Again, some buzzy) Frameworks/Libraries, I intend to use

  1. Ranch - Acceptor pool
  2. Cowboy/WebMachine - HTTP/REST interface
  3. Riak Core - framework for developing distributed applications
  4. Riak Pipe - framework for Erlang process composition in parallel (kind of UNIX pipes) (built on top of Riak Core)
  5. Riak PG/GProc/Syn - Erlang process registry
  6. Plumtree - Epidemic Broadcast Trees
  7. Fuse/Circuit Breaker - circuit breaker
  8. Fuse LB - simple load balancer
  9. JSX - Erlang JSON
  10. Lager - for logging