From 081a65d8435dbb7aa8c2fe4bb420be87471ae79c Mon Sep 17 00:00:00 2001 From: Carl Taylor Date: Sat, 7 Sep 2024 16:43:10 -0700 Subject: [PATCH] [frontend/README] split setup from regular dev loop --- frontend/README.md | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/frontend/README.md b/frontend/README.md index 33d42433a7..635b870e94 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,20 +1,7 @@ ### pre-reqs - - node, npm - `npm install react-app-rewired` - -### steps to build and deploy react - -1. create a folder `react` under deployed `wildbook/` dir -2. create a `.env` for React environment variables under the root of `REPO/frontend/`. In this file: - 1. Add the public URL. For local tomcat development, use `PUBLIC_URL=http://localhost:81/react/` (or whatever port your local server is running on). For public deployment, use the following, where `public.url.example.com` is your deployed URL: `PUBLIC_URL=https://public.url.example.com/react/` - 2. Add site name like this: `SITE_NAME=Amphibian Wildbook` -3. cd to `REPO/frontend/` and run `npm run build` -4. copy everything under `frontend/build/` to the `wildbook/react/` created in step 1 -5. refresh your browser page by visiting either `http://localhost:81/react/` for local testing or `https://public.url.example.com/react/` for the public-facing deployment - - ### steps to setup dev environment 1. cd to the root folder of your codebase, for example `/Wildbook` 2. run `npm install` @@ -22,3 +9,17 @@ 4. cd to the react folder `Wildbook/frontend/`, 5. also run `npm install` to install all dependencies 6. now you should be able to commit and Husky will check your code for any issues before each commit +7. create a `.env` for React environment variables under the root of `REPO/frontend/`. In this file: + 1. Add the public URL. For local tomcat development, use `PUBLIC_URL=http://localhost:81/react/` (or whatever port your local server is running on). For public deployment, use the following, where `public.url.example.com` is your deployed URL: `PUBLIC_URL=https://public.url.example.com/react/` + 2. Add site name like this: `SITE_NAME=Amphibian Wildbook` + +### steps to set up deploy directory +1. create a folder `react` under deployed `wildbook/` dir + +### steps to build and deploy react +1. cd to `REPO/frontend/` and run `npm run build` +2. copy everything under `frontend/build/` to the deployed `wildbook/react/` directory you created during setup +3. refresh your browser page by visiting either `http://localhost:81/react/` for local testing or `https://public.url.example.com/react/` for the public-facing deployment + + +