Code Monkey home page Code Monkey logo

gfw-commodities-app's Introduction

Global Forest Watch Commodities Phase II

Please Read this when starting work on this project.

IMPORTANT

Change the FTP folder in Gruntfile.js before you begin. Modify "dest" property in this section of code: ftp_push: { build: { options: { host: 'staging.blueraster.com', dest: 'html/wri/gfw-commodities/v20/', authKey: 'staging' }, files: [{ expand: true, cwd: 'build', src: ['**'] }] } },

Getting Started

All necesary bower components are already installed, no need to run bower install.

Setup

The project is configured already with grunt. If you need grunt, run npm install -g grunt-cli. Just run npm install in the root directory to install all of grunt's dependencies.

All css is written in stylus and then compiled by grunt into a single css file called app.css. Typing grunt develop will start the watch task and compile all .styl files in the css directory. (This may change later when trying to optimize loading to load a smaller css file which contains only the necessary css to load the homepage and then a larger one with all the rest, but probably wont)

Prepare to Build

The bootload.js file loads the classes differently when running locally vs on a server. Change the "deps" and "callback" as needed. (Also see comments around line 34 in bootloader.js.)

Local

deps includes main/Main. callback runs Main.init(); and comments out loadScript('app/js/app.min.js');

#### Staging/Production

deps comments out main/Main. callback comments out Main.init(); and runs loadScript('app/js/app.min.js');

Build

Their will be two grunt tasks, grunt build and grunt minify. The build task and minify task are the same except that the build task will automatically deploy the code after its built to staging whereas the minify will do nothing after building, which can be good for testing before deploying.

The task grunt build needs a .ftpauth file located in the same directory as the Gruntfile.js which contains credentials for the task to log into ftp. You can skip creating that file and specify them manually but DO NOT COMMIT YOUR CREDENTIALS TO ANY REPO. If you really want to, you can get instructions on how to do that at my github page https://github.com/Robert-W/grunt-ftp-push. The Recommended way is as follows: (NOTE: .ftpauth is added to .gitignore already so it wont be committed to the repo)

#### Create a file called .ftpauth with the following contents
{
	"staging": {
		"username": "yourusername",
		"password": "yourpassword"
	}
}

The "staging" keyword is the key the plugin is configured to use, if you change tht you will need to modify the task in the Gruntfile, just leave it as is.

gfw-commodities-app's People

Contributors

swampguzzler avatar crborton avatar robert-w avatar eightysteele avatar

Watchers

Alyssa Barrett avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.