To Jamstack Or Not?
The main content about To Jamstack Or Not?
What is Jamstack?
Why use a Jamstack to develop websites?
- Faster Performance: Build your files only on deployment and serve them over a CDN.
- Cheap and Fast Deployment: Jamstack websites can easily be deployed without going through the hassle of configuring databases, securing .htaccess and so on. We are only dealing with static files so it is easy to integrate a fast CDN to get up and running.
- Less expensive Hosting of static files are cheap or even free.
- High-Security: Static Websites have a very low potential for vulnerabilities because it is just HTML files. This reduces any possible risk or attack on the website.
- Great Community: The JAMstack community is growing over time. New support for various functionality springs up every day
What’s the process?
After a bit of research, I decided that Gridsome would be my framework of choice. The reasons being:-
- It’s based on Vue.js, which is well established.
- It has great documentation.
- It has a large support community, including a great Discord channel.
- It has several plugins and templates, great for that first venture.
Once the decision was made it was then a simple case of using yarn(or NPM) to install Gridsome globally
Gridsome will require that you have Node.js installed.
Using YARN:yarn global add @gridsome/cli
Using NPM:npm install --global @gridsome/cli
Then spin up a project
gridsome create my-gridsome-site to create a new project
cd my-gridsome-site to move into project directory
gridsome develop to start local dev server at http://localhost:8080
This will get you started on developing your website, building it locally first of course.
For simple information type websites, it very quick to develop a site, Gridsome takes care of image processing and via plugins favicons, sitemaps and robots.txt files can all be generated.
Once you are happy with your website it’s then a case of again using yarn(or NPM) to build your static code.
This will create a /dist folder which will contain your websites static files that you can upload to your hosting server of choice, this will give you a website that super fast and secure.
One thing to note is that if you have any form processing to complete on your new website this will have to be done by a third party, I use form-data as they have a free pricing plan which will cover the needs of most of my clients and the setup is very painless, great if you are a developer.
With Jamstack web applications so easy to produce and host, in most cases, there really is no reason not to take the plunge and of course, learn something new along the way.
Have fun :-)Journal Index