Skip to content

Commit

Permalink
Merge branch 'develop' - PCA UI README updates
Browse files Browse the repository at this point in the history
  • Loading branch information
EC2 Default User committed Oct 16, 2024
2 parents fbd4d0b + 0fe41d0 commit 3b5b4ae
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 57 deletions.
86 changes: 29 additions & 57 deletions pca-ui/src/www/README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,43 @@
# Getting Started with Create React App
# Run PCA UI locally

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

## Available Scripts
1. If you haven't already, deploy PCA into your AWS account - see top level [README](../../../README.md).
2. Make sure you have Node.js v18 installed

In the project directory, you can run:
### Setup

### `npm run start`
In directory `pca-ui/src/www`

For **Post Call Analytics**, first deploy PCA into an AWS account. Go to the `webbucket` folder and copy the `config.js` file into the local `pca-ui/src/www/public` folder.
1. **Install NPM packages locally**

Finally, run `npm run start` and navigate to http://localhost:3000 in a browser -- the existing PCA should load up on the local browser, in development mode.
- Run `npm install` to downloads and installs npm packages needed to run locally.

The page will reload if you make edits.\
You will also see any lint errors in the console.

### `npm run test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
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.\
Your app is ready to be deployed!

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

### `npm run eject`

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

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
2. **Download cofig.js**

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.
- open the PCA stack **Resources** tab, and navigate to nested `PCAUI` stack
- again open the **Resources tab**, and navigate to the nested `Web` stack
- again open the **Resources** tab, and navigate to the S2 bucket named `WebBucket`
- download and copy `config.js` file into the local `pca-ui/src/www/public` folder.

## Learn More
3. **Configure Cognito for local URL redirect\***

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
- open the PCA stack **Resources** tab, and navigate to nested `PCAUI` stack
- again open the **Resources** tab, and navigate to the nested `Cognito` stack
- again open the **Resources** tab, and navigate to the Cognito UserPool named `PCAUserPool`
- Open the **App integration** tab, and scroll down to **App clients and analytics**
- Open the App client `PCAUserPoolClient-XXXX`
- Under **Hosted UI** click **Edit**
- Under **Allowed callback URLs** click **Add another URL**
- Enter `http://localhost:3000/` to enable login redirect to your local PCA UI server
- Click \*_Save Changes_ at the bottom of the page

To learn React, check out the [React documentation](https://reactjs.org/).
### Run PCA UI Server locally

### Code Splitting
- Run `npm run start`
- Navigate to http://localhost:3000 in a browser -- the existing PCA should load up on the local browser, in development mode.

This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)

### Analyzing the Bundle Size

This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)

### Making a Progressive Web App

This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)

### Advanced Configuration

This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)

### Deployment

This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)

### `npm run build` fails to minify
The page will reload if you make edits.\
You will also see any lint errors in the console.

This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
![PCA UI Local](images/pcaui-local.png)
Binary file added pca-ui/src/www/images/pcaui-local.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3b5b4ae

Please sign in to comment.