-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from openaq/develop
Deploying v2
- Loading branch information
Showing
195 changed files
with
11,600 additions
and
4,973 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
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.
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.
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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
File renamed without changes.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
This file was deleted.
Oops, something went wrong.
Diff not rendered.
Diff not rendered.
Diff not rendered.
This file was deleted.
Oops, something went wrong.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
); |
Oops, something went wrong.