<?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: Nazim Boudeffa</title>
    <description>The latest articles on DEV Community by Nazim Boudeffa (@nazimboudeffa).</description>
    <link>https://dev.to/nazimboudeffa</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%2F99639%2F3e4f9df1-50ee-471d-8cb6-6c03652d2afb.png</url>
      <title>DEV Community: Nazim Boudeffa</title>
      <link>https://dev.to/nazimboudeffa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nazimboudeffa"/>
    <language>en</language>
    <item>
      <title>How to Display Products with Medusa</title>
      <dc:creator>Nazim Boudeffa</dc:creator>
      <pubDate>Mon, 19 Jun 2023 16:26:46 +0000</pubDate>
      <link>https://dev.to/nazimboudeffa/how-to-display-products-with-medusa-god</link>
      <guid>https://dev.to/nazimboudeffa/how-to-display-products-with-medusa-god</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w7h2XzvY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zyi9w0fpgnmng332baj3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w7h2XzvY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zyi9w0fpgnmng332baj3.png" alt="Image description" width="753" height="799"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Everyone knows Medusa, the open source Shopify alternative and Product Hunt award winner as the e-commerce solution of 2022&lt;/p&gt;

&lt;p&gt;In this little post we are going to see how to list products with Medusa&lt;/p&gt;

&lt;h2&gt;
  
  
  Development
&lt;/h2&gt;

&lt;p&gt;Deploy you Medusa backend on a fresh local Ubuntu Server with VirtualBox&lt;/p&gt;

&lt;p&gt;Create a latest Nextjs App (talking about /app)&lt;/p&gt;

&lt;p&gt;Create a file in the Nextjs App called medusa-client.js (in utils folder for example)&lt;/p&gt;

&lt;p&gt;For info: We are just coding what is explained on the API documentation here &lt;a href="https://docs.medusajs.com/api/store#tag/Products"&gt;https://docs.medusajs.com/api/store#tag/Products&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Medusa from "@medusajs/medusa-js"

//Create a Medusa instance
const medusaClient = new Medusa({ baseUrl: process.env.BACKEND_URL })

export { medusaClient }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create the Products page.tsx&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const [products, setProducts] = useState&amp;lt;any[]&amp;gt;([])

const getProducts = async () =&amp;gt; {
  try {
    const results = await medusaClient.products.list();
    console.log(results)
    setProducts(results.products)
  } catch (error) {
    console.log(error)
  }
}

useEffect(() =&amp;gt; {
 getProducts()
}, []);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will discuss that &lt;code&gt;&amp;lt;any[]&amp;gt;&lt;/code&gt; type in other posts, and how to display the prices and other fields, also why I use results and not data, but why not ...&lt;/p&gt;

&lt;p&gt;Now you can just display the products in a TailWind CSS grid&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div className="grid grid-cols-1 gap-1"&amp;gt;
  {products.map((product) =&amp;gt; (
    &amp;lt;ProductCard product={product} key={product.id} /&amp;gt;
  ))}
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can pick a ProductCard in hyperui.dev or use the code available on &lt;a href="https://github.com/nazimboudeffa/medusa-storefront-coffee-nextjs"&gt;https://github.com/nazimboudeffa/medusa-storefront-coffee-nextjs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Look in next.config.js for more infos on the &lt;code&gt;BACKEND_URL&lt;/code&gt; with the latest Nextjs version&lt;/p&gt;

&lt;h2&gt;
  
  
  Production
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;For the backend (demo) I use railway.app $8/Month &lt;a href="https://www.youtube.com/watch?v=a_EHB1VEkC0"&gt;check this video&lt;/a&gt; but basically a little OVHCloud VPS is Okey for one store&lt;/li&gt;
&lt;li&gt;For the storefront (demo) I use vercel.com $20/Month&lt;/li&gt;
&lt;li&gt;For the domain name you can choose what you want, OVH, namecheap, ... ~$15/Year&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's still cheaper then Shopify, actually $36 and you can make many many ... many deployments&lt;/p&gt;

&lt;p&gt;🎉&lt;/p&gt;

</description>
      <category>medusa</category>
    </item>
    <item>
      <title>Testing Features of Medusa</title>
      <dc:creator>Nazim Boudeffa</dc:creator>
      <pubDate>Fri, 13 Jan 2023 21:39:34 +0000</pubDate>
      <link>https://dev.to/nazimboudeffa/how-ive-tested-some-of-the-features-of-medusa-5ci2</link>
      <guid>https://dev.to/nazimboudeffa/how-ive-tested-some-of-the-features-of-medusa-5ci2</guid>
      <description>&lt;p&gt;I've started to code a marketplace with Next and I have started to learn some of the plugins of medusajs on my way to that objective&lt;/p&gt;

&lt;p&gt;BTW I wish I can succeed because sometimes I just want to giveup, it's not easy but as an old gamedev I can make things be fun&lt;/p&gt;

&lt;p&gt;So I've created a repository called &lt;a href="https://github.com/nazimboudeffa/nextjs-marketplace-medusa" rel="noopener noreferrer"&gt;nextjs-marketplace-medusa&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then &lt;code&gt;npx create-next-app@latest --typescript&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then just install and configure TailWind&lt;/p&gt;

&lt;p&gt;After that actually I use to tests some code about fetching the products&lt;/p&gt;

&lt;p&gt;I use to code on Windows&lt;/p&gt;

&lt;p&gt;So I have created a medusa server on an Ubuntu Desktop (actually 22.04) with VirtualBox&lt;/p&gt;

&lt;p&gt;Installed Redis and Postgres like explained on the medusajs documentation site &lt;a href="https://docs.medusajs.com" rel="noopener noreferrer"&gt;https://docs.medusajs.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F55f70jklmpe0izl9bxon.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F55f70jklmpe0izl9bxon.png" alt="Image description" width="714" height="504"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fe0jfb1694lbxkflojtzi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fe0jfb1694lbxkflojtzi.png" alt="Image description" width="714" height="505"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fis519araktek603y848s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fis519araktek603y848s.png" alt="Image description" width="715" height="503"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This server has an URL that I access from the Next app by changing the server's CORS to &lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt; even if I can just launch the Next app with changing the port to 8000, why? It's just to understand the CORS feature and let port 8000 as is for the Next Starter&lt;/p&gt;

&lt;p&gt;I add a .env file to the app with the URL to the Ubuntu medusa server &lt;code&gt;NEXT_PUBLIC_MEDUSA_BACKEND_URL="http://192.168.0.45:9000"&lt;/code&gt; and that's it&lt;/p&gt;

&lt;p&gt;It works !&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fltrgjka4w0ptaokqgane.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fltrgjka4w0ptaokqgane.png" alt="Image description" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next step is to separate the test that I do on the endpoint from the marketplace to a repository called &lt;a href="https://github.com/nazimboudeffa/nextjs-tests-medusa" rel="noopener noreferrer"&gt;nextjs-tests-medusa&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This approach allows to separate the medusa server from Windows in a VirtualBox and let to install multiple ones to work on the marketplace&lt;/p&gt;

</description>
      <category>medusa</category>
    </item>
    <item>
      <title>What are the Technologies Used in Medusa</title>
      <dc:creator>Nazim Boudeffa</dc:creator>
      <pubDate>Mon, 14 Nov 2022 17:16:35 +0000</pubDate>
      <link>https://dev.to/nazimboudeffa/what-are-the-technologies-used-in-medusa-59i4</link>
      <guid>https://dev.to/nazimboudeffa/what-are-the-technologies-used-in-medusa-59i4</guid>
      <description>&lt;p&gt;I have joined the project and I have seen many things, so I need to organise myself and my thoughts to master them :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node/NPM&lt;/li&gt;
&lt;li&gt;Yarn&lt;/li&gt;
&lt;li&gt;TypeScript&lt;/li&gt;
&lt;li&gt;TypeORM&lt;/li&gt;
&lt;li&gt;SQLite&lt;/li&gt;
&lt;li&gt;PostGresSQL&lt;/li&gt;
&lt;li&gt;Redis&lt;/li&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;li&gt;Next&lt;/li&gt;
&lt;li&gt;React&lt;/li&gt;
&lt;li&gt;TailWind&lt;/li&gt;
&lt;li&gt;Ubuntu&lt;/li&gt;
&lt;li&gt;Git/GitHub&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you don't know them let's make a little sort&lt;/p&gt;

&lt;p&gt;FrontEnd&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next&lt;/li&gt;
&lt;li&gt;React&lt;/li&gt;
&lt;li&gt;TailWind&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;BackEnd&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Redis&lt;/li&gt;
&lt;li&gt;TypeORM&lt;/li&gt;
&lt;li&gt;SQLite&lt;/li&gt;
&lt;li&gt;PostGresSQL&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;DevOps&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Git/GitHub&lt;/li&gt;
&lt;li&gt;Node,NPM/Yarn&lt;/li&gt;
&lt;li&gt;Ubuntu&lt;/li&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A lot around JavaScript and node/yarn, also JSX all surrounded by &lt;strong&gt;TypeScript&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For the moment I don't say which part of the project uses which technology because I think like a FullStack and also I don't know all the technologies that are used in the project but I am writing again/still &lt;a href="https://github.com/nazimboudeffa?tab=repositories&amp;amp;q=cookbook"&gt;my CookBooks&lt;/a&gt; to let you know where I am in this knowledge&lt;/p&gt;

&lt;p&gt;The docs are quite understandable and it's a pleasure to just clone a repository and type &lt;code&gt;npm install&lt;/code&gt; or &lt;code&gt;yarn add&lt;/code&gt; and see your shop just going live on localhost in few commands&lt;/p&gt;

&lt;p&gt;At the starting point I have used my little PC with Windows to start contributing but after that I have tested on a fresh Ubuntu and it's really fine&lt;/p&gt;

&lt;p&gt;Before working on the project that I want to develop wich is instant-market.com a domain name that without the dash it actually costs 20.000$, I want to develop a marketplace, multivendor, dropshippong and so&lt;/p&gt;

&lt;p&gt;Yes, beacause don't miss that medusa is the Open Source alternative on Shopify&lt;/p&gt;

&lt;p&gt;But Shopify needs you only to click on a button and pay 29 bucks/month&lt;/p&gt;

&lt;p&gt;So what about medusa, will it be cheaper ? I hope so&lt;/p&gt;

&lt;p&gt;Will it be deployable in few clicks on Netlify or Railways, I really hope that&lt;/p&gt;

&lt;p&gt;So, what the technology stack we need to be expert at deploying a medusa solution&lt;/p&gt;

&lt;p&gt;What is the future business plan of someone that specialise in medusa deployments&lt;/p&gt;

&lt;p&gt;Do we need to be experts in the technology stack that we've seen at the beggining of this short article&lt;/p&gt;

&lt;p&gt;We'll see all this in detail in some articles that I will write and will explain what is the stack we need to know&lt;/p&gt;

</description>
      <category>medusa</category>
    </item>
    <item>
      <title>How do you contribute to opensource on GitHub ?</title>
      <dc:creator>Nazim Boudeffa</dc:creator>
      <pubDate>Mon, 17 Sep 2018 16:05:28 +0000</pubDate>
      <link>https://dev.to/nazimboudeffa/how-do-you-contribute-to-opensource-on-github-25ae</link>
      <guid>https://dev.to/nazimboudeffa/how-do-you-contribute-to-opensource-on-github-25ae</guid>
      <description>&lt;p&gt;This is my third post and I want to thank you all for the motivational discussions we are haveing here in dev.to&lt;/p&gt;

&lt;p&gt;"&lt;a href="https://dev.to/nazimboudeffa/how-do-you-commit-in-github--4h92"&gt;How do you commit&lt;/a&gt;" was just an amazing post for ma that have let me know how everyone is using git in GitHub, so now it's time to go ahead&lt;/p&gt;

&lt;p&gt;In fact, I like to discuss on slack and discord in some projects like &lt;a href="http://phaser.io"&gt;phaserjs&lt;/a&gt; or &lt;a href="http://atom.io"&gt;atom&lt;/a&gt; and as I have discovered &lt;a href="https://www.gitkraken.com/"&gt;gitkraken&lt;/a&gt; it is a chance to just watch the devs and continue until I find a way to write an article on a general method to contribute to opensource on GitHub&lt;/p&gt;

&lt;p&gt;What I can say for the moment is that watching the commits on gitkraken is really cool because we have a general view of what is going on every time a commit is made&lt;/p&gt;

&lt;h2&gt;
  
  
  It is about to FORK and PR not just to CLONE
&lt;/h2&gt;

&lt;p&gt;In the image bellow I have just cloned from the origin to a folder in a second drive, that I have just called GitHub and I don't touch the code, just watching the commits&lt;/p&gt;

&lt;p&gt;To contribute I have to FORK and CLONE then PR, and before that I have to play a bit with the code, so, How do you contribute to opensource on GitHub ?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2E4z0U7G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/prgmf35ydmy7lupmgd2r.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2E4z0U7G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/prgmf35ydmy7lupmgd2r.gif" alt="PhaserJS commits in Gitkraken by direct cloning"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>github</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How do you commit in GitHub ?</title>
      <dc:creator>Nazim Boudeffa</dc:creator>
      <pubDate>Sun, 09 Sep 2018 20:45:32 +0000</pubDate>
      <link>https://dev.to/nazimboudeffa/how-do-you-commit-in-github--4h92</link>
      <guid>https://dev.to/nazimboudeffa/how-do-you-commit-in-github--4h92</guid>
      <description>&lt;p&gt;I don't know if it's me or my dudeist attitude but when I start a project on GitHub, the first thing I do is to create a project on my profile on the site&lt;/p&gt;

&lt;p&gt;After that I clone the repo then I code for example a &lt;a href="http://phaser.io"&gt;Phaser&lt;/a&gt; game to participate in a gamejam on &lt;a href="http://itch.io/jams"&gt;itch.io/jams&lt;/a&gt; with one of my fake accounts&lt;/p&gt;

&lt;p&gt;Then :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;git add .&lt;br&gt;
I use precisely the dot nothing else &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;git commit -m "First Commit"&lt;br&gt;
I don't know the diffrence with "Initial Commit"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;git push origin main&lt;br&gt;
OFC I use git config user.name/user.email before all this to use my fake accounts&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I repeat these steps ... and never finish a project&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How to start coding in GitHub ?</title>
      <dc:creator>Nazim Boudeffa</dc:creator>
      <pubDate>Sat, 08 Sep 2018 22:13:42 +0000</pubDate>
      <link>https://dev.to/nazimboudeffa/how-to-start-coding-in-github--57pg</link>
      <guid>https://dev.to/nazimboudeffa/how-to-start-coding-in-github--57pg</guid>
      <description>&lt;p&gt;I have written &lt;a href="https://medium.com/@nazimboudeffa/par-ou-commencer-sur-github-e6238a38c97c"&gt;an article on Medium&lt;/a&gt; (in french) to explain what is the way to start coding on GitHub when someone just connect to the site, so I have proposed three diffrent strategies :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;My Star of all repos, &lt;br&gt;
it means, choose the most starred repo on github.com/k0kubun/gitstar-ranking&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Who answers my needs&lt;br&gt;
it means, take a look at the awsome badge on github.com/sindresorhus&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;My preferred company&lt;br&gt;
it means, go ahead and type the name of your preferred company after the slash in github.com&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then I've proposed to discuss other strategies.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
