<?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: DanieleAurilio</title>
    <description>The latest articles on DEV Community by DanieleAurilio (@danieleaurilio).</description>
    <link>https://dev.to/danieleaurilio</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%2F572134%2F1c63eca7-bdd1-4d1a-a60c-8965dd6819ac.jpg</url>
      <title>DEV Community: DanieleAurilio</title>
      <link>https://dev.to/danieleaurilio</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/danieleaurilio"/>
    <language>en</language>
    <item>
      <title>Conquering Deployment with Nest.js and React</title>
      <dc:creator>DanieleAurilio</dc:creator>
      <pubDate>Wed, 20 Mar 2024 23:18:54 +0000</pubDate>
      <link>https://dev.to/danieleaurilio/conquering-deployment-with-nestjs-and-react-351o</link>
      <guid>https://dev.to/danieleaurilio/conquering-deployment-with-nestjs-and-react-351o</guid>
      <description>&lt;p&gt;Hi folks! Today, I'm thrilled to share the tale of my latest side project, a harmonious blend of Nest.js and React, running seamlessly and, believe it or not, entirely free of charge! With a dash of spare time and a sprinkle of ingenuity, I crafted this leveraging Nest.js's backend prowess and React's dynamic frontend capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  App Overview
&lt;/h2&gt;

&lt;p&gt;But let's dive into the heart of the matter, the app itself. Picture this: users can register via Google authentication, create organizations, invite employees, and seamlessly book meeting rooms within said organizations. And here's the kicker each booking automatically syncs with Google Calendar and generates a Google Meet link. It's a meeting room management marvel, powered by Supabase underneath.&lt;br&gt;
Repositories are both on GitLab!&lt;/p&gt;

&lt;p&gt;Now, let's talk deployment.&lt;/p&gt;
&lt;h2&gt;
  
  
  Deployment Chronicles: Nest.js on Render.com
&lt;/h2&gt;

&lt;p&gt;Deploying Nest.js on Render.com was a breeze. I simply registered, clicked "Add New," selected "Web Service," connected my GitLab repo, and voila! With a few configuration tweaks—setting the build commands, environment variables, and opting for the free plan—the deployment commenced. And guess what? It was smooth sailing from there. With each Git push to the main branch, Render.com triggers a build and deploys my Nest.js backend effortlessly. Plus, it even provides a handy domain associated with the web service—perfect for API usage in my React app!&lt;/p&gt;
&lt;h2&gt;
  
  
  Deployment Chronicles: React with React Router on GitLab Pages
&lt;/h2&gt;

&lt;p&gt;Now, deploying React on GitLab Pages wasn't quite as straightforward as Nest.js, but fear not! With a bit of configuration in project settings specifying environment variables and the new URL associated with my Nest.js backend on Render.com I was ready to roll. After clicking "Deploy" and selecting "Pages," I set up my .gitlab-ci.yaml file to ensure that every Git push triggers the pipeline and deploys the artifact. Voila! My React frontend was up and running, with GitLab Pages providing a URL for easy access.&lt;/p&gt;

&lt;p&gt;Here the yaml file I configured:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# The Docker image that will be used to build your app
image: node:18.19.0
# Functions that should be executed before the build script is run
build:
  stage: build
  script:
    - npm install
    - npm run build  # Generate production build
  artifacts:
    paths:
      - build/

pages:
  script:
    - cp -r build/* public/
    - cp public/index.html public/404.html # Required for React Router 
  artifacts:
    paths:
      # The folder that contains the files to be exposed at the Page URL
      - public
  rules:
    # This ensures that only pushes to the default branch will trigger
    # a pages deploy
    - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And there you have it, the tale of my side project's triumphant journey from development to deployment, all without spending a dime! With Nest.js and React leading the charge, the possibilities truly are endless. Happy coding! 🚀&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@karosu?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash"&gt;夜 咔罗&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/orange-and-black-metal-pipe-RIQdGGU2US0?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>react</category>
      <category>devops</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Why mistakes at work should not be discriminatory (and why they sometimes are).</title>
      <dc:creator>DanieleAurilio</dc:creator>
      <pubDate>Fri, 22 Apr 2022 16:06:33 +0000</pubDate>
      <link>https://dev.to/danieleaurilio/why-mistakes-at-work-should-not-be-discriminatory-and-why-they-sometimes-are-1n6l</link>
      <guid>https://dev.to/danieleaurilio/why-mistakes-at-work-should-not-be-discriminatory-and-why-they-sometimes-are-1n6l</guid>
      <description>&lt;h3&gt;
  
  
  Nobody was born learned
&lt;/h3&gt;

&lt;p&gt;Since i was born my grandmother tells me “Nobody was born learned”, but people at work seems didn’t remember this. Everyday people learn something, and the biggest lesson comes from mistakes. Everyone knows how is complicated write code and write good code if you are a junior ( in most cases good code doesn’t exist 😛 ), but senior doesn’t care what you did, and why. If you did some mistakes, write some bugs or fails a new improvement, you will be discriminated against. It is not something that happens the first time, but over time. If you fails more times, your credibility within the team drops and no one cares your mood. You can study, learn, grow, develop cool stuff (with errors), contribute to the best open source project, but your reputation will not be rebuilt. And if you are never appreciated, there is a slow detachment from your work team, which will lead you to fall into the trap of the impostor syndrome. Like a dog chasing its own tail, you will think that the fault is yours. &lt;/p&gt;

&lt;p&gt;Let me clarify, this speech is quite crude and written in a flash, many may never find themselves in this condition, but we are talking about a very subtle discrimination, almost imperceptible, which can cause annoyance when you suffer it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Look at yourself in the mirror
&lt;/h3&gt;

&lt;p&gt;If at work you are discriminated, not appreciated or simply ignored, please look at yourself in the mirror.&lt;/p&gt;

&lt;p&gt;The mirror know exactly who are you, what are you doing and where are you . Not a senior or tech lead in company, until the other day they did not know about your existence, nobody cares about your growth. Only to yourself. No one would feed you, with the risk that one day you might take his place. It is survival in a world which run too fast. Make mistakes as many times as you want, you don't have to justify yourself in front of anyone. Companies and people pass, your goals remain and evolve over time.&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@ingagezalian?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Inga Gezalian&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/mirror-1920x1080?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>FTP Service in SFCC - SFRA Architecture 📞</title>
      <dc:creator>DanieleAurilio</dc:creator>
      <pubDate>Fri, 06 Aug 2021 13:36:50 +0000</pubDate>
      <link>https://dev.to/danieleaurilio/ftp-service-in-sfcc-sfra-architecture-2dep</link>
      <guid>https://dev.to/danieleaurilio/ftp-service-in-sfcc-sfra-architecture-2dep</guid>
      <description>&lt;h4&gt;
  
  
  Hi guys! 🖖
&lt;/h4&gt;

&lt;p&gt;Have you to work with FTP service but it is your first time? &lt;br&gt;
Don’t worry about it, SFCC provide a class called LocalServiceRegistry, with this class you can managing some request like &lt;strong&gt;HTTP, FTP and SOAP&lt;/strong&gt;.&lt;br&gt;
First of all we have to create a service in business manager on SFCC.&lt;/p&gt;

&lt;h3&gt;
  
  
  Let’s create service credentials and service profile: 🛠️
&lt;/h3&gt;

&lt;p&gt;Go to &lt;strong&gt;Administration -&amp;gt; Services&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here we have three tabs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Services;&lt;/li&gt;
&lt;li&gt;Profiles: here we can specify ms time-out after a maximum number of failed call.&lt;/li&gt;
&lt;li&gt;Credentials: here we have to setup service credential.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Now we go to setup service credential:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhagm5t98w9iafu979c2q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhagm5t98w9iafu979c2q.png" alt="New Service Credentials" width="800" height="312"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Go setup service profiles:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdw8okosn7kdxdzp2b7fp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdw8okosn7kdxdzp2b7fp.png" alt="Pasted Graphic 1" width="800" height="233"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  And at the end we can setup Service:
&lt;/h4&gt;

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

&lt;h4&gt;
  
  
  After created service in business manager we can write our service call:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create a file under the path cartridge/scripts/service.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Require LocalServiceRegistry.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;em&gt;LocalServiceRegistry.createService()&lt;/em&gt; accepts two parameters, first is the name of the service, second parameter passed is a config object were we create request and parse the response.&lt;br&gt;
&lt;strong&gt;&lt;em&gt;createRequest&lt;/em&gt;&lt;/strong&gt; must have service passed as parameter, setOperation() method is exclusive for ftp service, you can find full list of operation you can execute &lt;a href="https://documentation.b2c.commercecloud.salesforce.com/DOC2/index.jsp?topic=%2Fcom.demandware.dochelp%2FDWAPI%2Fscriptapi%2Fhtml%2Fapi%2Fclass_dw_svc_LocalServiceRegistry.html&amp;amp;resultof=%22%6c%6f%63%61%6c%73%65%72%76%69%63%65%72%65%67%69%73%74%72%79%22%20%22%6c%6f%63%61%6c%73%65%72%76%69%63%65%72%65%67%69%73%74%72%69%22%20"&gt;Here&lt;/a&gt;&lt;br&gt;
After in &lt;strong&gt;&lt;em&gt;parseResponse&lt;/em&gt;&lt;/strong&gt; you can manipulate response and its returned data, for example you can iterate response data.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;As you have seen it isn’t difficult, indeed it is intuitive with LocalServiceRegistry class.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now when you have to call this service you have to include it in a file and after use &lt;strong&gt;yourService.call()&lt;/strong&gt;; &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Custom Site Preferences and Custom Global Preferences in SFRA 📝</title>
      <dc:creator>DanieleAurilio</dc:creator>
      <pubDate>Mon, 26 Apr 2021 13:04:48 +0000</pubDate>
      <link>https://dev.to/danieleaurilio/custom-site-preferences-and-custom-global-preferences-in-sfra-gan</link>
      <guid>https://dev.to/danieleaurilio/custom-site-preferences-and-custom-global-preferences-in-sfra-gan</guid>
      <description>&lt;h4&gt;
  
  
  INTRO
&lt;/h4&gt;

&lt;p&gt;How many times do you have thought where you can store properties about configurations? Salesforce Commerce Cloud provides Site and Global Custom Preferences where we can store properties divided into groups. Global Custom preferences affect all sites instead Site Preferences affect only site where it's configurated.&lt;br&gt;
Store properties in preferences allows us retrive it every time we need.&lt;br&gt;
Setting a site custom preferences or a global custom preferences is practically the same. We are going to set up a group that contains properties that we will then use within our app.&lt;/p&gt;

&lt;h3&gt;
  
  
  LET’S SET UP A CUSTOM PREFERENCES 💾
&lt;/h3&gt;

&lt;p&gt;If you don’t have &lt;strong&gt;system-objecttype-extensions.xml&lt;/strong&gt; file you must create it under &lt;em&gt;sites/sites_template/meta/&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Initialize xml and create a xml node &lt;code&gt;&amp;lt;type-extensions type-id=“SitePreferences”&amp;gt; &amp;lt;/type-extensions&amp;gt;&lt;/code&gt;.&lt;br&gt;
In &lt;code&gt;&amp;lt;type-extensions type-id=“SitePreferences”&amp;gt; &amp;lt;/type-extensions&amp;gt;&lt;/code&gt; we can crate other two xml nodes called &lt;code&gt;&amp;lt;custom-attribute-definitions&amp;gt; &amp;lt;/custom-attribute-definitions&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;group-definitions&amp;gt; &amp;lt;/group-definitions&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In &lt;code&gt;&amp;lt;custom-attribute-definitions&amp;gt; &amp;lt;/custom-attribute-definitions&amp;gt;&lt;/code&gt; we can define our custom attribute&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In &lt;code&gt;&amp;lt;group-definitions&amp;gt; &amp;lt;/group-definitions&amp;gt;&lt;/code&gt; we can create &lt;code&gt;&amp;lt;attribute-group group-id="SiteCustomAttributeGroupID"&amp;gt;&lt;/code&gt;  which contain &lt;code&gt;&amp;lt;display-name xml:lang="x-default"&amp;gt;Site Custom Attribute Group&amp;lt;/display-name&amp;gt;&lt;/code&gt; and  &lt;code&gt;&amp;lt;attribute attribute-id="SiteCustomAttributeID" /&amp;gt;&lt;/code&gt; refers to attribute-id which I specified earlier.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Now we can upload &lt;strong&gt;system-objecttype-extensions.xml&lt;/strong&gt; in business manager under &lt;em&gt;Administration -&amp;gt; Site Development -&amp;gt; Site Import &amp;amp; Export&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;After uploaded xml you can find your site custom preferences in Business Manager under &lt;em&gt;Merchant Tools -&amp;gt; Site Preferences -&amp;gt; Custom Preferences&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Now you can access to preferences value through:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dw.system.Site.getCurrent().getCustomPreferenceValue('SiteCustomAttributeID’);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;But how i explained earlier you can create also a Global Custom Preferences, but the unique difference is in &lt;code&gt;&amp;lt;type-extensions type-id=“SitePreferences”&amp;gt; &amp;lt;/type-extensions&amp;gt;&lt;/code&gt;, you have to replace &lt;strong&gt;type-id=“SitePreferences”&lt;/strong&gt; with &lt;strong&gt;type-id="OrganizationPreferences"&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;And you can find your Global Custom Preferences in Business Manager under &lt;em&gt;Administration -&amp;gt; Global Preferences -&amp;gt; Custom Preferences&lt;/em&gt;.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How create a custom Job which execute a script in SFRA 🔨</title>
      <dc:creator>DanieleAurilio</dc:creator>
      <pubDate>Tue, 13 Apr 2021 14:21:38 +0000</pubDate>
      <link>https://dev.to/danieleaurilio/how-create-a-custom-job-which-execute-a-script-in-sfra-g90</link>
      <guid>https://dev.to/danieleaurilio/how-create-a-custom-job-which-execute-a-script-in-sfra-g90</guid>
      <description>&lt;h3&gt;
  
  
  Intro 💡
&lt;/h3&gt;

&lt;p&gt;Many times you had think how you can automate a script, but you don't know how jobs works in  SFRA or how you can create a custom jobs? Don't worry, first time can be difficult for all. I am here for explain to you whats is a job and how you can customize it and automate routine tasks or long-running processes.&lt;/p&gt;

&lt;p&gt;Note: you can create jobs through business manager but I don’t explain how do it in this article.&lt;/p&gt;

&lt;p&gt;I know, you can't wait to automate your processes, so what are we waiting for, let's automate!&lt;/p&gt;

&lt;h3&gt;
  
  
  Let’s Create File to execute!  🛠️
&lt;/h3&gt;

&lt;p&gt;Go create a js file under the path &lt;em&gt;your_directory/cartridge/scripts/jobs/&lt;strong&gt;scriptFile.js&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I created and exported a simple function which log a string, but you can do everything you want. &lt;/p&gt;

&lt;p&gt;Remember to export function you want execute.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  Let’s Declare Job!  ⚙️
&lt;/h3&gt;

&lt;p&gt;Go create a xml file under the path &lt;em&gt;your_directory/sites/sites_template/&lt;strong&gt;file_name.xml&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here we declare job which execute a script, all jobs are included in tag &lt;code&gt;&amp;lt;jobs&amp;gt; &amp;lt;/jobs&amp;gt;&lt;/code&gt;. &lt;/p&gt;

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

&lt;p&gt;In &lt;code&gt;&amp;lt;jobs&amp;gt; &amp;lt;/jobs&amp;gt;&lt;/code&gt; you can declare all jobs, every job is unique and it is identified by &lt;code&gt;job-id&lt;/code&gt;. In job you must start a &lt;code&gt;&amp;lt;flow&amp;gt; &amp;lt;/flow&amp;gt;&lt;/code&gt; which include &lt;code&gt;&amp;lt;step&amp;gt; &amp;lt;/step&amp;gt;&lt;/code&gt;. Every step is unique and it is identified by &lt;code&gt;step-id&lt;/code&gt;. Step include a &lt;code&gt;&amp;lt;description&amp;gt; &amp;lt;/description&amp;gt;&lt;/code&gt; and a &lt;code&gt;&amp;lt;parameters&amp;gt; &amp;lt;/parameters&amp;gt;&lt;/code&gt;. In &lt;code&gt;&amp;lt;parameters&amp;gt;&lt;/code&gt; you can include how many &lt;code&gt;&amp;lt;parameter&amp;gt; &amp;lt;/parameter&amp;gt;&lt;/code&gt; you want. Every &lt;em&gt;parameter&lt;/em&gt; have a name,  In &lt;code&gt;name=“”&lt;/code&gt; you must specify input Parameters, you can find all input Parameters with description in &lt;a href="https://documentation.b2c.commercecloud.salesforce.com/DOC2/index.jsp"&gt;official documentation&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In name &lt;code&gt;&amp;lt;parameter name="ExecuteScriptModule.Module"&amp;gt;app_project/cartridge/scripts/jobs/scriptFile.js&lt;br&gt;
&amp;lt;/parameter&amp;gt;&lt;/code&gt; You have to pass ExecuteScriptModule.Module which accept as input parameters Script File. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In &lt;code&gt;&amp;lt;parameter name="ExecuteScriptModule.FunctionName"&amp;gt;execute&amp;lt;/parameter&amp;gt;&lt;/code&gt; You have to pass as input parameters function’s name exported in script file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In &lt;code&gt;&amp;lt;parameter name="ExecuteScriptModule.Transactional"&amp;gt;false&amp;lt;/parameter&amp;gt;&lt;/code&gt; You have to pass  a boolean value, but It must be true if in function you are using class Transaction.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With &lt;code&gt;&amp;lt;triggers&amp;gt; &amp;lt;/triggers&amp;gt;&lt;/code&gt; you can specify when run job.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Upload and import your job file .xml in Business Manager in Administration -&amp;gt; Operations -&amp;gt; Import &amp;amp; Export.&lt;br&gt;
Now you can import your job immediately or wait the day and the time specified in the xml file.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>Getting Started with OCAPI in SFRA - A Powerful Tool 🚀</title>
      <dc:creator>DanieleAurilio</dc:creator>
      <pubDate>Sat, 03 Apr 2021 09:04:55 +0000</pubDate>
      <link>https://dev.to/danieleaurilio/getting-started-with-ocapi-in-sfra-a-powerful-tool-12mk</link>
      <guid>https://dev.to/danieleaurilio/getting-started-with-ocapi-in-sfra-a-powerful-tool-12mk</guid>
      <description>&lt;h3&gt;
  
  
  What is OCAPI?
&lt;/h3&gt;

&lt;p&gt;OCAPI (Open Commerce API) is an API which allows access to our platform data from another application in a secure way, going to request information from the server and returning a value or an HTTP error in case of error ( resource not found, parameters not found etc. ).&lt;/p&gt;

&lt;p&gt;There are 3 types of OCAPI: Shop, Data and Meta. The most used is Shop, it provides access to Commerce Cloud Digital storefront functionality.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;You can retrive information about all OCAPI resources from salesforce documentation under “Open Commerce API”.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  GET IN ACTION!🤘
&lt;/h3&gt;

&lt;p&gt;Hey! yes i know, it was boring, but now we get in action. If you not have installed Postman or Insomnia go to download one of this.&lt;/p&gt;

&lt;p&gt;Ok! You are now ready to try making the first API call and getting your first error!&lt;/p&gt;

&lt;p&gt;But don't worry, i'm here for explain to you how avoid it and retrive information what you need.&lt;/p&gt;

&lt;h4&gt;
  
  
  RETRIVE AUTHORIZATION TOKEN
&lt;/h4&gt;

&lt;p&gt;Yes, your first api call is for retrive authorization token. We need some parameters to pass in header or query.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;client_id&lt;/strong&gt;, without it we are not able to access information we need, you can find it in business manager under Administration -&amp;gt; Open Commerce API Settings. (&lt;em&gt;Passed as query&lt;/em&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Your username, password and client secret&lt;/strong&gt; (username and password are the same you use for access to business manager, client secret is provided by CRM) which are coding in Base64 (you can use &lt;a href="https://www.base64encode.org/"&gt;Base64encode&lt;/a&gt;) following this structure &lt;code&gt;your_username:your_password:client_secret&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;grant_type&lt;/strong&gt; (&lt;em&gt;passed as query&lt;/em&gt;): &lt;code&gt;urn:demandware:params:oauth:grant-type:client-id:dwsid:dwsecuretoken&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Content-Type: application/x-www-form-urlencoded&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally we have all parameters to pass in header/query and can call endpoint (&lt;em&gt;https:// &lt;strong&gt;your_host_sandbox&lt;/strong&gt; /dw/oauth2/access_token&lt;/em&gt;) for retrive authorization token with a POST.&lt;/p&gt;

&lt;p&gt;Let’s build our API call!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configure your header:&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;Configure query:&lt;/li&gt;
&lt;/ul&gt;

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

&lt;blockquote&gt;
&lt;p&gt;Remember grant_type value is:  urn:demandware:params:oauth:grant-type:client-id:dwsid:dwsecuretoken&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;TOKEN EXPIERD AFTER 15 MINUTES SO YOU HAVE TO RETRIVE NEW TOKEN.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: I’am using insomnia environment variables.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🎉 Finally we have our authorization token that we can use from now on to execute any API call.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Don't forget to specify in subsequent API call that Authorization will have Bearer your_token value and don't forget to pass your client_id as a query, this must never be missing!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;📦  Now let's try to retrieve an order, we just need to make GET to call the resource:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;https:// &lt;strong&gt;your_sanbox_url&lt;/strong&gt; /s/Your-Site/dw/Shop/&lt;strong&gt;OCAPI Version&lt;/strong&gt;/orders/{ordernumber}&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In header we should set:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Authorization Bearer&lt;/code&gt; &lt;strong&gt;your_token&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;&lt;code&gt;Content-Type application/json&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;DON’T FORGET to set &lt;strong&gt;client_id&lt;/strong&gt; in query.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;You can find other api resource in official salesforce documentation.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Getting started with SFRA</title>
      <dc:creator>DanieleAurilio</dc:creator>
      <pubDate>Mon, 22 Mar 2021 19:01:33 +0000</pubDate>
      <link>https://dev.to/danieleaurilio/getting-started-with-sfra-4n8o</link>
      <guid>https://dev.to/danieleaurilio/getting-started-with-sfra-4n8o</guid>
      <description>&lt;h3&gt;
  
  
  Intro
&lt;/h3&gt;

&lt;p&gt;My first time with SFRA was a disaster, internet is pooring in information regarding this topic, the only chance is documentation or trailhead's videos (long and boring). So I decided to learn at work and write a series of practical articles on this topic.&lt;br&gt;
First topic is about Controller and GET, render a template with a form and POST(this topic require you know how work libraries as express). &lt;/p&gt;

&lt;h3&gt;
  
  
  Let's Create Template
&lt;/h3&gt;

&lt;p&gt;Let's create our template under the path &lt;strong&gt;cartridge/templates/default/directoryName/nameTemplate.isml&lt;/strong&gt;    &lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;URLUtils.url(‘fileName-RouteName’) generate urls used in commerce cloud and it accept controller’s file name and route specified in controller file.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create Form File
&lt;/h3&gt;

&lt;p&gt;Now we can create our form under the path &lt;strong&gt;cartridge/forms/default/fileForm.xml&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;Every field must have formid and type.&lt;/em&gt; You can also specified some custom validation like max-length.&lt;/p&gt;

&lt;p&gt;If everything is clear so far, let's move on to the next steps. &lt;/p&gt;

&lt;h3&gt;
  
  
  Create Controller File
&lt;/h3&gt;

&lt;p&gt;Controller is where we can get or post a route so let’s create a controller where you can GET, render and POST:&lt;/p&gt;

&lt;p&gt;Create a controller file under the path &lt;strong&gt;cartridge/controllers/ControllerFileName.js&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;em&gt;Don’t worry, I know… Now you are confused but it's simpler than you think.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now we concentrate on GET, Let’s me explain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;var server = require(‘server’);&lt;/code&gt; is a must in your controller file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In &lt;code&gt;Server.get(‘RouteName’, function(req,res,next) {  });&lt;/code&gt;  instead of &lt;strong&gt;RouteName&lt;/strong&gt; you can write anything, it is route’s name.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;var formDef = server.forms.getForm(‘fileForm’);&lt;/code&gt; with &lt;code&gt;forms.getForm('')&lt;/code&gt; you can convert form file .xml in an object to send to storefront. So in &lt;code&gt;getForm(‘FileName’)&lt;/code&gt; you must specified &lt;em&gt;file’s name .xml&lt;/em&gt; you before created under &lt;strong&gt;cartridge/forms/default/formFile.xml.&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;With &lt;code&gt;res.render(‘templateDirectory/templateFileName’)&lt;/code&gt; now you can render your template .isml created before under the path  &lt;strong&gt;cartridge/templates/default/directoryName/nameTemplate.isml,&lt;/strong&gt; plus to &lt;code&gt;res.render()&lt;/code&gt; you can add an object to send form definition to frontend, so pass object as a parameter to &lt;code&gt;res.render(‘templateDirectory/templateFileName’, { nameProperty: formDef });&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Go render form fields in Template file
&lt;/h3&gt;

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

&lt;p&gt;After sent formDef to FE we can access this object through &lt;em&gt;pdict&lt;/em&gt; variable.  Imagine &lt;em&gt;pdcit&lt;/em&gt; variable as a big pot where everything that is passed as a parameter during rendering ends up in there and you can fish it in the template whenever you need it. For example with  &lt;code&gt;pdict.newForm.input1.attributes&lt;/code&gt; I’m entering to &lt;em&gt;newForm&lt;/em&gt; object, it is nothing more than  nameProperty which has been passed as an object in &lt;code&gt;res.render(‘templateDirectory/templateFileName’, { nameProperty: formDef });&lt;/code&gt;  &lt;em&gt;input1&lt;/em&gt; and &lt;em&gt;input2&lt;/em&gt; refers to &lt;em&gt;formid&lt;/em&gt; specified in .xml file. &lt;/p&gt;

&lt;h3&gt;
  
  
  Last Step
&lt;/h3&gt;

&lt;p&gt;We are at the end and it is time to receive our input in POST simply by calling the form again with: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;var formDef = server.forms.getForm(‘fileForm’);&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;Now we can access the value we entered in the form object before submitting simply by accessing the formDef object and then then accessing to properties &lt;em&gt;formDef.input1.htmlValue&lt;/em&gt; and &lt;em&gt;formDef.input2.htmlValue&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don’t forget, you can access to your controller and test it simply adding /default/nameControllerFile-RouteName at the end of your sandbox url in your browser.&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
