Skip to content

Commit

Permalink
Merge pull request #21 from jpelbertrios/gh-7-ui-develop
Browse files Browse the repository at this point in the history
Gh 07 ui develop
  • Loading branch information
macenturalxl1 committed Sep 15, 2020
2 parents a52e879 + 875583f commit edf6e84
Show file tree
Hide file tree
Showing 22 changed files with 1,477 additions and 685 deletions.
46 changes: 29 additions & 17 deletions ui/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

## Available Scripts in UI Directory

In the project directory, you can run:

### `npm start`
#### `npm start`

Runs the app in the development mode. Open [http://localhost:8080](http://localhost:8080) to view it in the browser.
The page will reload if you make edits and you will also see any lint errors in the console.<br />

It also uses [Concurrently](https://www.npmjs.com/package/concurrently) to run a mock Kai Rest Api on port 5000 for the
UI to send requests to. You can edit the example HTTP Responses for each endpoint in [middleware.js](./server/middleware.js).
It runs on an Express server so here are the support [Response docs](http://expressjs.com/en/5x/api.html#res).

Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
#### `npm test`

The page will reload if you make edits.<br />
You will also see any lint errors in the console.
Runs all tests with a coverage report.

### `npm test`
#### `npm testwatch`

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.
Jest will launch all tests in watch mode. Every time you save a file, it will re-run the tests.<br />

### `npm run build`
You can specify a test file to run by using the `-p` option and the name (or directory name) tests you want to run.

#### `npm run build`

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!
The build is minified and the filenames include the hashes.

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`
#### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

Expand All @@ -37,8 +42,15 @@ Instead, it will copy all the configuration files and the transitive dependencie

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More
## API Integration

To point this UI app to an Kai's API endpoint, assign the base endpoint for the environment variable `REACT_APP_KAI_REST_API_HOST`
in the [.env](./.env) file.

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
The app has to run in Production mode (the build will use `NODE_ENV=production`) to send requests to Kai's API endpoint.
In Dev mode, it will use proxy endpoint which is set up to use localhost:5000 where a Dev mock Kai API can
be served.

To learn React, check out the [React documentation](https://reactjs.org/).
## Notes

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
Loading

0 comments on commit edf6e84

Please sign in to comment.