Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Jumpstart Jamstack Development

You're reading from   Jumpstart Jamstack Development Build and deploy modern websites and web apps using Gatsby, Netlify, and Sanity

Arrow left icon
Product type Paperback
Published in May 2021
Publisher Packt
ISBN-13 9781800203495
Length 252 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Christopher Pecoraro Christopher Pecoraro
Author Profile Icon Christopher Pecoraro
Christopher Pecoraro
Vincenzo Gambino Vincenzo Gambino
Author Profile Icon Vincenzo Gambino
Vincenzo Gambino
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Chapter 1: History of the Jamstack 2. Chapter 2: Introduction to Sanity FREE CHAPTER 3. Chapter 3: Exploring Sanity Studio 4. Chapter 4: Sanity Configuration and Schemas 5. Chapter 5: Sanity's GROQ Language 6. Chapter 6: Sanity's GraphQL Playground 7. Chapter 7: Gatsby – An Introduction 8. Chapter 8: Gatsby and GraphQL 9. Chapter 9: Gatsby Source Plugins 10. Chapter 10: Building Gatsby Components 11. Chapter 11: APIs – Extending Gatsby 12. Chapter 12: APIs – Alexa Skills 13. Chapter 13: Tying It All Together 14. Chapter 14: Deployment Using Netlify and Azure 15. Chapter 15: Conclusion 16. Other Books You May Enjoy

Creating a project

After you have successfully created accounts on Sanity.io, GitHub, and Netlify, we can begin with the project creation, using the Sanity.io Blog with Gatsby starter project.

The Uniform Resource Locator (URL) for Sanity.io project creation is https://www.sanity.io/create.

Click on the Create project link, as shown in the following screenshot:

Figure 2.1 – Sanity create page

Figure 2.1 – Sanity create page

There are three steps to complete for creating our very first project, as follows:

  1. Log in to your Sanity.io account using one of the aforementioned methods, and add the Project title. Sanity needs this section to create a new Sanity project for you. We can set the Project title as <Your Name> hands-on Jamstack. The following screenshot shows an example of this:
    Figure 2.2 – Connect to Sanity.io

    Figure 2.2 – Connect to Sanity.io

    Sanity will create a repository for the project. Click the Sign In button to connect to your GitHub account and rename the repository as your-name-hands-on-Jamstack.

    Note

    You cannot have any spaces in the name.

    Optionally, you may set it as a private repository. On each git push to the remote repository, the website will be automatically redeployed, as illustrated in the following screenshot:

    Figure 2.3 – Connect to GitHub

    Figure 2.3 – Connect to GitHub

    Sanity will automatically deploy your application to Netlify and make it available to the web.

  2. Click the Connect button to connect to your Netlify account, and we are ready to go! You should see the following message:
    Figure 2.4 – Connect to Netlify

    Figure 2.4 – Connect to Netlify

  3. Now, press the Create project button, as illustrated in the following screenshot, and in a short amount of time the project will be set up:
Figure 2.5 – Create project

Figure 2.5 – Create project

Once the project is created, Sanity will deploy two web applications to Netlify.

The first web application is the frontend website driven by Gatsby that connects to the Sanity-hosted backend.

The URL structure format is as follows:

https://website-name.netlify.com

You can see that it takes the form of the project name plus the Netlify domain.

The other web application is Sanity Studio, where we can manage the content. The URL structure format is as follows:

https://website-name-studio.netlify.com

You can see that it takes the form of project name, a dash, the word studio, and then the Netlify domain.

Let's start exploring Sanity.

You have been reading a chapter from
Jumpstart Jamstack Development
Published in: May 2021
Publisher: Packt
ISBN-13: 9781800203495
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image