how to deploy react isomorphic app to any server? - reactjs

I am working on a react isomorphic app in which my express server is running along with the client app now I want to deploy this app but didn't know the proper way to deploy this kind of app.
this boilerplate of my project client folder contains react app and server.js contain express server. normally we run the build command and deploy our project's build. but in this case, if I run the build command then I lose my server.
my react app is running on 3000 port while my server is running on 5000.
if anyone has the solution or gives a bit of advice.
I need to get data from google bigquery and it is not possible from the client-side so use this approach

Related

Deploy SvelteKit/Pocketbase app to Linode server

I have created sveltekit/pocketbase project that I would like to deploy to Linode to run under subdomains:
backend.mydomain.com for pocketbase
appname.mydomain.com for sveltekit
First I deployed pocketbase and I'm running it with systemd service which is working fine.
But there's problem when I want to deploy and run sveltekit app. I was following this article on how to run svelte app on linode using pm2 and caddy. But there's problem because 443 address is already in use. When I turn off the pocketbase.service I can run my svelte app.
Now I know I should probably use reverse proxy for pocketbase, but I'm new in this and a bit lost in all the information. Any tips on how could I achieve this?

How can I deploy my next js app to iis server?

I have an IIS Server and a Next JS app which is mosty SSR. The problem is that I'm connected through a VPN and it was very easy to deploy a react-create-app, just moving the build folder and than all was working. Now it does not work the same and I do not find enough documentation for my problem.
If you want an easy way like react-create-app, you can use NextJS export function which doesn't have server side. Then you can just run next export and upload your next build folder to your server.
If you insist to have SSR on your NextJS app, then the way you upload your app might be more difficult than just a upload your build folder. Because your app now has a server side that you need to run in your IIS server.
The easiest way to run Next SSR app on your server is by copying the whole root folder of your app to the server and run the production mode.
Other than that is by using containerization, so you build your app's image and push to the repo, then your IIS server will get this image and run it in the container.

How to merge React App and Express App to deploy on single project?

I recently create Express and MongoDB API and after that, I connect that API to my React Application successfully and which is running well. But one situation occurring during deployment now I need to deploy both projects separately means I need two hosting plan for them. So, I want that both project running on the same host. Is it possible? and How?
A build of any React application creates (unless webpack-dev-server is used to compile it) the output which consists of static files: script bundles and .html file(s) that reference the bundles in <script> tag.
Those files can and should be copied to Express in production build. Then you have one server on one host. When React application runs inside a client (e.g. browser) it gets everything including .html files, script bundles, API responses from the single source: Express backend/server. Which by the way excludes any possibility of getting CORS issues so many people are asking about here on SO.
Example, e.g. a boilerplate project that demonstrates all that.
If you execute commands:
git clone https://github.com/winwiz1/crisp-react.git
cd crisp-react
yarn install && yarn start:prod
and then point your browser to localhost:3000, you will have React app running inside your browser and it got everything from one single Express backend.
crisp-react has two subdirectories: client with React client app and server with Express backend. The build command copies the build artifacts from one subdirectory to another. So you can even rename or delete the client subdirectory after a build, it won't affect the Express backend.

Do I need an HTTP server (e.g. Express, Nginx, etc.) for react app on Heroku?

I am little novice when it comes to deploying full-stack applications.
I am building a basic react app (created with create-react-app) that needs to deployed on Heroku and hit my Rails backend API (separate repo, already built and deployed on Heroku). Do I need to setup a http server (i.e. Express or Nginx) to route requests from the browser to the backend app? Or can I just rely on the default webpack production server to handle this.
Appreciate anyone's help!!
You don't need a back-end to serve static content on Heroku.
Have a look at this article to get started: https://blog.heroku.com/deploying-react-with-zero-configuration
It uses https://github.com/mars/create-react-app-buildpack and it's easy to get stated, I managed to deploy the example app in a few minutes.

Production build for react native for IIS Server

I have a demo react native app in my development machine.Now i would like deploy this to a production server there is a script for react to do this but there no documents on bundling the native app on production server.
Any Help is highly appreciated.....
[Update1]: The idea is to run a react native app using web screens from server.In detail once the user install the apk and open the app the home screen should be served from the server.I google for hours and could not find any useful resource i tried to bundle the app (web components plus native) but it was not successful. Hope i explained my problem.
This link by Clay Allsop explains the situation more briefly.

Resources