Take the Stress Out of Server Cost: An Incredibly Easy Method To Host Your Website for Free
We all love free stuff but usually, when it is free there is some kind of catch or it is just a crappy product but not this time. Yes, You will have your website and no need to pay for it. It sounds unbelievable, right? But with this stack and some tweaks to the deployment process, you can host your website for free like I did.
Note: you still need to buy your domain name, like I have codeboxer.com
My Journey from Github pages to serverless
Then, I thought about WordPress but I dropped it. Since I need a cost-friendly solution so, I choose a serverless approach (Pay per use). At first glance, it was looking hard to go with serverless because smaller dev community or not enough documentation.
What stack I used?
Actually this setup is enough to handle 1 million requests per month.
1. AWS Lambda: Backend or APIs
2. DynammoDB: NoSql Database
3. NextJs: To make a website more SEO friendly or server-side rendering.
4. ReactJs: For CMS Dashboard
5. Cloudfront: For Web Distribution or CDN.
6. Netify: DNS and CD / CI.
7. S3: Host files or images.
8. Figma: For designing and prototyping.
9. Zoho Mail: This is damn good on the free tier.
Actually, Learning to use AWS services is as big a task as learning a new language unless you really have someone to clear your doubts. One thing about AWS is that their documentation is actually sometimes worthless (I mean). They do not have proper illustrations and cases to explain. My way of learning AWS is going through multiple blogs on the topic.
What is AWS Lambda?
AWS Lambda allows to run code without managing servers. AWS Lambda can serve both static websites i.e. a landing page, or a website with a few pages as well as the API stuff like performing database requests, call third parties, uploaded files process, and more.
But there is a pitfall with lambda is “Difficult to Test & logging”. Because of distributed nature, serverless applications are hard to test.
So what next?
- More Security
If you’re a student who doesn’t have a lot of money or you don’t want to pay for hosting this is probably a really good solution for you so I encourage you to check Serverless Stack or Github Pages which is also an awesome service for static sites.