How to deploy a React App with SSR on cPanel? - node.js

so here is the thing, I have created a react app with server side rendering (with babel and webpack and an express server). I was able to run it locally. So far So good.
Now I want to publish it on the web, and I am clueless about how to do that, there isn't much documentation about that and I wasn't able to get an answer so far.
Any help would be appreciated.
Thank you in advance.

If It's an hobby project you can do that with Heroku. It's free. Else you can buy a Heroku premium or Digital ocean or AWS EC2 server

Related

Problems with a node.js and handlebars.js project deployment

I have a project with node.js, express and handlebars as a template engine. I had it deployed in Heroku but since they are going to charge for the deployments I am looking for a free alternative.
I would love some help/ideas.
Thanks in advance!
I have tried with Vercel but I am incapable of deploying it correctly. It displays only my index.js file, in which I have the settings for handling the routes.

How to deploy node.js app onto a production server?

im new to node.js and have struggled to find information about deploying apps.
Say that I have written a small one file node.js app and would like to deploy it onto a prod server. If I deploy the app.js file alone I cant use "node app.js" to run as the app is missing package.json and the node modules. But deploying all these files/folders to the server seems like the wrong way to do it as it would take ages to transfer all the node_modules.
The only resources that I can find online use localhost node server which doesn't really show what I need. I'm using MobaX to deploy to a specific IP if this is useful.
Sorry if this is a stupid question, most of my experience is in front-end so haven't had the opportunity to play around with this and don't have anyone to ask for guidance.
Please don't mark down the question, I will happily edit the question if any feedback on doing so is provided.

hosting24 has dont any option for setup node js app

I have bought hosting24 but I am not seeing any option for setting up node js option over there. Can anybody please guide me so that I can run my node js application over there...
Thanks
You have to use VPS hosting available in their website. Then you just can guide something similar to this host NodeJS in VPS
https://www.hosting24.com/vps-hosting

How to deploy dist and server side on Heroku correctly?

I am creating a simple customer chat app for my school project using Pusher according to their tutorial.
I want to deploy the app on Heroku so anyone can use this app and connect to it. This app has a client-side (Vue.js app) and a server-side (express) folder.
How can I make it work together by deploying it on Heroku or what have I do?
I have deployed the client-side on Heroku and the front-end works fine.
I also tried to deploy server-side, but it seems it does not communicate with each other.
The server works fine on the localhost, however, I need to make it work globally.
The code can be found in this repository.
Server side settings are in server.js.
I have only changed some front-end stuff, but nothing important yet, so the code is pretty the same.
This is my first Vue.js & server deploying and I was trying several tips and tutorials, but none of them solved this issue.

Deploy Nodejs + ReactJs to Heroku

I'm learning how to deploy a web site to heroku.
My web app has a nodejs project and one mysql in the server side, a reactjs in the client side.
Can you show me the steps that I need to do? Because I'm new to this.
Thank you very much
Here is a step by step guide.
Put your app aside for a few moments and follow these:
To learn how to deploy a nodejs
https://devcenter.heroku.com/articles/deploying-nodejs
Now learning how to add a mysql database
https://devcenter.heroku.com/articles/cleardb#provisioning-the-shared-mysql-add-on
This will teach you how to deploy a 'raw' react app
https://blog.heroku.com/deploying-react-with-zero-configuration
Now, it's all about how you want things to be. You can have a route on your nodejs app that serves the index.html with the react app or a separate app for nodejs and for react. You should probably make them separated, just to keep things organized, but since it's your first deploy and you're probably using it as a hobby or to learn, any way is correct as long as you get it to work. Then you can build on top of that, split the apps into two, or maybe host the react app on aws s3. Who knows?

Resources