diff --git a/doc/react_frontend_stage_01_setup.md b/doc/react_frontend_stage_01_setup.md index e2efc8cd8aebdcbde7b40f14ade666c2eae8c3b6..a39d01751e7a68e425a0cd9c5602776258645967 100644 --- a/doc/react_frontend_stage_01_setup.md +++ b/doc/react_frontend_stage_01_setup.md @@ -186,4 +186,63 @@ export default App; Save to reload and chekc the change on -* [http://localhost:3000](http://localhost:3000) \ No newline at end of file +* [http://localhost:3000](http://localhost:3000) + +## Deployment + +### Step 1) Configuration + +For more information on the deployment see, e.g., + +* [Create react app: Available scripts](https://create-react-app.dev/docs/available-scripts) +* [Create react app: Deployment](https://create-react-app.dev/docs/deployment) + +For building for relative paths, i.e., for deployment on a relative path ([see](https://create-react-app.dev/docs/deployment#building-for-relative-paths)), an entry for the homepage has to be added to the `package.json` file. + +For the deployment as part of the gitlab page of this repository the following entry is used, + +```json + "homepage": "https://mmoessler.aidaho-pages.uni-hohenheim.de/aidaho-tinkering-club-web-app/react-build/", +``` + +### Step 2) Build the react app + +Start and enter the node container + +```bash +docker run -it --rm -v $(pwd)/react-frontend/my-react-app:/app -w /app node:16 bash +``` + +Build the react app + +```bash +# build application +npm run build +``` + +This cerates the directory `./react-frontend/my-react-app/build` with all neccessary files for a static deployment. + +The directory contains the following files for example, + +```bash +. +├── asset-manifest.json +├── favicon.ico +├── index.html +├── logo192.png +├── logo512.png +├── manifest.json +├── robots.txt +└── static + ├── css + │ ├── main.f855e6bc.css + │ └── main.f855e6bc.css.map + ├── js + │ ├── 488.103417aa.chunk.js + │ ├── 488.103417aa.chunk.js.map + │ ├── main.27d96172.js + │ ├── main.27d96172.js.LICENSE.txt + │ └── main.27d96172.js.map + └── media + └── logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg +``` \ No newline at end of file