planetfederal / composer

BSD 3-Clause "New" or "Revised" License
7 stars 9 forks source link

Composer

Composer is a single-page application for easy creation and managing of geoserver maps.

Requirements

Building Composer requires Node and npm (v3.x) be installed. In addition to installing node and npm it is recommended that bower and grunt-cli be installed globally:

npm install -g bower
npm install -g grunt-cli

Building

To install all project dependencies simply run

npm install

To build all client side assets run

grunt build

Developing

For development it is most convenient to run the backend and front-end separately.

See Suite webapp Readme for more details on setting up the backend.

After following the build steps above you can run the debug server:

grunt start

By default the frontend server starts on port 8000. The server will watch for changes to JavaScript and CSS assets and perform a live reload without having to restart the debug server.

GeoServer Proxy Settings

By default the frontend server will proxy for GeoServer at horizon.boundlessgeo.com. To change this create a file named proxy.json in the same directory as gruntfile.js. For example:

{
   "host": "localhost",
   "port": 8080
}

Dependancy Management

Composer uses npm and bower for dependency management. Dependancies are tracked in package.json or bower.json respectively.

npm is mostly used for build dependancies such as bower and grunt, and for dependancies not available through bower, such as mapcfg or openlayers.

bower is used for everything else, including all angular dependancies. Note that whenever a new version of angular is released, bower.json should be updated with the new angular version, otherwise npm install will fail upon dependancy resolution (This also blocks the suite jenkins build).

Project Structure

The root of the composer project has a number of subdirectories:

The main composer codebase is in app. Generally, all composer changes should be limited to this directory. The root level contains index.html, CSS variable declarations, and angular project configuration. Everything else is further divided into subdirectories: