How to deploy a full-stack application like an e-commerce without paying a dollar
Anthony Miracho
Senior Golang Developer | Full Stack Developer | Golang Consultant | Website Developer
Hi everyone, today I am gonna show you how to deploy an application, without paying a dollar - well maybe for a domain(custom domain).
So what does a full stack application entail?
well for simple applications those will do!
For this course we gonna deploy a golang application, a nextjs website, reactjs content management system and we are going to use MongoDb for database
Let's get started...
1. Database.
For our database, we are going to use Mongo Atlas. create an account here -https://www.mongodb.com/cloud/atlas/register or better yet sign in with google.
create a cluster and set up your database configurations.
I will not go into details on how to set it up - this https://www.mongodb.com/docs/atlas/atlas-ui/databases/ will come in handy for that.
after successful setup. you will obtain a MongoDB URL(which will need to use for our Golang application)
2. Hosting our Golang application.
Hopefully, you have a running Golang application, and all you need is a database to have it up and running.
Anyways, with the URL we obtained above, use it with the env file to attach it to your Golang application.
As always test the application locally and check whether it is connecting to the db just fine!
领英推荐
I really hope it is working coz if not this will be a very long tutorial for you!
Now for those whose everything is sunshine and rainbows let's get to deploying our Golang application.
There are several platforms out there that offer cloud hosting of Golang applications, including https://fly.io/, https://render.com/ among others
I find Render, easy to set up and get started
I really want to stick to the important stuff, so this https://docs.render.com/deploy-go-gin will outline everything you need to know in order to host your application on render
The best part is, after succesiful deployment , you no need to worry about future deployments since render listens to github push nortification to update the application to the latest github commit.
3. Deploying your Nextjs and Reactjs CMS
I combined those two because they are all Reactjs and we will use the same platform - Vercel as the deployment platform
You will need to create an account with Vercel - It is good to use sign up with GitHub to link your GitHub account
you can import your GitHub repo and configure the right settings - https://vercel.com/docs/frameworks/nextjs will outline all the necessary steps to have your application up and running(the funny thing is that- if the application has no errors after building it up locally -- all you need is to create a project, import the repo and deploy and viola you application is up and running)
The configurations of setting up Nextjs are the same as deploying Reactjs App(CMS)
With that you have all pillars of your full stack deployed without paying a dollar
Good luck with your full-stack application deployments