How to check a VPS configuration (Nest and React)? - reactjs

I need to update the web app of a client of mine. That webapp uses Nest as a backend (along with Prisma and SQLite) and React as a frontend. Everything seems to run off of a VPS running Ubuntu.
I have a couple of questions since i've never used a VPS before :
How do I check the configuration of the VPS so that I can update the front-end and/or the backend without crashing the whole system and losing all the DB data ?
Is it necessarily using nginx ?
Thank you in advance

Related

Using a proxy to direct requests to backend vs using a different env?

I have a React application that reaches out to an API hosted on a different machine. The address of the machine hosting the backend will change from client to client. I currently use a script that builds a version of the React application with different env's for each of the clients. However as the number of clients is increasing, so is the number distinct builds I need to support.
My question is then: Which is preferable, continuing with my approach of one set of env's per client, or using a proxy (likely nginx) to redirect requests to the backend and making the setup of the proxy something for the client to do?
My only concern thus far with the second approach is that it means that nginx will be running in production, but not in development - which could potentially lead to production only issues that are difficult to resolve.

How to deploy a simple json-server?

I completed an online React course and deployed my application to Heroku. During development, I used the 'json-server' module found at https://github.com/typicode/json-server. This served up a folder on my computer which contained a simple json file and a few images for my website while conforming with the REST API. What do I need to do to get the server to operate independently of my machine so that my application can fetch the data ? I have zero experience doing this.
if you mean you want to create a server for your site,
first of all, you need to get a server, which can run nodejs , then you need to deploy and run your JSON server via a nodejs(express) app.
then you can connect to your server via your website/app
in order to do these things, you can follow tutorials
there are lots of tutorials about it.
hope you got the idea.

ReactJS app on SSL

I'm very new to ReactJS and am trying to test deploying to a web server.
It's just one component that says hello, to make sure everything is working.
It works fine on local host, but when I upload to my webserver, which is configured for SSL, it does not work.
Works: http://careigniter.com/x/test/
Does Not work: https://careigniter.com/x/test/
Is there something special you have to do if you are going to serve the entire app under SSL?
Thanks!
The issue is that server has wordpress and some caching, that is probably what is going on. I should have just started on a fresh server to begin with.

How to deploy angular app that completely relies on external API to retrieve and store data?

For an angular app that completely relies on external API to retrieve and store data, is NodeJS necessary for deployment? What are the other possible methods of deployment? Currently, I use it for local development and plan on using it in combination with Nginx for production. However, NodeJS is not doing anything except launching index.html. So should I remove NodeJS altogether and simply use Nginx alone?
One solution is to host it using any web host, they all equally host HTML only sites, and this solution is pretty inexpensive. Hosts like Hostgator, web.com etc., will allow you to upload the site via FTP.
A second choice is to host it using a web server (Nginx), but this is probably the most costly. You can host your own server in any cloud service (Amazon would be EC2 for instance) and then host your files there. This is probably not a good option for you. The only reason to use this type of solution is if you need the server to host code, so if you were using node to talk to a database for instance.
A 'pro' option may be to put them in S3 on AWS, and host it that way, it is pretty inexpensive.
Here is a link explaining how to host on Amazon - http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html
http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html

Use different variables for dev and prod with AngularJS and GruntJS

I am currently working on an Angular website that communicates with a RESTful API running on node.js that I built only for this app. They are two separate projects that runs on different ports.
While developing, I make the Angular app communicating with the local API. In production, the path to the API will be the IP address of the server. This is not a lot of work but I then need to change the address every time I want to deploy to production.
So here is some questions (sorry if this is a duplicate, I couldn't find it) :
Is it possible to create a two-sided variable (in grunt, in angular) in order to use some address (localhost) for development and another address for production ?
Maybe I got it all wrong and I should merge the API with the app ? I would have one big web server running on the same port and I could use relative paths and get rid of hostnames. How can I do to merge the express routes for the API with the angular routes ?
Thank you !

Resources