Skip to content

Commit

Permalink
Merge pull request #107 from openaq/develop
Browse files Browse the repository at this point in the history
Deploying v2
  • Loading branch information
jflasher authored Sep 1, 2016
2 parents 9f9fe4b + 90cf4eb commit 87fdb8e
Show file tree
Hide file tree
Showing 195 changed files with 11,600 additions and 4,973 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

23 changes: 20 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,29 @@
"plugins": [
"react"
],
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"semi": [2, "always"],
"no-extra-semi": 2,
"semi-spacing": [2, { "before": false, "after": true }],
"react/jsx-uses-vars": 2,
"react/display-name": 1 ,
"react/jsx-no-duplicate-props": 2,
"react/jsx-no-undef": 2,
"react/jsx-uses-react": 2,
"react/prop-types": 2
"react/jsx-uses-vars": 2,
"react/no-danger": 0,
"react/no-deprecated": 2,
"react/no-did-mount-set-state": [2, "allow-in-func"],
"react/no-did-update-set-state": [2, "allow-in-func"],
"react/no-direct-mutation-state": 2,
"react/no-is-mounted": 2,
"react/no-unknown-property": 2,
"react/prop-types": 2,
"react/react-in-jsx-scope": 2
}
}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
115 changes: 111 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,113 @@
.DS_Store
################################################
############### .gitignore ##################
################################################
#
# This file is only relevant if you are using git.
#
# Files which match the splat patterns below will
# be ignored by git. This keeps random crap and
# and sensitive credentials from being uploaded to
# your repository. It allows you to configure your
# app for your machine without accidentally
# committing settings which will smash the local
# settings of other developers on your team.
#
# Some reasonable defaults are included below,
# but, of course, you should modify/extend/prune
# to fit your needs!
################################################


################################################
# Local Configuration
#
# Explicitly ignore files which contain:
#
# 1. Sensitive information you'd rather not push to
# your git repository.
# e.g., your personal API keys or passwords.
#
# 2. Environment-specific configuration
# Basically, anything that would be annoying
# to have to change every time you do a
# `git pull`
# e.g., your local development database, or
# the S3 bucket you're using for file uploads
# development.
#
################################################

app/assets/scripts/config/local.js
app/assets/content


################################################
# Dependencies
#
# When releasing a production app, you may
# consider including your node_modules and
# bower_components directory in your git repo,
# but during development, its best to exclude it,
# since different developers may be working on
# different kernels, where dependencies would
# need to be recompiled anyway.
#
# More on that here about node_modules dir:
# http://www.futurealoof.com/posts/nodemodules-in-git.html
# (credit Mikeal Rogers, @mikeal)
#
# About bower_components dir, you can see this:
# http://addyosmani.com/blog/checking-in-front-end-dependencies/
# (credit Addy Osmani, @addyosmani)
#
################################################

node_modules
.tmp
dist
bower_components
.sass-cache
test/bower_components


################################################
# Node.js / NPM
#
# Common files generated by Node, NPM, and the
# related ecosystem.
################################################

lib-cov
*.seed
*.log
*.out
*.pid
npm-debug.log
app/assets/scripts/config/local.js


################################################
# Apidocs
#
# Common files generated by apidocs and other docs
################################################

_README.md


################################################
# Miscellaneous
#
# Common files generated by text editors,
# operating systems, file systems, etc.
################################################

*~
*#
.DS_STORE
.netbeans
nbproject
.idea
.resources
.node_history
temp
tmp
.tmp
dist
18 changes: 15 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
language: node_js
node_js:
- '0.12'
- '4'
env:
global:
- PRODUCTION_BRANCH=publish
- STAGING_BRANCH=develop
- V2_BRANCH=feature/v2
cache:
directories:
- node_modules
before_install:
- chmod +x ./.build_scripts/lint.sh
script:
- npm test
- ./.build_scripts/lint.sh
# - npm test
# - ./.build_scripts/lint.sh
- npm run build
deploy:
- provider: s3
access_key_id: AKIAIHACHLPCT2PIL4TA
secret_access_key:
secure: CHTMZ13ooRXGY0ruRp3mTcg8TMPyM5Ymtg8V7kMmFKPznPMSoQjjHVazuqMTKgP/I5qq6U8S8tTBX/IuhD5MxZJrdBg/ocwpKhgu75xd4SgJsbmpd97jMxX0QU3hA0deDykxYBOKSv9tkZUJRZp8eOlfAjTK6lIKT4cvxGpk3s3VAimLA1e9jGp6vmbXV2GCj0oDBLrkcSrIBBrzClpgM5pmxXDWY1LDhY3vksOKz0GU/btZ8mxdEj3zJ6ZOx9Ny3skMX2eGO0N4JWd/HpEUtPWCp9XdCsXFbH/mQUZcAF5sFUjxsuqPgWkItKt9+TpVCgArhW1E+5DMTnYYPVYMxBhQrL60BaEQ/98rl4KxH+8otvfDlH19f3ESIPbPh0VLGwj9CJ/WQtJ2xhxZmypkfgbD3sGomHpbbSAIHvYSZUcJn34UikBx233JA6jN2ILRr8jvmDaOKg8i3x4aOkrUeMM0n+7alIymuVLlR53wOVifrtQG2xTEiIBkv6cwXyA+MyF3QCEaPOpgzPZLo6Vo+jZgW7XwYvs+TwfbZ9VVuj67E7QuTrwNHKG+CFpJz6SzlMgVJIYD5cwvh+D+py4jfN6+AoXWw4/3I30BzTe01wK2aBuWKHXaxEuj4JoXbACy6eAoTw5ePteAUj6YkK9hSkgByZhbStaeeGjd/ffxMwQ=
bucket: openaq-redesign
acl: public_read
local-dir: dist
skip-cleanup: true
on:
repo: openaq/openaq.github.io
branch: ${V2_BRANCH}
- provider: s3
access_key_id: AKIAIHACHLPCT2PIL4TA
secret_access_key:
Expand Down
84 changes: 20 additions & 64 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,30 @@
# project-seed
# OpenAQ

A basic starting point for web projects
OpenAQ is a community of scientists, software developers, and lovers of open environmental data. OpenAQ is building an open, real-time database that provides programmatic and historical access to air quality data.

## Overview
## Development environment
To set up the development environment for this website, you'll need to install the following on your system:

## Gulp for building
The gulpfile is based on the [gulp-webapp](https://github.com/yeoman/generator-gulp-webapp) yeoman generator. The build system currently supports:
- Node (v4.2.x) & Npm ([nvm](https://github.com/creationix/nvm) usage is advised)

- Image optimization
- Sass compilation
- Watchify for JS bundling
- Minification/uglification where appropriate
- Serving and live reloading of pages

There are two commands, both run via npm.

- `npm run build` or `gulp build` or `gulp` - clean & build everything and put it into dist folder
- `npm run serve` or `gulp serve` - serve the pages and utilize live reload on changes to styles, fonts, images, scripts and HTML.


## Assets Structure
> The versions mentioned are the ones used during development. It could work with newer ones.
After these basic requirements are met, run the following commands in the website's folder:
```
app/assets/
|
+- scripts/: The user scripts
| |
| +- config/: configuration files (see configuration section)
|
+- styles/: The sass styles
|
+- vendor/: Any third-party script that can't be required()
|
+- graphics/: Images for the site divided in:
| |
| +- layout/: Images for layout elements (Ex: background images)
| +- meta/: Images for the meta tags (Mostly icons and facebook images)
| +- content/: Content image
|
$ npm install
```

### Configurations and environment variables

At times, it may be necessary to include options/variables specific to `production`, `staging` or `local` in the code. To handle this, there is a master config.js file. This file should not be modified. Instead, modify one of:

- config/production.js - production settings
- config/staging.js - overrides the production settings for staging server (basically Travis not on the DEPLOY branch)
- config/local.js - local (development) overrides. This file is gitignored, so you can safely change it without polluting the repo.

When developing locally with `gulp serve`, the default will be to use `production` (with overrides from `local.js`). However, if you need to run with the staging settings, use: `DS_ENV=staging gulp serve` from the command line.

### Getting started

### How scripts are built

The script build, which uses `browserify`, outputs two js files: `bundle.js` and
`vendor.js`:
- `bundle.js`, created by the `javascript` task in deployment and by
`watchify` during development, contains all the app-specific code:
`app/scripts/main.js` and all the scripts it `require`s that are local to
this app.
- `vendor.js`, created by the `vendorBundle` task, contains all the external
dependencies of the app: namely, all the packages you install using `npm
install --save ...`.

## Travis for testing and deployment
The .travis.yml file enables the usage of [Travis](http://travis.org) as a test and deployment system. In this particular case, Travis will be looking for any changes to the repo and when a change is made to the `master` branch, Travis will build the project and deploy it to the `gh-pages` branch. Staging is deployed to http://openaq.org-staging.s3-website-us-east-1.amazonaws.com/#/ while production is deployed to https://openaq.org via gh-pages.

## semistandard for linting
We're using [semistandard](https://github.com/Flet/semistandard) for linting.

- `npm run lint` - will run linter and warn of any errors.
```
$ npm run serve
```
Compiles the sass files, javascript, and launches the server making the site available at `http://localhost:3000/`
The system will watch files and execute tasks whenever one of them changes.
The site will automatically refresh since it is bundled with livereload.

There are linting plugins for popular editors listed in the semistandard repo.
### Other commands
Compile the sass files, javascript... Use this instead of ```npm run serve``` if you don't want to watch.
```
$ npm run build
```
Binary file added app/assets/graphics/content/about1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/graphics/content/about2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/graphics/content/community1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/graphics/content/community2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/graphics/content/projects/ropenaq.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/graphics/content/projects/smokey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file removed app/assets/graphics/layout/DevelopmentSeed.png
Binary file not shown.
Binary file removed app/assets/graphics/layout/hero.jpg
Binary file not shown.
Binary file removed app/assets/graphics/layout/wind.png
Binary file not shown.
Binary file removed app/assets/graphics/layout/wind_white.png
Binary file not shown.
File renamed without changes.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed app/assets/graphics/meta/icons/apple-icon-60x60.png
Diff not rendered.
Binary file removed app/assets/graphics/meta/icons/apple-icon-72x72.png
Diff not rendered.
Diff not rendered.
Binary file removed app/assets/graphics/meta/icons/apple-icon.png
Diff not rendered.
2 changes: 0 additions & 2 deletions app/assets/graphics/meta/icons/browserconfig.xml

This file was deleted.

Binary file removed app/assets/graphics/meta/icons/favicon-16x16.png
Diff not rendered.
Binary file removed app/assets/graphics/meta/icons/favicon-32x32.png
Diff not rendered.
Binary file removed app/assets/graphics/meta/icons/favicon-96x96.png
Diff not rendered.
41 changes: 0 additions & 41 deletions app/assets/graphics/meta/icons/manifest.json

This file was deleted.

Binary file removed app/assets/graphics/meta/icons/ms-icon-144x144.png
Diff not rendered.
Binary file removed app/assets/graphics/meta/icons/ms-icon-150x150.png
Diff not rendered.
Binary file removed app/assets/graphics/meta/icons/ms-icon-310x310.png
Diff not rendered.
Binary file removed app/assets/graphics/meta/icons/ms-icon-70x70.png
Diff not rendered.
25 changes: 25 additions & 0 deletions app/assets/scripts/actions/action-creators.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import * as baseData from './base-data';
import * as baseStats from './base-stats';
import * as compare from './compare';
import * as geolocation from './geolocation';
import * as latestMeasurements from './latest-measurements';
import * as location from './location';
import * as locations from './locations';
import * as measurements from './measurements';
import * as nearbyLocations from './nearby-locations';
import * as locationsByCountry from './locations-by-country';
import * as downloadModal from './download-modal';

module.exports = Object.assign({},
baseData,
baseStats,
compare,
geolocation,
latestMeasurements,
location,
locations,
measurements,
nearbyLocations,
locationsByCountry,
downloadModal
);
Loading

0 comments on commit 87fdb8e

Please sign in to comment.