diff --git a/README.md b/README.md index 0c83cde2ce793a26e49d9a3ef8b180384cdc5a38..40845a125fb4824f0162de9c1088ce83347323b5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,41 @@ -# Getting Started with Create React App +# CCCE deployment tool web UI + +This project is meant to be the web User Interface for the CCCE Deployment tool. The project is written in ReactJS. + +## Developing environment +* NodeJS and npm +* Docker (if want to run backend locally for test purposes) +* IDE for JavaScript developement (e.g. Visual Studio Code) + +(For developing purposes it is suggested to use _Node Version Manager_ [NVM] which makes easy to change between different Node versions). +* Windows: https://github.com/coreybutler/nvm-windows +* Mac/Linux: https://github.com/nvm-sh/nvm + +### Required versions +* Node: v14.10+ +* npm: v6.10+ + +## Local development setup +For being able to run the backend, and frontend application on the same machine (locally) a proxy has been set in the project! +If you <ins>don't want to run</ins> the backend server, and frontend on the same machine, or have different settings, please adjust the `package.json` at the following line: +`"proxy": "http://localhost:8080"` + +### Environment Variables +Environment variables are stored in `.env` files. +Precedency of environment variable files are (files on the left have more priority than files on the right): +* npm start: `.env.development.local`, `.env.local`, `.env.development`, `.env` +* npm run build: `.env.production.local`, `.env.local`, `.env.production`, `.env` +* npm test: `.env.test.local`, `.env.test`, `.env` (note .env.local is missing) + +All environment variables start with `REACT_APP_` prefix. + +| Environment variable | Description | +| -------------------------|-------------| +| SERVER_ADDRESS | The backend server base URL _(host:port)_ (if backend server is running natively on the same host as the UI then the value has to be empty, and proxy has to be set!)| +| API_BASE_ENDPOINT | The context path of the application's REST API _(e.g. /ccce-api)_ | +| TOKEN_RENEW_INTERVAL | Time interval to renew JWT auth token _(in milliseconds)_ | + +## Useful links to start developing in ReactJS This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). @@ -47,24 +84,24 @@ To learn React, check out the [React documentation](https://reactjs.org/). ### Code Splitting -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) +[https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) ### Analyzing the Bundle Size -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) +[https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) ### Making a Progressive Web App -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) +[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) ### Advanced Configuration -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) +[https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) ### Deployment -This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) +[https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) ### `npm run build` fails to minify -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) +[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)