Skip to content

A MarkLogic application to explore homebrew beer recipe ingredients. Stores data as JSON and semantic triples.

License

Notifications You must be signed in to change notification settings

dmcassel/mlbeer

Repository files navigation

ML Beer

A MarkLogic-based application for beer recipes. The purpose is to visualize the ingredients used in different beer styles. I haven't added much support for the steps of a recipe, since I'm more focused on ingredients. If anybody wants to suggest or submit improvements, I'm open to that.

Architecture

This application was generated by the MarkLogic-Node Slush generator, with the following components:

  • AngularJS
  • Gulp
  • node.js: very thin layer, hosting the Angular code and proxying MarkLogic REST API requests
  • Roxy Deployer: bootstrap MarkLogic databases, application servers, etc; scaffolding for MarkLogic REST API service extensions

Install Required Dependencies

  • node.js
  • npm: Built-in package manager for node (comes with node, but check to be sure you have latest version: npm install -g npm)
  • gulp: Javascript task automation (npm install -g gulp)
  • Bower: A package manager for front-end libraries (npm install -g bower)
  • Git - Roxy depends on this version control system
  • Ruby - Roxy depends on Ruby in order to run server configuration scripts

Running the application

Setup

Default ports are 8040 (HTTP), 8041 (XCC), and 8042 (test). Edit deploy/build.properties if needed.

./ml local bootstrap
./ml local deploy modules

On Windows, that would be:

ml.bat local bootstrap
ml.bat local deploy modules

Install additional dependencies using the bower package manager:

bower install

Running the Node.js app

Edit ./local.json to set your desired ports

gulp serve-local # this will watch the .less file for changes, compile them to .css, and run the node server

Installing as service

The code includes a service script, and a service config to make installing express server service as easy as possible. The following files are involved:

  • etc/init.d/node-express-service (generic express server service script)
  • etc/{app}/conf.sh (application specific service configuration, any application name allowed)
  • boot.js (entry point for express service, calls out to server.js)
  • node-app.js (required by boot.js)

The conf.sh is 'sourced' by the service script, and allows overriding the built-in defaults. Usually you only need to override SOURCE_DIR, APP_PORT, and ML_PORT. Make sure they match the appropriate environment.

Next install forever globally if it is not already installed.

  • $ [sudo] npm install forever -g

Next, push all source files to the appropriate server. The following assumes it was dropped under /space/projects/ in a folder called slush-app.live. Take these steps to install the services:

  • cd /space/projects/slush-app.live
  • gulp build # this will create the ./dist/ folder with all the required assests and code
  • cd /etc
  • sudo ln -s /space/projects/slush-app.live/etc/{env} slush-app
  • cd /etc/init.d
  • sudo ln -s /space/projects/slush-app.live/etc/init.d/node-express-service slush-app
  • sudo chkconfig --add slush-app
  • sudo chkconfig --levels 2345 slush-app on

Next to start it, use the following commands (from any directory):

  • sudo service slush-app start

These services will also print usage without param, but they support info, restart, start, status, and stop. The info param is very useful to check the settings.

Data

Initial Data

There are two sets of initial data you can load. The semantic triples provide information about malts, hops, and beer types. These are located in the content directory.

./ml local mlcp -options_file deploy/import-beer-triples.options

There are also some sample beer recipes to get started. These are located in the data directory.

./ml local mlcp -options_file deploy/import-sample-data.options

About

A MarkLogic application to explore homebrew beer recipe ingredients. Stores data as JSON and semantic triples.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published