# MarkLogic-Node Generator

This application was generated by the MarkLogic-Node [Slush](https://github.com/klei/slush) generator, with the following components:

- [AngularJS](https://angularjs.org/)
- [Gulp](http://gulpjs.com/)
- [node.js](http://nodejs.org/): very thin layer, hosting the Angular code and proxying MarkLogic REST API requests
- [Roxy Deployer](https://github.com/marklogic/roxy): bootstrap MarkLogic databases, application servers, etc; scaffolding for MarkLogic REST API service extensions

## Install Required Dependencies

- [node.js](http://nodejs.org/download/)
- [npm](https://www.npmjs.com/): Built-in package manager for node (comes with
  node, but check to be sure you have latest version: `npm install -g npm`)
- [gulp](http://gulpjs.com/): Javascript task automation (`npm install -g
  gulp`)
- [Bower](http://bower.io/): A package manager for front-end libraries (`npm
  install -g bower`)
- [Git](https://git-scm.com/) - Roxy depends on this version control system
- [Ruby](https://www.ruby-lang.org/en/documentation/installation/) - Roxy
  depends on Ruby in order to run server configuration scripts

# Running the application

    ./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

If you want to upload a dictionary for spell-suggestions:

    ./ml local deploy content

On Windows:

    ml.bat local deploy content

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

# Installation and deployment on server

See etc/INSTALL.md

# Data

## Sample Data

The application comes with 3000 JSON documents generated by json-generator.com.
You can load them with
(MLCP)[https://docs.marklogic.com/guide/ingestion/content-pump] like this:

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

Or on Windows:

    ml.bat local mlcp -options_file import-sample-data.options

## General Data Information

The application comes with a sample set of JSON data. The detail controller,
the part that handles showing your data, can not only handle JSON, but also
XML, Binary, and Text data out of the box.
