Application served: [ Production | Dev ]
The client application has to be run in a separated thread from the server. The first time you clone the repository you will need to also install all the node depencencies:
git clone https://github.com/upf-gti/admire.git
cd admire
npm install
npm start
after this first installation you only need to do the npm start command.
- Runs by default in port 3000.
- Is proxying any routes tarting with /api to the backend server.
Any configuration needed should be changed on the .env file next to this README file.
Create-react-app is made to allow fast development with hot reloading and tight sintax checks. That throws many warnings and errors during the development stages and also doesn't cache the pages. It is mandatory to "compile" the aplication into a client-side only application that can be runned in a static server. For that purpose, open comand-line to the project root folder and run the following:
npm run build
This will generate an optimized version of the project inside a new "build" folder also in the root.
if you dont have a specific server you may find an integrated one within npm, check this
We are using the common used create-react-app framework. All api callbacks are set up to be proxied under the /api path. This frameworks allows automatic reloading by default.
.env contains all environment variables used by any node project. In this case we set the HTTPS and certs using this.
.cert is not commited within the repo. This folder should be placed by the root of the project and containing the key.pem and cert.pem. Checkout the Adding HTTPS to react app linked below in order to generate such certificates.
setupProxy.js is a module with a reserved name that is fetch by the create-react-app framework in order to manually setup proxy redirects.
jsconfig.json allows to define the basepath, useful cleaner imports
- Tutorial 1
- Tutorial 2
- Proxying backend requests
- Adding HTTPS to react app
- Make import path based on Root in React
- Modern React Tutorial Videos
- Functional Components vs Class Components in React
- How do I do AJAX requests in React?
- Podria ser una buena guia para añadir una BBDD
- ReactRouter without webpack
- Create react components without JSX
- React.createElement method examples
React Bootstrap compiles to regular bootstrap HTML so its fully compatible with any existing example (except maybe adding some minor attribute naming exceptions) Bootstrap Icons and Font-Awesome icons may be used
-
error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
- Switch node version to lts v14, i recommend using NVM
-
something about postcss-loader
- run npm upgrade to update the package