Skip to content

Commit

Permalink
Simplify installation instructions. Add React section. [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
rap1ds committed May 11, 2017
1 parent 3c46bd6 commit 5618db3
Showing 1 changed file with 33 additions and 27 deletions.
60 changes: 33 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,33 +129,9 @@ Before you get started, the following needs to be installed:

1. Start the development server:

Some components are created with React (see [documentation](https://github.com/sharetribe/sharetribe/blob/master/client/README.md)) and they need to be built with Webpack. We have [Foreman](http://theforeman.org/) Procfiles that can be used to run both Rails and Webpack:

1. React component static build

```bash
foreman start -f Procfile.static
```

1. React component & hot loading styleguide (http://localhost:9001/)

```bash
foreman start -f Procfile.hot
```

1. If you need to debug the Rails parts of Sharetribe with [Pry](https://github.com/pry/pry), it's not possible with Foreman due to a [known compatibility issue](https://github.com/ddollar/foreman/pull/536). In this case we recommend running Rails with old-fashioned `rails server` and React builds with Foreman in a separate terminal. That way your `binding.pry` calls open nicely in the same window with the Rails process.
1. React component static build, React client only
```bash
foreman start -f Procfile.client-static
```
1. React component & hot loading styleguide (http://localhost:9001/), React client only
```bash
foreman start -f Procfile.client-hot
```
```bash
foreman start -f Procfile.static
```

1. Invoke the delayed job worker in a new console (open the project root folder):

Expand Down Expand Up @@ -243,6 +219,36 @@ To automatically run unit tests when code is changed, start [Guard](https://gith
bundle exec guard
```
### Working with React, Webpack and Foreman
Some components are created with React (see [documentation](https://github.com/sharetribe/sharetribe/blob/master/client/README.md)) and they need to be built with Webpack. We have [Foreman](http://theforeman.org/) Procfiles that can be used to run both Rails and Webpack:
1. React component static build
```bash
foreman start -f Procfile.static
```
1. React component & hot loading styleguide (http://localhost:9001/)
```bash
foreman start -f Procfile.hot
```
1. If you need to debug the Rails parts of Sharetribe with [Pry](https://github.com/pry/pry), it's not possible with Foreman due to a [known compatibility issue](https://github.com/ddollar/foreman/pull/536). In this case we recommend running Rails with old-fashioned `rails server` and React builds with Foreman in a separate terminal. That way your `binding.pry` calls open nicely in the same window with the Rails process.

1. React component static build, React client only

```bash
foreman start -f Procfile.client-static
```

1. React component & hot loading styleguide (http://localhost:9001/), React client only

```bash
foreman start -f Procfile.client-hot
```

### Setting up Sharetribe for production

Before starting these steps, perform [steps 1-5 from above](#setting-up-the-development-environment).
Expand Down

0 comments on commit 5618db3

Please sign in to comment.