|
1 | | -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). |
| 1 | +Bryan's first React webapp with PHP endpoints |
| 2 | +============================================= |
2 | 3 |
|
3 | | -## Available Scripts |
| 4 | +Installation to run in production |
| 5 | +--------------------------------- |
4 | 6 |
|
5 | | -In the project directory, you can run: |
| 7 | +1. Extract contents |
6 | 8 |
|
7 | | -### `npm start` |
| 9 | +2. Install `npm` modules automatically based on `package.json` |
8 | 10 |
|
9 | | -Runs the app in the development mode.<br /> |
10 | | -Open [http://localhost:3000](http://localhost:3000) to view it in the browser. |
| 11 | + cd helloreact |
| 12 | + npm install |
| 13 | + |
| 14 | +3. Build the React client-side |
11 | 15 |
|
12 | | -The page will reload if you make edits.<br /> |
13 | | -You will also see any lint errors in the console. |
| 16 | + npm run build |
| 17 | + |
| 18 | +4. Copy the contents of `helloreact/build` directly into the `htdocs` of your XAMPP or other PHP server-side environment. |
14 | 19 |
|
15 | | -### `npm test` |
| 20 | +5. Create the MySQL database `helloreact` and user account, with matching password as found in the source code of the `build/endpoints` PHP endpoints. |
16 | 21 |
|
17 | | -Launches the test runner in the interactive watch mode.<br /> |
18 | | -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. |
| 22 | + create database helloreact; |
| 23 | + grant all on helloreact.* to helloreact@localhost identified by 'EoJe0jJWXsAe'; |
| 24 | + |
| 25 | +All necessary tables will be automatically created when creating your first article in the webapp. |
19 | 26 |
|
20 | | -### `npm run build` |
| 27 | +Installation for development purposes |
| 28 | +------------------------------------- |
21 | 29 |
|
22 | | -Builds the app for production to the `build` folder.<br /> |
23 | | -It correctly bundles React in production mode and optimizes the build for the best performance. |
| 30 | +For real-time development of the React client-side without having to re-run `npm run build` on every change you will need to segregate the PHP server-side so that you can use the out-of-the-box React server-side for development of the client-side. |
24 | 31 |
|
25 | | -The build is minified and the filenames include the hashes.<br /> |
26 | | -Your app is ready to be deployed! |
| 32 | +1. Copy the `public/endpoints` directory to your XAMPP or other PHP server-side environment. |
27 | 33 |
|
28 | | -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. |
| 34 | +2. Edit the PHP files on your PHP server-side copy and uncomment the `Access-Control-Allow-Origin` line in each. This will allow requests from the origin of your temporary/development React server-side to gain access to the PHP server-side endpoints. |
29 | 35 |
|
30 | | -### `npm run eject` |
| 36 | +3. Within `src/App.js`, uncomment the second `var phpEndpoints` line and specify the alternative origin of the PHP endpoints. |
31 | 37 |
|
32 | | -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** |
| 38 | +4. `npm run start` will start the React client-side and, if all goes according to plan, it links right up to the origin of your PHP server-side. |
33 | 39 |
|
34 | | -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. |
35 | | - |
36 | | -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. |
37 | | - |
38 | | -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. |
39 | | - |
40 | | -## Learn More |
41 | | - |
42 | | -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). |
43 | | - |
44 | | -To learn React, check out the [React documentation](https://reactjs.org/). |
45 | | - |
46 | | -### Code Splitting |
47 | | - |
48 | | -This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting |
49 | | - |
50 | | -### Analyzing the Bundle Size |
51 | | - |
52 | | -This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size |
53 | | - |
54 | | -### Making a Progressive Web App |
55 | | - |
56 | | -This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app |
57 | | - |
58 | | -### Advanced Configuration |
59 | | - |
60 | | -This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration |
61 | | - |
62 | | -### Deployment |
63 | | - |
64 | | -This section has moved here: https://facebook.github.io/create-react-app/docs/deployment |
65 | | - |
66 | | -### `npm run build` fails to minify |
67 | | - |
68 | | -This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify |
0 commit comments