Skip to content

Commit

Permalink
Merge branch 'master' of github.com:UTD-CRSS/app.exploreapollo.org in…
Browse files Browse the repository at this point in the history
…to develop
  • Loading branch information
austinpray committed Oct 4, 2016
2 parents e9ce7cf + c01f316 commit b17b918
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[![Build Status](https://travis-ci.org/UTD-CRSS/app.exploreapollo.org.svg?branch=master)](https://travis-ci.org/UTD-CRSS/app.exploreapollo.org)
[![Dependency Status](https://david-dm.org/UTD-CRSS/app.exploreapollo.org.svg)](https://david-dm.org/UTD-CRSS/app.exploreapollo.org)
[![devDependency Status](https://david-dm.org/UTD-CRSS/app.exploreapollo.org/dev-status.svg)](https://david-dm.org/UTD-CRSS/app.exploreapollo.org#info=devDependencies)
[![Stories in Ready](https://badge.waffle.io/UTD-CRSS/app.exploreapollo.org.svg?label=ready&title=Ready)](http://waffle.io/UTD-CRSS/app.exploreapollo.org)
[![Code Climate](https://codeclimate.com/github/UTD-CRSS/app.exploreapollo.org/badges/gpa.svg)](https://codeclimate.com/github/UTD-CRSS/app.exploreapollo.org)

[![Sauce Test Status](https://saucelabs.com/browser-matrix/utd-crss.svg)](https://saucelabs.com/u/utd-crss)
Expand Down Expand Up @@ -59,13 +58,41 @@ npm i --progress=false

### Project Structure

Source lives in `src/`. Compiled output goes in `dist/`.
Source lives in `src/`. Compiled output goes in `dist/`. Configuration goes in
`config/`.

#### Source Files

- `containers/`: [Stateful][dumb-comp] react components. These are usually top-level route handlers.
- `components/`: [Stateless/Dumb][dumb-comp] react components. These guys determininstically render based on props.


### Configuration Values

Configuration values are stored in the `config/` directory. You gain access to the configuration values by importing the config object from `config/index.js`. The configuration values are loaded as such:

1. The values in `config/default.js`
2. The values in `config/{{APP_ENV}}.js` where `APP_ENV` is an environment variable.
3. If `APP_ENV` is not set, `config/development.js` will be loaded by default.

[the logic for loading the config is here](https://github.com/UTD-CRSS/app.exploreapollo.org/blob/master/config/index.js).

#### Example

We use the configuration file to determine the API entry point in our actions.

1. [import the configuration object](https://github.com/UTD-CRSS/app.exploreapollo.org/blob/a999375d881ed763fd18b852b402582b5a6e647b/src/actions/index.js#L5)
2. [use the configuration object](https://github.com/UTD-CRSS/app.exploreapollo.org/blob/a999375d881ed763fd18b852b402582b5a6e647b/src/actions/index.js#L31)
3. If the `APP_ENV` is set to `staging`, [this](https://github.com/UTD-CRSS/app.exploreapollo.org/blob/a999375d881ed763fd18b852b402582b5a6e647b/config/staging.js#L3) will be the value for `config.apiEntry`.

Consider the following example commands:

```bash
npm run dev # runs dev server with development API
APP_ENV=staging npm run dev # runs dev server with staging API
APP_ENV=production npm run dev # runs dev server with production API
```

[nvm]: https://github.com/creationix/nvm
[jest]: https://facebook.github.io/jest/
[dumb-comp]: https://github.com/uberVU/react-guide/blob/master/props-vs-state.md#component-types

0 comments on commit b17b918

Please sign in to comment.