This JAMstack tutorial will show you how to create a JAMstack website with just clicks, no code and for $0. It will detail how to set up a JAMstack website step by step with 30+ screenshots and 2000+ words. It will involve using a git-based CMS service to edit your content easily. Let's get started.
Originally posted at Geshan.com.np
If JAMstack is something new for you have a look at my previous post detailing what is JAMstack and some of its technical aspects. For this tutorial following are the prerequisites:
- You must have a working email address (a no brainier, still good to be explicit).
- Knowledge of markdown would be beneficial.
- Knowledge of a static site generator like Hugo would help.
- Previous know-how of using any Content Management System (CMS) like Drupal or Wordpress would be great.
You will need to register for the 4 (or less) online services to get your JAMstack website up and running. The good news is all of them have a free plan so your website will have a recurring running cost of exactly $0, hurray!
- Github - To host the code, probably you already have a Github account :)
- Netlify - CDN to host the website, it will be fast as it will be static files mainly
- Forestry - Git-based Content Management System (CMS) service to edit the JAMStack website content, your content changes will reflect on the website in a couple of minutes. Still fast for a JAMstack website.
- Stackbit - Service to manage above 3 and glue all of them together to bring your JAMstack website to life.
Let's dive in now.
The first step is to register on Github, If you already have a Github account skip to Step 2. Github is the service that will host your JAMstack website code. You can do a lot of things on Github and it is the de-facto service of open-source software and general code collaboration.
Go to https://github.com/join and fill the details like below and yes complete the puzzle to prove that you are a human :) :
Then click "Create account"
After that scroll to the next page and click "Complete Setup"
If you want to choose other options, it is up to you but nothing is mandatory.
One more step is to verify your email, you will get an email for Github about registration with a title like
[GitHub] Please verify your email address. open that email and click "Verify email address" to verify your email.
I promise you this is the only time you will need to verify your email, all other accounts have Github sign up Yay!
After your email is verified you will see the blue notification on top of the page as below:
Just as a quick check, have a look at your Github profile.
Carry on to register on Netlify.
Netlify will host your JAMstack website on its own Content Delivery Network (CDN), they have a free plan. So let's get a Netlify account too.
Head on to the Netlify registration page and click "Github":
After you click the "Github" icon it will ask you to "Authorize netlify" on Github, so click the "Authorize netlify" button on the pop-up window.
Great! You have a Netlify account now.
Leave the tab as it is or close it, Let get a new tab to register on Forestry.io.
Forestry is a git-based online Content Management System (CMS) service that makes editing content on your JAMStack website a breeze. Head on to Forestry Sign Up page.
Here too just click the "Github" logo to carry on with the registration.
Similar to Netlify, click the green button to "Authorize forestryio", in the pop-up to complete the sign-up process.
Success! Your Forestry account is registered, let's go to the next step.
Stackbit is the magic glue that will cement all the other 3 services together to inject life to your JAMStack website. Let's go ahead and get an account for Stackbit on its Login page.
Click the "I agree to the terms and license" checkbox and then click on the "Github" logo. It will start the process to link up Stackbit with Github.
Similar to Forestry.io, click the "Authorize Stackbit App by Stackbit" green button to register on Stackbit with Github.
Great! The last registration is done too. Now we can build your website, woohoo!
To build your project on Stackbit from the dashboard click "Build Your Project" as seen above to choose the theme:
Click "Fresh" as your theme, it is a blog theme. If you want you can choose another theme as well, "Azimuth" is good for SAAS products. Let's go with Fresh for now, then click "Continue to site generation".
After that, click "Hugo", we are selecting Hugo as it claims to be the "fastest" static site generator.
Next step is to choose the CMS, let's choose Forestry you have an account there already :)
Then it is time to name the project and connect your accounts, I have named it
jamstack-fresh, name it as you want.
For all the things to function correctly, you will need to connect Forestry and Github with Stackbit. Click the connect button beside Forestry to connect Forestry with Stackbit.
On the pop-up click the green "Authorize" to link up Stackbit and Forestry.
After it is authorized correctly it will show the "Connected" checkbox on the page, as below:
Similar to Forestry, click the "Connect" button beside "Github" and click the green "Install" button to add Stackbit to your Github account.
Great! now as both services are connected it is time to click "Create your project" as below:
We are getting close the, your website should be building at this point like below:
After a couple of minutes, it should be deployed, it will show up as below:
Now it is time to Claim your Netlify URL, Click the "Claim" button to do so.
Great! now your URL has been claimed on Netlify too.
Hurray! Let's see your website live, click the "View Site" blue button, your site should open on a new tab and look like below:
Good news, your website is up on a URL like https://jamstack-fresh-a9bfb.netlify.app/. Now you have to edit it to make it yours. Let's change the homepage text to say something different. For that click the "Edit in Forestry" blue button, you will be taken to the forestry dashboard.
Click on the "Home" link on the sidebar.
Then click on "Hero Section"
Now edit the Title to something like "Welcome to JAMStack test" and the content to something like below.
After that click on the "Save" at the top right and then go to the tab with your website open, it should start deploying now.
As you might have figured out by now, there will be some mapping to do. Generally, it is easy to find the element you need to edit to get your desired result.
The website will say "Publishing Site" like below:
After like a minute it will say "Rebuild Successful" now its time to click "Refresh" or refresh the browser.
After you refresh you should see your changes, yes it is that easy to edit content.
Please check out the "Media" menu on the sidebar below the "Site" title and play around upload images. Add the images to your content. It is pretty easy.
Here are some of the further steps you can take to enhance your new web presence:
- Please read through the Forestry Product Tour to know other things like adding an image from the media library and doing other changes. You will need to fiddle around with Forestry. It would be great to check the Forestry documentation for Managing Content and Media Library, it is easy.
- You can get a free top-level domain like a .tk, .ml, .cf or .gq for free. So you can have mywebsite.gq free from Freenom. If you want a .com try another domain registrar like NameCheap.
- You can then configure Custom Domain in netlify to get it working on the domain name you registered.
- If you are serious about your website or blog try to optimize it better for SEO, for this you will need some coding and help from someone who knows Go lang and has worked with Hugo.
- If you want to move out from medium to your JAMstack website you can try Stackbit medium import.
There are some caveats you should consider for this free website, they are as follows:
- Be mindful of the build minutes, Netlify free plan has 300 build minutes per month. That means each time you hit save or add a new image from Forestry it will trigger a build and deploy on Netlify.
Each build will take around a minute or more and this reduces your build time quota of 300 minutes every month. So, it is advisable to bulk your changes, mainly the text ones and be careful and use the "Save" button sparingly.
- Even though setting up the website is just clicks, I think this website will be a good one for a proof of concept or staging. If you want a great production-ready performance-tuned website there will be some coding changes required.
Now you have a fully functional website in under 15 mins, there was no coding involved and you didn't even have to take your credit card out.
This is just scratching the surface, now you can show your running website to people but do remember to optimize it well before going live.