Skip to content

Commit

Permalink
Adding documentation for getting the Rails API running with the user …
Browse files Browse the repository at this point in the history
…interface app.
  • Loading branch information
jrgriffiniii committed Feb 19, 2020
1 parent 453982f commit b2cde98
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 8 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
REACT_APP_API_URL=http://localhost:3000/browse
PORT=3001
61 changes: 61 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Development

## API (Rails Server)
This project was developed with the intention of using the
[BrowseEverything Rails Engine](https://github.com/samvera/browse-everything) as
a RESTful API, and this React application as a client.

In order to deploy *BrowseEverything* locally for developing this app. in your
local environment, please ensure that you are using the following dependencies:

* Ruby 2.6.5 or later
* Bundler 2.1.4 or later

Then, please follow these steps:

1. Clone the repository
```bash
git clone -b 2.x-stable https://github.com/samvera/browse-everything.git
```

2. Install the Gem dependencies and generate the test app.
```bash
RAILS_VERSION=6.0.2 bundle install
RAILS_VERSION=6.0.2 bundle exec rake engine_cart:generate
cd .internal_test_app
```

3. Run the Rails server
```bash
bundle install
bundle rails server
```

The Rails API should now be accessible on http://localhost:3000/api-docs

## User Interface (React App.)
Please ensure that the following dependencies are installed on your local
environment for the React app:

* NodeJS 12.16.0 or the latest LTS Erbium release
* Yarn 1.21.1 or later

1. Clone the repository
```bash
git clone https://github.com/samvera-labs/browse-everything-redux-react.git
```

2. Install the package dependencies
```bash
yarn install
```

3. Run the static server
```bash
yarn start
```

The React app. should be accessible http://localhost:3001

At this point, the user interface should be able to communicate with the Rails
API.
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,9 @@ You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.<br>
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

`npm run build`
### Developing and Testing with the Rails API

Builds the app for production to the `build` folder.<br>
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
Please see the [development guide](./DEVELOPMENT.md) for details regarding how to develop and test using the [BrowseEverything Rails API](https://github.com/samvera/browse-everything).

## Learn More About React

Expand Down

0 comments on commit b2cde98

Please sign in to comment.