-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #787 from WildMeOrg/development-docker-instruction…
…-rework development docker instruction rework
- Loading branch information
Showing
3 changed files
with
60 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,16 @@ | ||
### pre-reqs | ||
- node, npm | ||
- `npm install react-app-rewired` | ||
## Frontend Setup | ||
The frontend is currently split between native tomcat functions, jsp pages, and a react app. New development is targeting a full react app rewrite. This setup is focused on the react specific requirements. However, you must do the full system setup referenced in the [development README](../devops/README.md) for these to work. | ||
|
||
### steps to setup dev environment | ||
1. cd to the root folder of your codebase, for example `/Wildbook` | ||
2. run `npm install` | ||
3. run `chmod +x .husky/pre-commit` to enable husky pre-commit hooks | ||
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` | ||
### Build and deploy react-only changes | ||
If you are working on react-only work, you can test your changes without updating the full war file. | ||
|
||
### steps to set up deploy directory | ||
1. create a folder `react` under deployed `wildbook/` dir | ||
|
||
### steps to build and deploy react | ||
#### using npm to build and deploy to your local deployment | ||
#### Use npm to build and deploy to your local deployment | ||
If you have your dev environment set up correctly, this will build the React app and copy it into your local deployment directory for you. | ||
1. cd to `REPO/frontend/` | ||
2. run `npm run deploy-dev` | ||
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 | ||
|
||
#### manually building and deploying | ||
#### Manually build and deploy | ||
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 |