this post was submitted on 05 Jul 2023
9 points (100.0% liked)

Programming

13380 readers
1 users here now

All things programming and coding related. Subcommunity of Technology.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 1 year ago
MODERATORS
 

I have looked at Google Cloud Run, Microsoft Azure and Kamatera so far. These are free trials, and I deleted and removed all projects after playing with them.

I am working on a chatting application for my portfolio. I'm using MERN to create the app and I can run it locally and connect to the local server with any device on the network. Before I got into this I didn't realize setting up a cloud server was going to be so confusing, and that's after trying to watch tutorials on youtube and going through documentation.

On google, people have talked about VM Instances, (Bare Metal Solution?) Servers, networks, VPC's, VPC Networks, serverless VPC, etc. and I have explored all of these things and I just don't understand why it's so hard to get a node.js file running somewhere remote.

Microsoft Azure and Kamatera were pretty much the same experience.

I'm not the smartest or faster person, I've got cognitive issues, but if anyone can kind of give me some simple steps or explanations to get me started in the right direction, I'd really appreciate it.

I don't need a complete write-up or guide, just a push in the right direction for my specific project, which is just getting my node.js code somewhere so the client can connect to through it. I think?

all 14 comments
sorted by: hot top controversial new old
[–] s3rvant 2 points 1 year ago (1 children)

If you're comfortable working on a local VM then perhaps a VPS such as Linode or Digital Ocean would be a good place to start; they're essentially VMs hosted in cloud you have total control of so you can install whatever you want just like a local VM. Even the cheapest VPS option is plenty for this sort of testing.

These have free trials too such as: https://www.linode.com/tux

[–] reric88 1 points 1 year ago (1 children)

I'll look into this, thank you! I didn't look at a vps (I had to Google what vps meant) but I'll check it out!

I kept pushing with azure and I got pretty far with it, but I hit a snag when running az webapp up because I kept getting errors stating my app name already existed, or Id get a "forbidden" error if my app name was too unique

[–] s3rvant 2 points 1 year ago (1 children)

Yeah, bigger solutions like Azure, AWS, etc. have some cool features especially for scaling but... that comes with its own headaches.

For earlier stages I personally much prefer a simple VPS where I can freely do what I want with it including total wipes, snapshots / rollbacks, etc.

[–] reric88 2 points 1 year ago* (last edited 1 year ago) (1 children)

Hey man, so Linode worked after a long time wrapping my head around how to get things up and running. It was a huge learning experience, but the "fewer options" all over the dashboard helped steer me in the right direction. As my first successful deployment of an app it isn't much and there are issues, but I'm really proud of what I've accomplished! Take a look at the cat app I'm working on! I probably don't need to tell you this but don't enter personal information in the chat, it is not secure. nostchat.ddns.net

[–] s3rvant 2 points 1 year ago (1 children)

Cool concept! And congrats on getting it up and running :)

[–] reric88 1 points 1 year ago
[–] while1malloc0 2 points 1 year ago (1 children)

It’s not that it’s hard to get node code running on a remote server per se, it’s that there’s a lot of decisions to make and finicky details related to the “non-functional” parts of serving an app over the internet: getting traffic to the app, configuring multiple copies of the app, storing state, the developer experience of shipping your app from laptop to production, secrets management, etc. By and large, the differentiator of most cloud providers and “platforms as a service” is in how they approach handling those details, and there’s usually a spectrum of configurability and convenience. In general, as you add options to configure, you get less convenient, but more easily able to address more use cases.

In general, I recommend new developers target the thing that’s most convenient, which usually means the thing with the fewest configuration options. For node apps, my go to recommendations right now are Glitch and Railway. I’ve also heard good things about Render, and Fly, but I haven’t used either personally, so can’t speak to either. Generally though, I think you’ll have an easier time looking for a platform as a service instead of targeting a cloud provider directly.

[–] reric88 1 points 1 year ago

Thank you. As a new developer, I really need to start with simplicity, getting into the larger cloud options has been overwhelming

[–] krewllobster 2 points 1 year ago (2 children)

When I was learning I used Heroku free tier to host sites/servers. I was also using the MERN stack and used a Heroku CLI tool to do deployments.

Here's a step by step guide on freecodecamp.org for how to deploy an app to heroku. Hope it's helpful!

[–] krewllobster 2 points 1 year ago (1 children)
[–] reric88 1 points 1 year ago
[–] reric88 1 points 1 year ago

Thanks! I'll look at this after I go through these other suggestions

[–] navigatron 2 points 1 year ago (1 children)

Look at “ngrok”. It’s one command, and gives you a publicly accessible address+port that forwards to your locally running service. The code is still running on your machine, but all the networking problems are handled for you.

If you want to leave it running all the time, google cloud and oracle cloud both offer free, albeit small, virtual machines. You can use ngrok there too.

From there, any cloud provider should be able to attach a public ip address to your virtual machine. Azure and Aws are the easiest here.

I recommend a virtual machine because it will be very similar to how you run your code right now. I would not use anything “serverless”, like azure functions, because there is a lot going on under the hood that you should understand first, so that you can solve problems easily.

That being said, google cloud run can be straightforward, but only if you stay “on the sidewalk” if you know what I mean.

[–] reric88 2 points 1 year ago* (last edited 1 year ago)

I'm going through the thread now and this was the first thing I saw this morning, this sounds very interesting and newbie friendly, I'll definitely look at this if I can't get this linode issue fixed where I can't login because my password is incorrect

Edit: I had to make a server two more times on linode. I tried "Rescuing" to reset the password many time on these two with no luck. but the third time my password is letting me log in. But I'm still interested in your ngrok suggestion.