<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gemma Vincent</title>
    <description>The latest articles on DEV Community by Gemma Vincent (@lilgemvincent).</description>
    <link>https://dev.to/lilgemvincent</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F380863%2F7c96dc77-b80b-4ef9-b1ec-3646aec37905.png</url>
      <title>DEV Community: Gemma Vincent</title>
      <link>https://dev.to/lilgemvincent</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lilgemvincent"/>
    <language>en</language>
    <item>
      <title>Building a JAMstack shop with Strapi 4, Nuxt 3, Snipcart - part 1</title>
      <dc:creator>Gemma Vincent</dc:creator>
      <pubDate>Wed, 01 Dec 2021 12:37:44 +0000</pubDate>
      <link>https://dev.to/lilgemvincent/building-a-jamstack-shop-with-strapi-4-nuxt-3-snipcart-part-1-595e</link>
      <guid>https://dev.to/lilgemvincent/building-a-jamstack-shop-with-strapi-4-nuxt-3-snipcart-part-1-595e</guid>
      <description>&lt;p&gt;Here's a link to the shop that we've built, if you follow this series of blog posts this is what you'll also end up with &lt;a href="https://pick-a-sick-wick.pixelhop.io/" rel="noopener noreferrer"&gt;Pick a Sick Wick&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We've done our own designs for this little demo and they can be found &lt;a href="https://www.figma.com/file/mys8jJI7kb1gVhR43FqBWp/Pick-a-sick-wick?node-id=0%3A1" rel="noopener noreferrer"&gt;here&lt;/a&gt;, so as we take you through how to build this out, I will follow a design that we've done for this series.&lt;/p&gt;

&lt;p&gt;Watch the video or follow along below.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/AZZ6M1YXWlk"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;If you are the kind of person that likes to dive straight into code, we have created example repositories for both the Nuxt and Strapi parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Strapi 4 👉 &lt;a href="https://github.com/pixelhop/pick-a-sick-wick-frontend" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://github.com/pixelhop/pick-a-sick-wick-frontend" rel="noopener noreferrer"&gt;https://github.com/pixelhop/pick-a-sick-wick-frontend&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Nuxt 3 👉 &lt;a href="https://github.com/pixelhop/pick-a-sick-wick-backend/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://github.com/pixelhop/pick-a-sick-wick-backend/" rel="noopener noreferrer"&gt;https://github.com/pixelhop/pick-a-sick-wick-backend/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I can't tell you how excited we've been, waiting in anticipation for Nuxt 3  and Strapi 4 to come out, and now they're here, and we're ready to get our hands dirty and start using them straight away. I've always wanted to build an online candle shop, so I thought now's the time, and I can show you how to do it too, so let us go and Pick a Sick Wick.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project setup with Strapi and Nuxt
&lt;/h2&gt;

&lt;p&gt;If you're the sort of person that likes to get straight into the code, then look no further; you can find the repos:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The front-end is using Nuxt 3, and the repo is here&lt;/li&gt;
&lt;li&gt;The backend is using Strapi, and the repo can be found here&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feel free to pull it down and dig in.&lt;/p&gt;

&lt;p&gt;Here's a step by step guide on how to build your own shop, so let's stop waffling and let's get building.&lt;/p&gt;

&lt;p&gt;Just to give you a little heads up, our folder structure is going to look something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fab9bd5axopwnovcarelg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fab9bd5axopwnovcarelg.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's just create our folder and go into it, open up your terminal and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;take pick-a-wick
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Strapi 4
&lt;/h2&gt;

&lt;p&gt;Now we're going to get Strapi 4 setup to create the data ready to be pulled through the Nuxt 3 front-end.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-strapi-app@beta backend &lt;span class="nt"&gt;--quickstart&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let the terminal do the hard work for you, sit back have a sip of coffee and a biscuit. Once it's finished, a new tab will open in your browser here: &lt;a href="http://localhost:1337/admin" rel="noopener noreferrer"&gt;http://localhost:1337/admin&lt;/a&gt;. You now just need to create your account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc5g54cfyt3u40rs6cvvn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc5g54cfyt3u40rs6cvvn.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Tada! How easy was that?! Here's your Strapi Dashboard; if you're used to using Strapi 3, you'll see some differences here; if you ask me (and I know you're not, but here's my opinion anyway 🙈), I think it looks a lot cleaner, lighter and nicer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2jnlrocxibpuotw34oh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2jnlrocxibpuotw34oh.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's jump in and start creating the architecture of the products by creating a collection type.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F83h551kffsmt0srm2ij9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F83h551kffsmt0srm2ij9.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create the collection type like so:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2kc8477ztkj7f16wbvl9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2kc8477ztkj7f16wbvl9.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: I should have probably called this '&lt;code&gt;Products&lt;/code&gt;'.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Then add in the fields you require; for now, we'll add in these fields :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Title&lt;/strong&gt; - Text field&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Description&lt;/strong&gt; &lt;strong&gt;-&lt;/strong&gt; Text field&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image -&lt;/strong&gt; Media field&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prices -&lt;/strong&gt; Number field&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6a0vcuwd2ag3p7rtvovg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6a0vcuwd2ag3p7rtvovg.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that you've added in your fields, make sure you save the collection. Your fields should look something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg6u43gn56lqfz5vbct8w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg6u43gn56lqfz5vbct8w.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click the button in the top left and go to &lt;code&gt;Content Manager&lt;/code&gt; &amp;gt; &lt;code&gt;Products&lt;/code&gt; and, let's add in some new entries; for me, I'm going to be adding in some candles.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fks1xi2q5e0eu7mouo4kf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fks1xi2q5e0eu7mouo4kf.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;code&gt;Add new entry&lt;/code&gt; and fill out all the data; once you're done, click &lt;code&gt;Save&lt;/code&gt; and &lt;code&gt;Publish&lt;/code&gt; and add in a couple more. We have added in some silly joke names because we thought it was funny haha. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgv15qis2yuxtziqi54wf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgv15qis2yuxtziqi54wf.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wahoooo, now you should have a list of products 🕯🛍 !!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6f797sgeg6ilepq87rge.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6f797sgeg6ilepq87rge.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, all we need to do is make the product content public to fetch it from the front-end. To do this go to &lt;code&gt;General&lt;/code&gt; &amp;gt; &lt;code&gt;Settings&lt;/code&gt; &amp;gt; &lt;code&gt;Users &amp;amp; Permission Plugin&lt;/code&gt; &amp;gt; &lt;code&gt;Roles&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0tytt57w85ytlm3by44r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0tytt57w85ytlm3by44r.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;code&gt;Public&lt;/code&gt; and open out the Product accordion and check to &lt;code&gt;find&lt;/code&gt; and &lt;code&gt;findone&lt;/code&gt;; finally, just save it, and your products data should now be public.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcahwco7aqhutn7uip0r3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcahwco7aqhutn7uip0r3.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You should now be able to go &lt;a href="http://localhost:1337/api/products" rel="noopener noreferrer"&gt;http://localhost:1337/api/products&lt;/a&gt; and see a JSON blob with all your products in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nuxt 3
&lt;/h2&gt;

&lt;p&gt;Wahoooo, now you're backend is all set up and ready to party; let's move on to the front-end and set up Nuxt 3. Open up terminal and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;// pick-a-wick is the name of the directory the Nuxt installation will save into
npx nuxi init frontend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now just head into that directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;frontend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install all of the dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're anything like us, we use &lt;a href="https://tailwindcss.com/" rel="noopener noreferrer"&gt;Taliwind&lt;/a&gt; on every project; if you don't want to, you can just skip the next 2 steps.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-D&lt;/span&gt; tailwindcss@latest postcss@latest autoprefixer@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generate the Tailwind and Postcss config files&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx tailwindcss init &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Time to open up your code in your chosen editor; for me, it's VSCode; just do that from the command line, like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;code &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will need to add some config to your &lt;code&gt;nuxt.config.ts&lt;/code&gt; file, lets also add in the Google fonts whilst we are here. The ones we're using are &lt;a href="https://fonts.google.com/specimen/Playfair+Display" rel="noopener noreferrer"&gt;Playfair Display&lt;/a&gt; and &lt;a href="https://fonts.google.com/specimen/Source+Sans+Pro" rel="noopener noreferrer"&gt;Source Sans Pro&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Your code config file should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;defineNuxtConfig&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;nuxt3&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nf"&gt;defineNuxtConfig&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="c1"&gt;// Add entry css file&lt;/span&gt;
  &lt;span class="na"&gt;css&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tailwindcss/tailwind.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;postcss&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// add Postcss options&lt;/span&gt;
      &lt;span class="na"&gt;postcssOptions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./postcss.config.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;link&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;rel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;preconnect&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://fonts.googleapis.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;rel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;preconnect&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://fonts.gstatic.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;href&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;800;900&amp;amp;family=Source+Sans+Pro:wght@300;400;600;700;900&amp;amp;display=swap&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;rel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;stylesheet&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, let's get it up and running; go to your terminal and type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Note: make sure your node version is  &amp;gt; 14&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Wahoooo!! How easy was that!? Your Nuxt site should now be up and running, if you've nothing else running, it will probably be on port 3000, and the URL will be &lt;a href="http://localhost:3000/" rel="noopener noreferrer"&gt;http://localhost:3000/&lt;/a&gt;. Open it up and go check it out. You should have something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjjicmtzylf4gag3mf2ay.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjjicmtzylf4gag3mf2ay.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To check you've got Tailwind up and running okay, you can head back over to the code base and into the &lt;code&gt;app.vue&lt;/code&gt; file and add a Tailwind class around&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-red-500 bg-green-200"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;This is a title&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the front-end you should see something beautiful like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbqwwfta7nu0pij9tldsu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbqwwfta7nu0pij9tldsu.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We've done some designs for this project, so I'll be following them whilst going through this tutorial.&lt;br&gt;
Before we go on let's add in some default colours and fonts into &lt;code&gt;tailwind.config.js&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;purge&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./components/**/*.{vue,js}&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./layouts/**/*.vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./pages/**/*.vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./plugins/**/*.{js,ts}&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./nuxt.config.{js,ts}&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./app.vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jit&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;darkMode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// or 'media' or 'class'&lt;/span&gt;
  &lt;span class="na"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;brand-grey&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#828282&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;DEFAULT&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#898989&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#B5B5B5&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#5E5E5E&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="mi"&gt;800&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#383838&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;brand-beige&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#E5E5E5&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#E3D9CD&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#EAE5E0&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;DEFAULT&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#E9BA9E&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;brand-brown-500&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#4E3924&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;brand-orange&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#FF6721&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
      &lt;span class="na"&gt;fontFamily&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;heading&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Playfair Display&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;serif&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;body&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Source Sans Pro&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;

  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;variants&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@tailwindcss/aspect-ratio&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Right, we're making headway now; if you're still with me, thank you, I'm pleased I've not bored you too much so far, hehe, and if you're not, I totally understand.&lt;br&gt;
Time to get the products from Strapi coming out in the front-end. Buckle up this is going to be fun.&lt;br&gt;
In the root folder, create a new directory called &lt;code&gt;pages&lt;/code&gt; within that create a page called &lt;code&gt;index.vue&lt;/code&gt;. This is going to be the new homepage. We're going to tidy it up and split everything into its own components in the blog post, but for the time being, we just want to try and get the data back from Strapi.&lt;br&gt;
First we want to fetch all the data , then we want to loop over all the products and put the data out onto the homepage using Nuxt 3, this is really easy to do and the code is fetch the data is only 1 line, sexy if you ask me. useFetch is a global helper function provided by Nuxt 3 that will load the data for the page server side, or during static generation of the page.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;script setup&amp;gt;&lt;/code&gt; allows you to use the more streamline syntax to create your Vue components (e.g. you don't have to register components or create data objects).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;v-for=&lt;/span&gt;&lt;span class="s"&gt;"product in products.data"&lt;/span&gt; &lt;span class="na"&gt;:key=&lt;/span&gt;&lt;span class="s"&gt;"product.id"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;nuxt-link&lt;/span&gt; &lt;span class="na"&gt;:to=&lt;/span&gt;&lt;span class="s"&gt;"`/products/${product.id}`"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"font-bold"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;{{ product.attributes.Title }}&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
        {{ product.attributes.Description }}
      &lt;span class="nt"&gt;&amp;lt;/nuxt-link&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;setup&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;products&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;useFetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;http://localhost:1337/api/products&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To get the index page showing we just need to edit our &lt;code&gt;app.vue&lt;/code&gt; file to look like this. This is the route file that kicks everything off. Nuxt page is a component that is added by Nuxt and provides a location for your Nuxt pages to appear.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;NuxtPage/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you check your browser you should have the title and description of your products wooooo 🎉&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa7cog87d9hbl60ac6hyh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa7cog87d9hbl60ac6hyh.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Wooo! Fingers crossed that's all working for you but if you have any questions feel free to get in touch and ask any more questions via our &lt;a href="https://www.pixelhop.io/contact/" rel="noopener noreferrer"&gt;website&lt;/a&gt; or &lt;a href="https://twitter.com/pixelhopio" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;. There's going to be a few more blog posts in this series, so feel free to &lt;a href="https://www.getrevue.co/profile/pixelhop?via=twitter-profile-webview" rel="noopener noreferrer"&gt;subscribe to our newsletter&lt;/a&gt; to find when they've been released.&lt;/p&gt;

&lt;p&gt;Thank you for reading and next we will be building out the design, and all of the components etc. Once we've got it working we will then integrate Snipcart. And it won't be too long until you can have your own shop.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Creating an internationalised site with Strapi and Nuxt</title>
      <dc:creator>Gemma Vincent</dc:creator>
      <pubDate>Mon, 17 May 2021 08:13:26 +0000</pubDate>
      <link>https://dev.to/lilgemvincent/creating-an-internationalised-site-with-strapi-and-nuxt-3lbj</link>
      <guid>https://dev.to/lilgemvincent/creating-an-internationalised-site-with-strapi-and-nuxt-3lbj</guid>
      <description>&lt;p&gt;&lt;em&gt;This post was first published on our site, you can subscribe for more posts like this here: &lt;a href="https://www.pixelhop.io/writing/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://www.pixelhop.io/writing/" rel="noopener noreferrer"&gt;https://www.pixelhop.io/writing/&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We were really excited when Strapi released a new update a few weeks ago that included internationalisation! This post will show you the basics of creating an internationalised site using Strapi and Nuxt.&lt;/p&gt;

&lt;p&gt;Watch the video or follow along below.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/AZZ6M1YXWlk"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;If you are the kind of person that likes to dive straight into code, we have created example repositories for both the Nuxt and Strapi parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Strapi 👉 &lt;a href="https://github.com/pixelhop/strapi-i18n" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://github.com/pixelhop/strapi-i18n" rel="noopener noreferrer"&gt;https://github.com/pixelhop/strapi-i18n&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Nuxt 👉 &lt;a href="https://github.com/pixelhop/nuxt-i18n" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://github.com/pixelhop/nuxt-i18n" rel="noopener noreferrer"&gt;https://github.com/pixelhop/nuxt-i18n&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setting up Strapi
&lt;/h2&gt;

&lt;p&gt;First things first, let's set up our &lt;a href="https://strapi.io/" rel="noopener noreferrer"&gt;Strapi CMS&lt;/a&gt;. Create a folder to hold this project, and then let's create a new Strapi project using your terminal and the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-strapi-app strapi &lt;span class="nt"&gt;--quickstart&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After npm is finished installing your new Strapi instance, it will start the Strapi dev server and ask you to create an admin login. Go ahead and make your user, and voilà you've got a brand spanking shiny new headless CMS at your disposal. &lt;em&gt;"Now we're sucking on diesel"&lt;/em&gt;*&lt;/p&gt;

&lt;p&gt;*We have been watching far too much Line of Duty.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding some content
&lt;/h3&gt;

&lt;p&gt;What's the point of a CMS if you've got no content? For the purpose of this demo, we are going to create a basic content type.&lt;/p&gt;

&lt;p&gt;Head to the Content Types Builder in the Strapi admin: &lt;a href="http://localhost:1337/admin/plugins/content-type-builder/content-types/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="http://localhost:1337/admin/plugins/content-type-builder/content-types/" rel="noopener noreferrer"&gt;http://localhost:1337/admin/plugins/content-type-builder/content-types/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once there, let's create a new single type by clicking the "+ Create new single type" link in the left sidebar. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faox8usffi4p33vtf4jcu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faox8usffi4p33vtf4jcu.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's give our content type a name of "Home", and before clicking "Continue", navigate to the "Advanced settings" tab. Once there, make sure to check the "Enable localisation for the Content-Type" checkbox. You need to do this for any content type you would like to be localised. Once you have done that, it's safe to click "Continue".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1uubfdzn78md8f4fhac4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1uubfdzn78md8f4fhac4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding fields
&lt;/h3&gt;

&lt;p&gt;A content type can't hold any content if it doesn't add any fields, so the next step is to add some. We are going to keep it super simple and will add three fields.&lt;br&gt;
Create a text field called "Title":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl2z8evz26t2ns8z3xuvk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl2z8evz26t2ns8z3xuvk.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click "+ Add another field". Then add a rich text field called "Body":&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fus6ajtth65r2gc7q9ql5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fus6ajtth65r2gc7q9ql5.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click "+ Add another field", and finally let's add media field called "Image" and set its' type to "Single media" so we only need to upload one image.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fetzvqwbeakelcaaqgejl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fetzvqwbeakelcaaqgejl.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, go to the "Advanced settings" tab.&lt;/p&gt;

&lt;p&gt;Frequently when creating a localised site, you won't want all fields to be localised. By default, you will have to re-enter content for each field in the new language when you switch between locales.&lt;/p&gt;

&lt;p&gt;In our case, we want the Image field to keep the same image across all languages.&lt;br&gt;
&lt;strong&gt;Uncheck the "Enabled for localisation" checkbox.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwswbt6mtpl6w1h2owdp0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwswbt6mtpl6w1h2owdp0.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we can click "Finish" to create our fields. Take a second to give yourself a pat on the back; you're one step closer to localisation euphoria.&lt;/p&gt;
&lt;h3&gt;
  
  
  Adding your locales
&lt;/h3&gt;

&lt;p&gt;Next up, we need to add your desired locales in Strapi. The locales are basically the different languages you want your site to support.&lt;/p&gt;

&lt;p&gt;You can get to the locale settings by going to Settings &amp;gt; Internationalisation: &lt;a href="http://localhost:1337/admin/settings/internationalization" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="http://localhost:1337/admin/settings/internationalization" rel="noopener noreferrer"&gt;http://localhost:1337/admin/settings/internationalization&lt;/a&gt; in the Strapi admin.&lt;/p&gt;

&lt;p&gt;Once you are there, you should see that you already have one locale, English. You can add another one by clicking the "Add locale" button in the top right.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgtqhxcq2kg8oggjqpn5r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgtqhxcq2kg8oggjqpn5r.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose your desired language in the modal that appears and click the "Add locale" button. Just like that, your CMS is now multilingual! Add as many languages as you need.&lt;/p&gt;
&lt;h3&gt;
  
  
  Set content type permissions
&lt;/h3&gt;

&lt;p&gt;We are going to need Nuxt to be able to access our Stapi API to pull in content. By default, Strapi makes any new content type private, so we will need to change that.&lt;/p&gt;

&lt;p&gt;Go to Settings, and under the "Users &amp;amp; Permissions Plugin" heading, click "Roles".&lt;/p&gt;

&lt;p&gt;Click on the "Public" role, scroll down to the permissions and tick the "find" checkbox under "Home"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxp7rs1oheeldppth2kv9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxp7rs1oheeldppth2kv9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Save your changes. This will make the GET [&lt;a href="http://localhost:1337/home" rel="noopener noreferrer"&gt;http://localhost:1337/home&lt;/a&gt;](&lt;a href="http://localhost:1337/home" rel="noopener noreferrer"&gt;http://localhost:1337/home&lt;/a&gt;) endpoint publicly accessible.&lt;/p&gt;
&lt;h3&gt;
  
  
  Add some content
&lt;/h3&gt;

&lt;p&gt;We are done setting up Strapi, and now it's time to add some content. Click "Home" under the "Single Types" section of the admin sidebar and enter content for your default locale.&lt;/p&gt;

&lt;p&gt;Once you are happy you have created a masterpiece, save and publish it.&lt;/p&gt;

&lt;p&gt;Now it's time to get out your foreign language dictionary and enter content for your second locale. To change the current locale, use the dropdown switch found in the right sidebar. We fancied French next.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxk39ijk3cd6eb7hn44rd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxk39ijk3cd6eb7hn44rd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Make sure to save and publish again. Each locale gets published separately. Repeat for all your locales. Hopefully, none of you decided to add the world's 6500+ languages; otherwise, it might take you longer than expected to finish this tutorial!&lt;/p&gt;
&lt;h2&gt;
  
  
  Next up is Nuxt
&lt;/h2&gt;

&lt;p&gt;Your time as a content editor has come to an end, and now you need to get into your favourite hacker pose and start coding.&lt;/p&gt;

&lt;p&gt;First up is creating a new Nuxt site. In a new folder, use the terminal to run the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx create-nuxt-app nuxt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer the questions via the CLI. In our case, we choose the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Language: &lt;strong&gt;JavaScript&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Package manager: &lt;strong&gt;NPM&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;UI framework: &lt;strong&gt;TailwindCSS&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Linter: &lt;strong&gt;ESLint&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Rendering mode: &lt;strong&gt;Singe Page App&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Deployment target: &lt;strong&gt;Static&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once that has done, cd into the new nuxt folder and start the dev server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your Nuxt site should now be running at &lt;a href="http://localhost:3000/" rel="noopener noreferrer"&gt;http://localhost:3000/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Install Nuxt Strapi and i18n
&lt;/h3&gt;

&lt;p&gt;Next, we need to install a few Nuxt modules. The Nuxt Strapi module will allow us to easily communicate with our Strapi API, and the Nuxt i18n module will enable us to add localisation.&lt;/p&gt;

&lt;p&gt;Install both the modules:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm i nuxt-i18n @nuxtjs/strapi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once that is done, we need to add both modules to nuxt.config.js and configure them with options. First, let's register the modules.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// nuxt.config.js&lt;/span&gt;
&lt;span class="c1"&gt;// Modules: https://go.nuxtjs.dev/config-modules&lt;/span&gt;
&lt;span class="nx"&gt;modules&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@nuxtjs/strapi&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;nuxt-i18n&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;],&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we can configure the i18n module. Add the following to your &lt;code&gt;nuxt.config.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;i18n&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;locales&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;en&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fr&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;de&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="nx"&gt;defaultLocale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;en&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above tells the i18n plugin that we will have three locales English, French and German. &lt;/p&gt;

&lt;p&gt;Feel free to adjust those to whichever languages you set up earlier in Strapi. &lt;strong&gt;It's important to note the locale codes you use should match the ones used when setting up locales in Strapi.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can also set the sites default locale.&lt;/p&gt;

&lt;p&gt;Now we can move on to configuring the Strapi module. Add the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;strapi&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;entities&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;home&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;single&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells the module that we have a content type called "home" and it's a  single. This will allow us to retrieve it easily later.&lt;/p&gt;

&lt;h3&gt;
  
  
  Loading localised content from Strapi into Nuxt
&lt;/h3&gt;

&lt;p&gt;Now it's time to load content from Strapi into Nuxt. In pages/index.vue replace the script section with the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;asyncData &lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;$strapi&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;i18n&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;home&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;$strapi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$home&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;_locale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;i18n&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;locale&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;home&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To load in the data, we can use the asyncData hook that will be run at build time. The Nuxt i18n plugin adds the i18n object to the context object that is passed into the function. This allows us to get the current locale with i18n.locale.&lt;/p&gt;

&lt;p&gt;The Nuxt Strapi plugin also injects itself into the asyncData context, so we can then make a request to our API to get the home content. The import part here is how we filter the request by locale to retrieve the correct language:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;home&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;$strapi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$home&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;_locale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;i18n&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;locale&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All being well, the home content should now be available in your page component. Let's add it to the template. Replace the &lt;code&gt;pages/index.vue&lt;/code&gt; template with the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt; &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container flex flex-col items-center"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"flex flex-col items-center"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"mb-4 text-pink-700 font-bold"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        {{ home.Title }}
      &lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"mb-4 text-green-700"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        {{ home.Body }}
      &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
            &lt;span class="c"&gt;&amp;lt;!-- Usually you should store the Strapi host in an env var --&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;:src=&lt;/span&gt;&lt;span class="s"&gt;"`http://localhost:1337${home.Image.url}`"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"w-1/4 mb-6"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Featured Image"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There should be nothing that surprises you here; we just use standard Vue.js templating to output our page title, body and bind the image URL to the image src.&lt;/p&gt;

&lt;p&gt;Hopefully, by this point, you can see the content you added appearing on your page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvgboqhun85uk8309rhpw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvgboqhun85uk8309rhpw.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;nav&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt;
        &lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;locale in availableLocales&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;locale&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;py-4 px-4 text-xl font-bold&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;nuxt&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;link&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;switchLocalePath(locale)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="nx"&gt;locale&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/nuxt-link&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/nav&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/template&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;computed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;availableLocales &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$i18n&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;locales&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$i18n&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ok, let's break down what's happening here.&lt;br&gt;
First, we get a list of the available locales in a computed function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="nx"&gt;computed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;availableLocales &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$i18n&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;locales&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$i18n&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next we loop over these in our template using a v-for and we add a nuxt-link to allow us to switch between each site. The switchLocalePath function is added by the Nuxt i18n module returns the current routes localised variants. &lt;/p&gt;

&lt;p&gt;For example, we were on a page "/about" and we called the function like this switchLocalePath('fr') it would return "/fr/about".&lt;/p&gt;

&lt;p&gt;See here:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;li&lt;/span&gt;
    &lt;span class="na"&gt;v-for=&lt;/span&gt;&lt;span class="s"&gt;"locale in availableLocales"&lt;/span&gt;
    &lt;span class="na"&gt;:key=&lt;/span&gt;&lt;span class="s"&gt;"locale"&lt;/span&gt;
    &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"py-4 px-4 text-xl font-bold"&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;nuxt-link&lt;/span&gt; &lt;span class="na"&gt;:to=&lt;/span&gt;&lt;span class="s"&gt;"switchLocalePath(locale)"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        {{ locale }}
    &lt;span class="nt"&gt;&amp;lt;/nuxt-link&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that's the locale switcher finished.&lt;/p&gt;

&lt;p&gt;Now let's add it in to our page component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;container flex flex-col items-center&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex flex-col items-center&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mb-4 text-pink-700 font-bold&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="nx"&gt;home&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Title&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mb-4 text-green-700&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;{{&lt;/span&gt; &lt;span class="nx"&gt;home&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Body&lt;/span&gt; &lt;span class="p"&gt;}}&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;img&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;`http://localhost:1337${home.Image.url}`&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;w-1/4 mb-6&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;alt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Featured Image&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;LocaleSwitcher&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/template&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;LocaleSwitcher&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;~/components/LocaleSwitcher.vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;LocaleSwitcher&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;asyncData &lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;$strapi&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;i18n&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;home&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;$strapi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$home&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;_locale&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;i18n&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;locale&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;home&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You now have an easy way to switch between your locales!&lt;/p&gt;

&lt;h2&gt;
  
  
  That's a wrap
&lt;/h2&gt;

&lt;p&gt;And that's it. You should now have a fantastic internationalised site powered by Strapi and Nuxt. We have only touched on the basics, but hopefully, it gives you a good idea of what's involved in building this sort of site.&lt;/p&gt;

&lt;p&gt;We are super impressed with how easy the Strapi and Nuxt teams have made this, so big props to them!&lt;/p&gt;

&lt;p&gt;As always, if you have any questions or like this post, let us know on Twitter: &lt;a href="https://twitter.com/pixelhopio" rel="noopener noreferrer"&gt;@pixelhopio&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you would like to see more posts like this then subscribe to our site, we promise we won't spam you! You can sign up here &lt;a href="https://www.pixelhop.io/writing/" rel="noopener noreferrer"&gt;&lt;/a&gt;&lt;a href="https://www.pixelhop.io/writing/" rel="noopener noreferrer"&gt;https://www.pixelhop.io/writing/&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>vue</category>
      <category>nuxt</category>
      <category>strapi</category>
      <category>i18n</category>
    </item>
    <item>
      <title>Be the Forest kickoff</title>
      <dc:creator>Gemma Vincent</dc:creator>
      <pubDate>Sun, 10 May 2020 10:03:18 +0000</pubDate>
      <link>https://dev.to/lilgemvincent/be-the-forest-kickoff-2lbg</link>
      <guid>https://dev.to/lilgemvincent/be-the-forest-kickoff-2lbg</guid>
      <description>&lt;h2&gt;
  
  
  🌳 An API that plants trees
&lt;/h2&gt;

&lt;p&gt;Today we are excited to kick off the first of our 7 side projects in 28 weeks. We talk about that here:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;a href="/lilgemvincent" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RqFIooVH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--ig19YaBB--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/380863/7c96dc77-b80b-4ef9-b1ec-3646aec37905.png" alt="lilgemvincent image"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/lilgemvincent/master-plan-7-projects-28-weeks-43dn" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Master Plan - 7 Projects / 28 Weeks&lt;/h2&gt;
      &lt;h3&gt;Gemma Vincent ・ May  6 ・ 3 min read&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#sideprojects&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#productivity&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#startup&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://betheforest.org/"&gt;Be the Forest&lt;/a&gt;, an API that plants trees! Inspired by sites like &lt;a href="https://www.ecosia.org/"&gt;Ecosia&lt;/a&gt; (the search engine that plants trees) we thought it would be great to give developers a simple way to build similar experiences and add carbon offsetting to their digital products or services.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Got an online store? You could add the option to offset carbon emissions as part of your checkout.&lt;/li&gt;
&lt;li&gt;Making a game? Plant a real tree for every tree digital someone plants in the game.&lt;/li&gt;
&lt;li&gt;Teaching your children to save? Hack together a digital money bank that automatically plants a tree for every £1 they save.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those are just some of the possibilities being able to plant trees using and API would enable and we know there will be many more we haven't thought about!&lt;/p&gt;

&lt;p&gt;Sooooo, we have already set up a holding page &lt;a href="https://betheforest.org/"&gt;here&lt;/a&gt;, where you can subscribe for more updates. We've even got a little logo already, if you fancy checking it out! &lt;/p&gt;

&lt;h2&gt;
  
  
  💡 How did the idea come about?
&lt;/h2&gt;

&lt;p&gt;One Friday evening we were sat in the living room after having a couple of wines and watching a documentary about the world and what a mess it's in. With wildfires, global warming, deforestation, and so on and so forth. I just had an overwhelming sense of sadness and anger about what is going on. &lt;/p&gt;

&lt;p&gt;We do our fair share for the environment, we've stopped eating meat and dairy, we try not to buy foods in plastic where possible, we shop locally and support our local refill shops like the lovely &lt;a href="https://harrietsofhove.com/"&gt;Harriets of Hove&lt;/a&gt;, all important things to us but it just didn't feel like enough. &lt;/p&gt;

&lt;p&gt;Feeling helpless but wanting to help we got our flip chart out and started brainstorming ideas. Our imaginations went wild, or more my imagination went wild. Within about 5 minutes I had decided I was going to pack my bags and head over to Australia to help the Fireman to put out the wildfires and save all the animals. Zef bought me back to reality and said that wasn't realistic. He was right, as he so often is!&lt;/p&gt;

&lt;p&gt;Back to the drawing board, I suppose. Zef said we should use the skills we have (eg. tech) to come up with something to help, and that's where this idea blossomed from.&lt;br&gt;
We both use the search engine Ecosia where ad revenue from your searches plants trees and we thought wouldn't it be cool if it was easy for people to build similar experiences?!&lt;/p&gt;

&lt;h2&gt;
  
  
  👩‍🏫 How will it work?
&lt;/h2&gt;

&lt;p&gt;Our initial idea is quite simple and may expand in the future, but for the moment this is roughly how we see it working.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Users. for example online shop keepers, signup up to our API and add billing details.&lt;/li&gt;
&lt;li&gt;When they want to plant a tree they use our API and will be billed based on the number of trees they want to plant. For example when a customer purchase they can also have the option to add on planting a tree to offset the impact of delivery. &lt;/li&gt;
&lt;li&gt;We pool everyone's contributions into a pot, and at the end of each month, we donate to one of the leading tree-planting charities on behalf of everyone.&lt;/li&gt;
&lt;li&gt;We create monthly reports providing full transparency on how the money donated has been spent and distributed.&lt;/li&gt;
&lt;li&gt;Users will be able to use the API to see how their contributions have helped and get stats for the estimated number of trees they have planted etc.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  🤝 Trust is earned
&lt;/h2&gt;

&lt;p&gt;We know the key to a service like this is transparency and trust. People need to be sure that the money they provide is actually used for planting trees, and not for funding flotilla holidays in the Mediterranean! &lt;/p&gt;

&lt;p&gt;The monthly reports that show how we have spent the money will be crucial to this and will hopefully give everyone some peace of mind.&lt;/p&gt;

&lt;p&gt;On top of that, &lt;strong&gt;we do not intend to make a profit from this service.&lt;/strong&gt; Our aim is to give as big of a proportion of the money donated as possible directly to the tree planters. &lt;strong&gt;We will need to use a small proportion of the money to cover expenses,&lt;/strong&gt; and while we can't say for certain how much that will be yet, we will be completely transparent about this in the monthly reports.&lt;/p&gt;

&lt;h2&gt;
  
  
  💻 How are we going to build it?
&lt;/h2&gt;

&lt;p&gt;Technically this project is relatively simple, but there will be four things we need to build for it to be a success.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔌 1) API
&lt;/h3&gt;

&lt;p&gt;Of course, the API is core to the whole idea. Our goal is to make it as simple and easy to use as possible. We will be using NodeJS because we are most productive when writing JavaScript.&lt;/p&gt;

&lt;h3&gt;
  
  
  📚 2) API Documentation Site
&lt;/h3&gt;

&lt;p&gt;An API is useless if it doesn't have good documentation. We will need comprehensive documentation that explains how to use the API with clear examples. We will use &lt;a href="https://vuepress.vuejs.org/"&gt;Vuepress&lt;/a&gt; for this as it makes creating docs with markdown super simple.&lt;/p&gt;

&lt;h3&gt;
  
  
  📈 3) Customer Portal
&lt;/h3&gt;

&lt;p&gt;This is where users will sign up, log in, manage billing, get their API credentials, and see their stats. To build this we will be using Vue.js and Tailwind UI to give us a bit of a head start.&lt;/p&gt;

&lt;h3&gt;
  
  
  💚4) Marketing Site
&lt;/h3&gt;

&lt;p&gt;This will explain who we are, what we are doing and trying to achieve and how we plan to go about it. It's important that there's a lot of information here and that we are totally transparent so people trust us. We will have stats for all the donations and expenses leaving no stone unturned. &lt;/p&gt;

&lt;p&gt;We will use Gridsome and Tailwind UI to build the marketing site.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧱 Time to get building!
&lt;/h2&gt;

&lt;p&gt;So there you have it! We have planned everything out, written our kick-off blog post, created the project in Clubhouse, now it's time to get building! We will be back in a week to update you all on how it's going, the hurdles we have hit, the ones we've leapt over and just give a general update on where we are at.&lt;/p&gt;

&lt;p&gt;If anyone has any comments or feedback, we would love to hear from you, so don't be shy! &lt;/p&gt;

</description>
      <category>sideprojects</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>startup</category>
    </item>
    <item>
      <title>Master Plan - 7 Projects / 28 Weeks</title>
      <dc:creator>Gemma Vincent</dc:creator>
      <pubDate>Wed, 06 May 2020 16:44:05 +0000</pubDate>
      <link>https://dev.to/lilgemvincent/master-plan-7-projects-28-weeks-43dn</link>
      <guid>https://dev.to/lilgemvincent/master-plan-7-projects-28-weeks-43dn</guid>
      <description>&lt;p&gt;👋 Hello!&lt;/p&gt;

&lt;p&gt;My name is Gemma and my partner is Jozef. We are both web developers with a passion for making all kinds of things. We live in Hove with our two little rabbits. We have recently started our own development studio, Pixelhop.&lt;/p&gt;

&lt;p&gt;Zef and I are constantly talking about different ideas and "things" we want to build and projects we want to start. Over the years we have started countless side projects but have finished only a few. It's hard to keep side project momentum around busy lifestyles and full-time jobs.&lt;/p&gt;

&lt;p&gt;We have decided enough is enough. We need to plan everything out properly, write down our goals, create a real roadmap, and keep ourselves accountable. So that is exactly what we've done!&lt;/p&gt;

&lt;p&gt;We've come up with personal, business and work goals, as well as a list of projects we have been meaning to start forever. We have a MASTER PLAN!&lt;/p&gt;

&lt;h2&gt;
  
  
  Building in the open
&lt;/h2&gt;

&lt;p&gt;To help keep us accountable we have decided to share our plan publicly. If we don't stick to it everyone can hold us accountable 😬&lt;/p&gt;

&lt;p&gt;Here is our project timetable for the rest of the year. We have given each project code names so we don't ruin all the surprises to come.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmsj9cd9mnwvh10zpo3hj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmsj9cd9mnwvh10zpo3hj.png" alt="Pixelhop timetable"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  But we never finish...
&lt;/h2&gt;

&lt;p&gt;One of the biggest problems our side projects have faced in the past is finishing them! Zef and I both have busy lives and have to work on our side projects around our "real" jobs.&lt;/p&gt;

&lt;p&gt;All too often we have been overly ambitious and before we know it we have been working on something for six months, and we are still no closer to releasing it. At this point, we wouldn't have validation whether the project was a good enough idea to be worth spending that amount of time working on, and it's easy to get bored of a project when working on it for so long with no end in sight.&lt;/p&gt;

&lt;p&gt;To hopefully solve this problem we have decided to limit each project to a strict 4-week timeframe. This should help us keep focused and not get too carried away with creeping features and endless tweaks. At the end of the 4 weeks our goal is to have something releasable, however MVP it might be.&lt;/p&gt;

&lt;p&gt;It's going to be hard, but I think the limitation will help us to get something out the door.&lt;/p&gt;

&lt;h2&gt;
  
  
  A template for success
&lt;/h2&gt;

&lt;p&gt;Given the short timeframes for each project, we have planned at a process that we will follow for every project, hopefully becoming more efficient as we go along. The steps in the process will act as waypoints guiding us to (hopefully) launching a decent MVP at the end of the 4 weeks.&lt;/p&gt;

&lt;h3&gt;
  
  
  🏁Kick-off
&lt;/h3&gt;

&lt;p&gt;To kick-off we will do the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Kick-off post&lt;/strong&gt; - This will essentially act as our brief and explain the goals of the project and what we want to produce.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Project landing page&lt;/strong&gt; - We will create a basic project landing page where people can subscribe for updates. We have bought &lt;a href="https://tailwindui.com/" rel="noopener noreferrer"&gt;Tailwind UI&lt;/a&gt; to help speed this up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set up Clubhouse&lt;/strong&gt; - We ❤️ &lt;a href="https://clubhouse.io/" rel="noopener noreferrer"&gt;Clubhouse&lt;/a&gt; as our project management tool. We will scope out and add as many tasks as possible to the project so we can get a sense of how we are doing over the coming 4 weeks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🤓Mid Project
&lt;/h3&gt;

&lt;p&gt;The day to day of working on the different projects will vary, but we plan to post a weekly status update outlining our current progress and what is left to do. Hopefully, this will be an interesting read to anyone following along and again it should help us to stay accountable and on track.&lt;/p&gt;

&lt;h3&gt;
  
  
  🚀Launch
&lt;/h3&gt;

&lt;p&gt;At the end of the 4-weeks, our goal is to have something launch-able. What does that mean exactly? Well ideally it would mean we would be launching a fully-fledged product, but if we are being realistic I think we will have achieved our goal if we have an MVP launched that is ready for Beta testers. Again this will be slightly dependant on the specific project.&lt;/p&gt;

&lt;p&gt;Another way of putting it, I think we will have succeeded if it the end of the four weeks there are users other than us using our product 😀&lt;/p&gt;

&lt;h2&gt;
  
  
  7 Products / 28 weeks
&lt;/h2&gt;

&lt;p&gt;By the end of this process, we hope to have launched 7 products within 28 weeks of sprint time. It's a lofty goal we know, but we are excited about trying to accomplish it and can't wait to see the results.&lt;/p&gt;

&lt;p&gt;The plan is going to allow us to validate our ideas quickly, we will learn so much along the way, and when we come out the other side we will have 7 great projects we can add to our &lt;a href="https://pixelhop.io/" rel="noopener noreferrer"&gt;Pixelhop&lt;/a&gt; portfolio.&lt;/p&gt;

</description>
      <category>sideprojects</category>
      <category>productivity</category>
      <category>webdev</category>
      <category>startup</category>
    </item>
  </channel>
</rss>
