|
1 |
| -# Getting Started with Create React App |
2 | 1 |
|
3 |
| -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). |
4 | 2 |
|
5 |
| -## Available Scripts |
| 3 | +# OAuth2 React Frontend |
6 | 4 |
|
7 |
| -In the project directory, you can run: |
8 | 5 |
|
9 |
| -### `npm start` |
| 6 | +This project is the frontend part of the OAuth2 workflow demonstration. It is built using React and demonstrates how to interact with the OAuth2 server (Hydra) and Oathkeeper proxy for secure access to protected resources. The frontend includes the following features: |
10 | 7 |
|
11 |
| -Runs the app in the development mode.\ |
12 |
| -Open [http://localhost:3000](http://localhost:3000) to view it in your browser. |
| 8 | +- User login |
| 9 | +- Consent form handling |
| 10 | +- Token exchange and storage |
| 11 | +- Access to protected resources |
13 | 12 |
|
14 |
| -The page will reload when you make changes.\ |
15 |
| -You may also see any lint errors in the console. |
| 13 | +### Prerequisites |
| 14 | +Before you begin, ensure you have the following installed on your machine: |
16 | 15 |
|
17 |
| -### `npm test` |
| 16 | +1. Node.js |
| 17 | +2. npm or yarn |
| 18 | +3. Basic understanding of React and OAuth2 concepts |
| 19 | +4. Git for version control |
18 | 20 |
|
19 |
| -Launches the test runner in the interactive watch mode.\ |
20 |
| -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. |
| 21 | +## Project Structure |
| 22 | +``` |
| 23 | +hydra_oathkeeper_proxy_demo_client/ |
| 24 | +├── public |
| 25 | +│ ├── index.html |
| 26 | +│ └── ... |
| 27 | +├── src |
| 28 | +│ ├── components |
| 29 | +│ │ ├── Login.js |
| 30 | +│ │ ├── Consent.js |
| 31 | +│ │ └── ... |
| 32 | +│ ├── contexts |
| 33 | +│ │ └── AuthContext.js |
| 34 | +│ ├── services |
| 35 | +│ │ ├── authService.js |
| 36 | +│ │ └── apiService.js |
| 37 | +│ ├── App.js |
| 38 | +│ ├── index.js |
| 39 | +│ └── ... |
| 40 | +├── .env.example |
| 41 | +├── package.json |
| 42 | +├── README.md |
| 43 | +└── ... |
21 | 44 |
|
22 |
| -### `npm run build` |
| 45 | +``` |
23 | 46 |
|
24 |
| -Builds the app for production to the `build` folder.\ |
25 |
| -It correctly bundles React in production mode and optimizes the build for the best performance. |
| 47 | +## Installation |
| 48 | +Follow these steps to install the project dependencies: |
26 | 49 |
|
27 |
| -The build is minified and the filenames include the hashes.\ |
28 |
| -Your app is ready to be deployed! |
| 50 | +1. Clone the Repository |
| 51 | +``` |
| 52 | +git clone https://github.com/guptaaashutosh/OAuth2.0-with-reverse-proxy-client.git |
| 53 | +cd hydra_oathkeeper_proxy_demo_client |
| 54 | +``` |
29 | 55 |
|
30 |
| -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. |
| 56 | +2. Install Dependencies |
| 57 | +``` |
| 58 | +npm install |
| 59 | +``` |
31 | 60 |
|
32 |
| -### `npm run eject` |
| 61 | +or, if you prefer yarn: |
33 | 62 |
|
34 |
| -**Note: this is a one-way operation. Once you `eject`, you can't go back!** |
| 63 | +``` |
| 64 | +yarn install |
| 65 | +``` |
35 | 66 |
|
36 |
| -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. |
37 | 67 |
|
38 |
| -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. |
| 68 | +2. In the project directory, you can run: |
| 69 | +``` |
| 70 | +npm start |
| 71 | +``` |
39 | 72 |
|
40 |
| -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. |
| 73 | +The OAuth2 React Frontend application will be running at http://localhost:3000. |
41 | 74 |
|
42 |
| -## Learn More |
43 |
| - |
44 |
| -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). |
45 |
| - |
46 |
| -To learn React, check out the [React documentation](https://reactjs.org/). |
47 |
| - |
48 |
| -### Code Splitting |
49 |
| - |
50 |
| -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) |
51 |
| - |
52 |
| -### Analyzing the Bundle Size |
53 |
| - |
54 |
| -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) |
55 |
| - |
56 |
| -### Making a Progressive Web App |
57 |
| - |
58 |
| -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) |
59 |
| - |
60 |
| -### Advanced Configuration |
61 |
| - |
62 |
| -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) |
63 |
| - |
64 |
| -### Deployment |
65 |
| - |
66 |
| -This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) |
67 |
| - |
68 |
| -### `npm run build` fails to minify |
69 |
| - |
70 |
| -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) |
|
0 commit comments