Skip to content

josheche/engawa

Repository files navigation

Engawa 🏡 ⛩ 🌱

engawa 縁側 - The veranda and/or gate that serves as a link between the outdoor garden and traditional Japanese dwelling. Meant to protect it from the elements or open it completely to the outdoors.

Technology Stack

Engawa leverages the Aqua web framework for quick feature development. Server side, Aqua is built with the hapi framework. We're using MongoDB as a data store.

The front-end is built with React. We use Redux as our state container. Client side routing is done with React Router. We're using Gulp for the build system.

We use bcrypt for hashing secrets. If you have issues during installation related to bcrypt then refer to this wiki page.

Contribute

We use the Engawa waffle board for issue tracking and feature development. We use gitflow for git using Vincent Driessen's branching model.

Follow the branching instructions below.

Creating feature/release/hotfix/support branches

  • To list/start/finish feature branches, use:

      git flow feature
      git flow feature start <name> [<base>]
      git flow feature finish <name>
    

    For feature branches, the <base> arg must be a commit on develop.

  • To push/pull a feature branch to the remote repository, use:

      git flow feature publish <name>
        git flow feature pull <remote> <name>
    
  • To list/start/finish release branches, use:

      git flow release
      git flow release start <release> [<base>]
      git flow release finish <release>
    

    For release branches, the <base> arg must be a commit on develop.

  • To list/start/finish hotfix branches, use:

      git flow hotfix
      git flow hotfix start <release> [<base>]
      git flow hotfix finish <release>
    

    For hotfix branches, the <base> arg must be a commit on master.

  • To list/start support branches, use:

      git flow support
      git flow support start <release> <base>
    

    For support branches, the <base> arg must be a commit on master.

Installation

$ git clone git@github.com:josheche/engawa.git
$ cd engawa
$ npm install

Configuration

Simply edit config.js. The configuration uses confidence which makes it easy to manage configuration settings across environments. Don't store secrets in this file or commit them to your repository.

Instead, access secrets via environment variables. We use dotenv to help make setting local environment variables easy (not to be used in production).

Simply copy .env-sample to .env and edit as needed. Don't commit .env to your repository.

First time setup

WARNING: This will clear all data in the following MongoDB collections if they exist: accounts, adminGroups, admins, authAttempts, sessions, statuses, and users.

$ npm run first-time-setup

# > aqua@0.0.0 first-time-setup /home/YOURNAME/projects/aqua
# > node first-time-setup.js

# MongoDB URL: (mongodb://localhost:27017/aqua)
# Root user email: your@emailhere.com
# Root user password: Badpassword1234
# Setup complete.

Running the app

$ npm start

# > aqua@0.0.0 start /Users/YOURNAME/projects/engawa
# > gulp react && gulp

# [23:41:44] Using gulpfile ~/projects/engawa/gulpfile.js
# ...

Now you should be able to point your browser to http://127.0.0.1:8000/ and see the welcome page.

nodemon watches for changes in server code and restarts the app automatically. gulp and webpack watch the front-end files and re-build those automatically too.

We also pass the --inspect flag to Node so you have a debugger available. Watch the output of $ npm start and look for the debugging URL and open it in Chrome. It looks something like this:

chrome-devtools://devtools/remote/serve_file/@62cd277117e6f8ec53e31b1be58290a6f7ab42ef/inspector.html?experiments=true&v8only=true&ws=localhost:9229/node

Running in production

$ node server.js

Unlike $ npm start this doesn't watch for file changes. Also be sure to set these environment variables in your production environment:

  • NODE_ENV=production - This is important for many different optimizations, both server-side and with the front-end build files.
  • NPM_CONFIG_PRODUCTION=false - This tells $ npm install to not skip installing devDependencies, which we need to build the front-end files.

Deploying to Heroku

We're using Heroku for hosting.

Follow this link for instructions on deploying an Aqua app to Heroku.

License

MIT

About

🌱 An IoT + AI Garden Monitor // Admobilize Matrix Creator + Visa API 🌱

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published