I am trying to learn React and have created a small web application.
It's a simple listing of products with a Firebase database. I run the application on my Console and add or remove products as I like. My question is the following:
Where can I find documentation to solve my doubts? I have searched and I cannot find a solution or the way to do it, maybe I am not looking in the right way
How do I make the application so that a user can open it without using the terminal (console)?
Should i create a server?
Can I create a link to an HTML document from which the user can access the application?
I don't know how to find the correct documentation to achieve my goal Thanks
Most React applications are written using a toolchain that includes a transpiler (usually Babel) and bundler (such as Webpack or Parcel).
The bundler tend to include a development server which features hot reloading. You shouldn't use this in production or ask typical end users to run it.
It will also have a mechanism for building the production version of the application (which will drop file in to a directory, typically named dist, for copying to the production webserver).
Read the documentation for that bundler to find out how to do that. Typically whatever instructions you followed to set up the React development environment will have written a script to do this into package.json which can often be invoked with npm run build.
Then copy the generated files to your production web server.
People can then just visit the URL of that server.
The steps are simple by following the official React documentation:
https://create-react-app.dev/docs/production-build
This can be on a shared server, on a GitHub page, etc.
To upload the application to a shared server, before compiling you just have to add the following to your packaje.json above the scripts:
"homepage": "http: // yourDomainName /",
"scripts": {
"start": "",
"build": "",
"test": "t",
"eject": "t",
"build: css": "
"watch: css": "
}
.....
In your project folder you must run npm run build
This generates the build folder where the files to upload to the server are.
Zip this folder, upload to your server and unzip. And there has its application
To add it to a GitHub repository, just follow the official documentation.
https://github.com/tschaub/gh-pages
Luck