<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Code Dexterous on Medium]]></title>
        <description><![CDATA[Stories by Code Dexterous on Medium]]></description>
        <link>https://medium.com/@codedexterous?source=rss-78ed20127943------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VkRCicIQDml6oFokz97HDw.png</url>
            <title>Stories by Code Dexterous on Medium</title>
            <link>https://medium.com/@codedexterous?source=rss-78ed20127943------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 18:31:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@codedexterous/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Nginx Setting and Tips]]></title>
            <link>https://codedexterous.medium.com/nginx-setting-and-tips-faa6503371b4?source=rss-78ed20127943------2</link>
            <guid isPermaLink="false">https://medium.com/p/faa6503371b4</guid>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[nginx-proxy]]></category>
            <category><![CDATA[proxy]]></category>
            <category><![CDATA[ubuntu]]></category>
            <dc:creator><![CDATA[Code Dexterous]]></dc:creator>
            <pubDate>Tue, 19 Oct 2021 09:35:29 GMT</pubDate>
            <atom:updated>2021-10-19T09:35:29.187Z</atom:updated>
            <content:encoded><![CDATA[<p>It is a web server that can also be used as a reverse proxy, load balancer, etc.</p><p>Today I am going to explain some basic steps/commands to setup nginx. I am using Ubuntu OS.</p><p><strong>Installation</strong></p><pre>sudo apt install nginx</pre><p><strong>Check version of Nginx</strong></p><pre>nginx -v</pre><p><strong>Start Nginx</strong></p><pre>sudo service nginx start<br>or<br>sudo systemctl start nginx</pre><p><strong>Stop Nginx</strong></p><pre>sudo service nginx stop<br>or<br>sudo systemctl stop nginx</pre><p><strong>Restart Nginx</strong></p><pre>sudo service nginx restart<br>or<br>sudo systemctl restart nginx</pre><p><strong>Check if nginx configuration is OK</strong></p><pre>// Root User<br>nginx -t</pre><pre>// Normal User<br>sudo nginx -t</pre><p>When we restart the server then nginx will not auto-restart. So to fix that use</p><pre>sudo systemctl enable nginx</pre><p>This command will create soft link of nginx service inside /usr/lib/systemd/system</p><p><strong>Nginx </strong>configuration can be found inside</p><pre>/etc/nginx</pre><p>Default Web Server Configuration can be found inside</p><pre>/etc/nginx/sites-available</pre><p>Nginx have two folders <em>sites-available </em>and <em>sites-enabled. </em>The default configuration file is</p><pre>000-default.conf</pre><p>To create your own web server configuration, just make a file with <strong>conf </strong>extension. Generally to be safe we just make a copy of default configuration.</p><p>You can create as many confiuration you want. All configuration will not be enabled/used.</p><p>To enable any server configuration we have to make a symbolic link of that config file into <strong>sites-enabled.</strong></p><p><strong>Don’t forgot to add semicolon in the last of the line.</strong></p><p>Our nginx file generally have below keywords/blocks.</p><ul><li><strong>server</strong>: It is main block of the file where we decide on which port our server will listen and from where it will serve the content for end-user</li><li><strong>listen</strong>: here we provide the port number where our server will accept the request. Default is 80 for no SSL certification and 443 with SSL certification.</li><li><strong>server_name</strong>: This is used to give our domain name. You can give name by space separated.</li><li><strong>location</strong>: It is a block to identify the requested URI and decide from where we should get the content to be served for end user. We can have as many location we want.</li><li><strong>error_page: </strong>It is used to specify the error content, in case any error happened like 404, 500, 502, 503 etc.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*aFxT8kuGWYPMfeSchwr4cA.png" /><figcaption>server.conf without SSL</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JPNJsp_esK0BLRkGlk8Faw.png" /><figcaption>server.conf with SSL</figcaption></figure><p>If we want to server content from an application which is running on PORT 5000 then we use Proxy Pass. If we only want to server static content from a file then we can use ROOT to specify that.</p><p>The above screenshot is the minimum required configuration. We can do more settings.</p><p>There are some more important setting which we should use whenever we are using Proxy-Pass and SSL.</p><p>We should override the header setting in proxy. Le understand why need to do this then we will see how to do this.</p><p>Let us suppose, we have an application which access the enduser Host, IP Address etc.</p><p>Since we have used nginx then what will happen whenever an user requested for an URL then it will come first to <strong>Nginx </strong>and then it will go on our application.</p><p>That’s why everytime the host in our application will be the host from where we getting the request that will be <strong>localhost. </strong>Because our nginx and application is running on same application</p><p>But we need end user details not our Nginx details, so we need to find a way to pass the header, which we received on Nginx to our application. To do this we need to add below settings outside the <strong>location block and inside the server block.</strong></p><pre>proxy_set_header Host $http_host;<br>proxy_set_header X-Real-IP $remote_addr;<br>proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br>proxy_http_version 1.1<br>proxy_cache_bypass $http_upgrade;</pre><p>For SSL configuration I will create a separate blogs. Please stay tunned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=faa6503371b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Third Story: Trait Setting in Grapes JS]]></title>
            <link>https://codedexterous.medium.com/third-story-trait-setting-in-grapes-js-dabb6bbc8125?source=rss-78ed20127943------2</link>
            <guid isPermaLink="false">https://medium.com/p/dabb6bbc8125</guid>
            <category><![CDATA[no-code]]></category>
            <category><![CDATA[grapesjs]]></category>
            <category><![CDATA[drag-and-drop]]></category>
            <category><![CDATA[zero-code]]></category>
            <dc:creator><![CDATA[Code Dexterous]]></dc:creator>
            <pubDate>Fri, 03 Sep 2021 05:08:08 GMT</pubDate>
            <atom:updated>2021-09-03T05:08:08.487Z</atom:updated>
            <content:encoded><![CDATA[<p>Traits define different parameters and behaviors of a component.</p><p>The user generally will see traits as the <em>Settings</em> of a component.</p><p>A common use of traits is to customize element attributes or you can also bind them to the properties of your components and react on their changes. <a href="https://grapesjs.com/docs/modules/Traits.html">https://grapesjs.com/docs/modules/Traits.html</a></p><p>But in our customization we do not have trait manager/setting. So let’s add it.</p><p>I just made some small changes in id and href to fix proper tab opening.</p><p>And also added one more tab for Trait Setting. You can simply copy below HTML there is nothing difficult here.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cb456ab4d593198385a77a1b7be9c720/href">https://medium.com/media/cb456ab4d593198385a77a1b7be9c720/href</a></iframe><p>Now it’s time for our setting in Grapes JS for Trait, Style Manager, Selector Manager.</p><p>For Style Manager we will add sectors where we can give what configuration you want to allow like dimension, width, height etc.</p><p>For Trait Manager and Selector Manager we will enable it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/39bbe776d4f1dba1b1f558602950c0b0/href">https://medium.com/media/39bbe776d4f1dba1b1f558602950c0b0/href</a></iframe><p>I also added some commands to switch different devices view like mobile, large screen.</p><p>If you want to follow this on youtube.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FtZVRRzgBuyM%3Flist%3DPLCl1SVi3yR4d4xwcnjn6cSjfKL-tDvOCx&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DtZVRRzgBuyM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FtZVRRzgBuyM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7e89bc0fc723165d049206a6866c51de/href">https://medium.com/media/7e89bc0fc723165d049206a6866c51de/href</a></iframe><p>Thanks see you next story.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dabb6bbc8125" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Second Story: Customize GrapesJS Editor]]></title>
            <link>https://codedexterous.medium.com/second-story-customize-grapesjs-editor-bbe2d91f5208?source=rss-78ed20127943------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbe2d91f5208</guid>
            <category><![CDATA[customize-ui]]></category>
            <category><![CDATA[grapesjs]]></category>
            <category><![CDATA[no-code-development]]></category>
            <category><![CDATA[no-code]]></category>
            <dc:creator><![CDATA[Code Dexterous]]></dc:creator>
            <pubDate>Thu, 11 Mar 2021 06:20:29 GMT</pubDate>
            <atom:updated>2021-03-13T06:52:20.675Z</atom:updated>
            <content:encoded><![CDATA[<p>GrapesJS is very flexible so it makes easy to customize it as we want.</p><p>In this I will try to customize it from default to our own way.</p><p>You can find the code in this section from <a href="https://github.com/vijayshukla30/grapesjs-example-html/tree/f9498c0dbbc27a5ab8c614f0055303af4ac51731">Github</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WjxbHxo_7ExcMIYDy5fRmA.png" /><figcaption>Default Example</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZbgBzcrz6nRRmwcwFAXONA.png" /><figcaption>Customize GrapesJS</figcaption></figure><p>If you wan to watch video insted of reading</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FFgPzDG1ePYs%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DFgPzDG1ePYs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FFgPzDG1ePYs%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5fba4c0db7b3d0614cf55d639fa55375/href">https://medium.com/media/5fba4c0db7b3d0614cf55d639fa55375/href</a></iframe><p>Let us creating the Layout i.e., SideNav, Main Content, Top Nav.</p><p>I am using Bootstrap 5 and Bootstrap Icons, so go ahead and add the library in index.html</p><p>And create layout</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a869b3508cfaa55432eab1c1525588fc/href">https://medium.com/media/a869b3508cfaa55432eab1c1525588fc/href</a></iframe><p>Add styling</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ca617205a0c75f8ce682b595740f53a6/href">https://medium.com/media/ca617205a0c75f8ce682b595740f53a6/href</a></iframe><p>This should look a like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5oHsIPWc_f3V8k3Ve_Ra0Q.png" /><figcaption>Layout prepared</figcaption></figure><p>Now let’s add GrapesJS in this.</p><p>There are some keypoints which we should understand first to make it works like</p><ul><li>Blocks Manager</li><li>Style Manager</li><li>Trait Manager</li><li>Selector Manager</li><li>etc</li></ul><p>To understand more please go to</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FMkIzdM9x6-w%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DMkIzdM9x6-w&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FMkIzdM9x6-w%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8fb673d638198916da08c136b9fb017e/href">https://medium.com/media/8fb673d638198916da08c136b9fb017e/href</a></iframe><p>So now add selectors in our HTML for the same.</p><p>Let us create 3 Tab from bootstrap documentation and it will look a like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3C38CUFkHufcUnaxtvrj6A.png" /><figcaption>Bootstrap Tab for GrapesJS</figcaption></figure><p>Now add selector for grapesjs components in tabs.</p><ul><li>for blocks I used first tab so add <em>&lt;div id=”blocks”&gt;&lt;/div&gt;</em></li><li>for selector/layer I used second tab so add <em>&lt;div id=”layers-container”&gt;&lt;/div&gt;</em></li><li>for style manager I used third tab so add <em>&lt;div id=”styles-container”&gt;&lt;/div&gt;</em></li><li>for canvas Iused <em>&lt;div id=”editor”&gt;&lt;/div&gt;</em> in main content</li><li>for panels I used main content nav-bar <em>&lt;div class=”container-fluid”&gt;&lt;div class=”panel__devices”&gt;&lt;/div&gt;&lt;div class=”panel__basic-actions”&gt;&lt;/div&gt;&lt;/div&gt;</em></li></ul><p>Final HTML will look like</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/54ee98608a889727148a10fc3a9e692e/href">https://medium.com/media/54ee98608a889727148a10fc3a9e692e/href</a></iframe><p>Now let move to JS and add script to load GrapesJS there.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6e05aa8b11e3d61ab847beced66da064/href">https://medium.com/media/6e05aa8b11e3d61ab847beced66da064/href</a></iframe><p>We have 3 commands for now in side nav</p><ul><li>to show border of the component</li><li>to show design in desktop</li><li>to show design in mobile</li></ul><p>and final CSS</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/063dd29bc80b1e0aa35928e7881bb9ee/href">https://medium.com/media/063dd29bc80b1e0aa35928e7881bb9ee/href</a></iframe><p>That’s it for now. See in you next story.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbe2d91f5208" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create your own Webpge/Website Builder]]></title>
            <link>https://codedexterous.medium.com/create-your-own-webpge-website-builder-8d77097585f8?source=rss-78ed20127943------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d77097585f8</guid>
            <category><![CDATA[website-builders]]></category>
            <category><![CDATA[builders]]></category>
            <category><![CDATA[webpage]]></category>
            <category><![CDATA[grapesjs]]></category>
            <category><![CDATA[no-code]]></category>
            <dc:creator><![CDATA[Code Dexterous]]></dc:creator>
            <pubDate>Thu, 11 Mar 2021 04:11:20 GMT</pubDate>
            <atom:updated>2021-03-11T04:17:19.615Z</atom:updated>
            <content:encoded><![CDATA[<p>We are going to use GrapesJS library to create our own Website builder.</p><p>Before we go on coding part let see the folder structure we follow.</p><p>We will VS-Code which is very lightweiight editor with bunch of functionalities and a lot of plugins to imrove our poductivity.</p><p>If you want to know about the VS-Code and plugins then let me know.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*FVpKSVF-xcSoVX4uKwaaEA.png" /><figcaption>Project Structure</figcaption></figure><p>I already have created a Video for this tutorial, if you prefer to watch the video instead of follow the video the please visit.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FrzdBImhhMaA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DrzdBImhhMaA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FrzdBImhhMaA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b0927a9edcc4d1c985958344350dede0/href">https://medium.com/media/b0927a9edcc4d1c985958344350dede0/href</a></iframe><p>You can find the code on github</p><p><a href="https://github.com/vijayshukla30/grapesjs-example-html">https://github.com/vijayshukla30/grapesjs-example-html</a></p><p>So let us start.</p><ul><li>Create a folder for our project</li><li>Open folder to VS-Code</li><li>Create folder structure as we have in above image</li><li>Create indext.html, css/main.scss, js/main.js</li></ul><p>I am using SCSS for our styling but we include main.css file in index.html. We used SCSS because it makes writing styling efficiently.</p><p>Copy <em>grapes.min.js</em>, <em>css/grapes.min.css </em>and <em>fonts</em> files from <a href="https://github.com/artf/grapesjs/tree/v0.16.44/dist">https://github.com/artf/grapesjs/tree/v0.16.44/dist</a> to our project or you can download the latest release.</p><p>Grapes JS has a lot of plugins which we can use, but for this project we are going to use <strong>GrapesJS Preset Webpage</strong> which is a combination of other plugins. In future we will create our own plugins too.</p><p>Now, copy <em>grapesjs-preset-webpage.min.js </em>and<em> grapesjs-preset-webpage.min.css </em>from<em> </em><a href="https://github.com/artf/grapesjs-preset-webpage/tree/master/dist">https://github.com/artf/grapesjs-preset-webpage/tree/master/dist</a></p><p>Now paster CSS to css/lib and JS to js/lib. That’s it for setup, now we are going to create our files.</p><p>Add below content in index.html</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/98be5f1bca3d8b721e82eacbf04e0bca/href">https://medium.com/media/98be5f1bca3d8b721e82eacbf04e0bca/href</a></iframe><p>I have added all libraries and created a div element with id <strong>editor.</strong></p><p>Add code in main.js</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0b9650fb6f4e831c6de9fba51b7cff5b/href">https://medium.com/media/0b9650fb6f4e831c6de9fba51b7cff5b/href</a></iframe><p>By default it uses localstorage of the browser.</p><p>There is nothing important in main.css but I don’t like the default Scroll so I just hide that but keeping the scroll functionality.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb14e3cdb26fdb3c376eeb3ade12864c/href">https://medium.com/media/eb14e3cdb26fdb3c376eeb3ade12864c/href</a></iframe><p>Tadadda.</p><p>This is the final result which we will have in browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WjxbHxo_7ExcMIYDy5fRmA.png" /><figcaption>Example of GrapesJS integrated.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d77097585f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Drag and Drop Webpage Builder — No/Zero Code Introduction]]></title>
            <link>https://codedexterous.medium.com/drag-and-drop-webpage-builder-no-zero-code-introduction-d7e0a61211e0?source=rss-78ed20127943------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7e0a61211e0</guid>
            <category><![CDATA[grapesjs]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[zero-code]]></category>
            <category><![CDATA[webpage]]></category>
            <category><![CDATA[no-code]]></category>
            <dc:creator><![CDATA[Code Dexterous]]></dc:creator>
            <pubDate>Thu, 11 Mar 2021 03:21:33 GMT</pubDate>
            <atom:updated>2021-03-11T03:21:33.163Z</atom:updated>
            <content:encoded><![CDATA[<h3>Drag and Drop Webpage Builder — No/Zero Code Introduction</h3><p>GrapesJS is a Free and Open Source Web Builder Framework.</p><p>If you are new to No-Code or Zero-Code Development please refer the below video it will give use a demo of most popular available options.</p><p><a href="https://www.youtube.com/watch?v=CtueAofTViM">https://www.youtube.com/watch?v=CtueAofTVi</a>M</p><p>GrapesJS is an open-source, multi-purpose, Web Builder Framework which combines different tools and features.</p><ul><li>Drag&amp;Drop Built-in Blocks</li><li>Limitless styling</li><li>Responsive design</li><li>The structure always under control</li><li>The code is there when you need it</li><li>Asset Manager</li></ul><p>To read more please visit <a href="https://grapesjs.com/">GrapesJS</a>.</p><p>For video example please visit.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FeqSDamJ0A0U%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DeqSDamJ0A0U&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FeqSDamJ0A0U%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ab8ba7bdbe1fb7474fc7e042ed46f3f/href">https://medium.com/media/0ab8ba7bdbe1fb7474fc7e042ed46f3f/href</a></iframe><p>I am going to create series of video which help us to integrate GrapesJS to create our own product which people can use to create their website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZbgBzcrz6nRRmwcwFAXONA.png" /><figcaption>Sample what we are going to achieve.</figcaption></figure><p>There are plenty of option of our own brilliancy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7e0a61211e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spring Cloud Bus]]></title>
            <link>https://codedexterous.medium.com/spring-cloud-bus-5d17fd26a053?source=rss-78ed20127943------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d17fd26a053</guid>
            <category><![CDATA[spring-cloud-bus]]></category>
            <category><![CDATA[rabbitmq]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Code Dexterous]]></dc:creator>
            <pubDate>Thu, 23 Jul 2020 03:47:35 GMT</pubDate>
            <atom:updated>2020-07-23T03:47:35.960Z</atom:updated>
            <content:encoded><![CDATA[<p>In our project whenever we do changes in Config Service then we have to restart all applications to load the changes in configurations.</p><p>This happens because all application load configuration only once at starting time.</p><p>We will AQMP to get things works, we will install RabbitMQ you can learn more in details online.</p><p>We are now going to add/use few more dependencies</p><ul><li>Actuator (add some features i.e., to check the status of the application)</li><li>Spring cloud Starter Bus AMQP</li></ul><p>Add these dependencies to all of your project:</p><blockquote>implementation ‘org.springframework.cloud:spring-cloud-starter-bus-amqp’</blockquote><blockquote>implementation ‘org.springframework.boot:spring-boot-starter-actuator’</blockquote><p><strong>Enable bus-refresh URL to refresh configuration using POST in Config Service</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I_eGhrGo3lwhk2sAqDhRRw.png" /></figure><p><strong>Install and run RabbitMQ Server</strong></p><p>Please follow official documentation for the same.</p><p><strong>Add RabbitMQ settings to all of the applications who want to connect with bus.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*YQjA179llB9-cn3BzVBLJg.png" /></figure><p>Just for testing purpose let add one more action/URL in User Service to read a property from Config Service and return it in response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GZvFUV9PU1ZNPwyEYSxKIw.png" /></figure><p>Start all the application and test this URL it should return like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C6QKB-Y8tDV1AXBumLcgmQ.png" /></figure><p>Now change the value in <strong>user-service.properties in Config Service </strong>then restart <strong>Config Service </strong>and use Spring Cloud Bus to broadcast the changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*7_R--AJGQaXiINyOg5-YGQ.png" /><figcaption>updated the value in config-service/user-service.properties</figcaption></figure><p>We have to send POST request to our <em>bus-service.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s053-JxvMQy0aIPFojrsRg.png" /></figure><p>Now no need to restart our User Service and let’s check we have updated value or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZNmUYv_2JHQBDksA61pnmA.png" /></figure><p>Now Spring Cloud Bus broadcast the new configuration to all services.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d17fd26a053" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Authentication in Gateway Service]]></title>
            <link>https://codedexterous.medium.com/authentication-in-gateway-service-ebaca7045a0f?source=rss-78ed20127943------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebaca7045a0f</guid>
            <category><![CDATA[spring-security]]></category>
            <category><![CDATA[gateway-service]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Code Dexterous]]></dc:creator>
            <pubDate>Sun, 12 Jul 2020 08:00:26 GMT</pubDate>
            <atom:updated>2020-07-23T03:23:11.249Z</atom:updated>
            <content:encoded><![CDATA[<p>Add below mention dependencies</p><p><em>// Spring Security</em></p><ul><li>compile ‘org.springframework.boot:spring-boot-starter-security’</li><li>compile ‘io.jsonwebtoken:jjwt:0.9.1’</li></ul><p>Add WebSecurity and Authorization Filter</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9415a40f01343825bd2030bacc1884fd/href">https://medium.com/media/9415a40f01343825bd2030bacc1884fd/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b25cfc02eefa2fb92a1bc950b9c56fbc/href">https://medium.com/media/b25cfc02eefa2fb92a1bc950b9c56fbc/href</a></iframe><p>We have loaded four environment variable and define that configuration in Config Service/gateway-service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*dgp2hlBqPlhk-KjIQ-hDnw.png" /></figure><p>That’s it now our API Gateway and User Service is protected with Spring Security. So let’s do some testing and try to create user and do login.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebaca7045a0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Authentication and Authorization in User Service]]></title>
            <link>https://codedexterous.medium.com/authentication-and-authorization-in-user-service-4ba3f8938355?source=rss-78ed20127943------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ba3f8938355</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[spring-security]]></category>
            <dc:creator><![CDATA[Code Dexterous]]></dc:creator>
            <pubDate>Sun, 12 Jul 2020 07:45:59 GMT</pubDate>
            <atom:updated>2020-07-23T03:29:02.915Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s add authentication and authorization in our User Service. I am not going to explain the Spring Security in details you can follow many documentation/blogs to understand it’s core.</p><p>But yes we are going to implement it with JWT and see it in action.</p><p>Let add some more dependencies to our User Service build.gradle file for the version you can refer maven.</p><p><em>// XML and JSON compatibility</em></p><ul><li>compile ‘com.fasterxml.jackson.core:jackson-core’</li><li>compile ‘com.fasterxml.jackson.core:jackson-databind’</li><li>compile ‘com.fasterxml.jackson.dataformat:jackson-dataformat-xml’</li><li>compile ‘org.modelmapper:modelmapper:2.3.8’</li></ul><p><em>// Spring Security</em></p><ul><li>compile ‘org.springframework.boot:spring-boot-starter-security’</li><li>compile ‘io.jsonwebtoken:jjwt:0.9.1’</li></ul><p><strong>Create a Model/Domain to hold User’s properties.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1978068851cd289035d3c4a2898115bf/href">https://medium.com/media/1978068851cd289035d3c4a2898115bf/href</a></iframe><p>Now create <strong>UserRepository</strong> to perform action from Database.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ef67aab7fe9f881f0b1b325848d049b0/href">https://medium.com/media/ef67aab7fe9f881f0b1b325848d049b0/href</a></iframe><p>Create <strong>UserService</strong> and it’s implementation class <strong>UserServiceImpl</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/319c9a197e2429028ed1aabeed78859c/href">https://medium.com/media/319c9a197e2429028ed1aabeed78859c/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c5ff2078b7d66fd8f991d8448cedbd9c/href">https://medium.com/media/c5ff2078b7d66fd8f991d8448cedbd9c/href</a></iframe><p>Now create a RestController to server responses for the requests</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba61b84108e333ac6e1c5fb7b944877c/href">https://medium.com/media/ba61b84108e333ac6e1c5fb7b944877c/href</a></iframe><p>Let’s Create two Command Object classes just to add a layer between request Model to Database Model.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/82f4722983ab4e812b3d5a4eae95262d/href">https://medium.com/media/82f4722983ab4e812b3d5a4eae95262d/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8ee0b422e319f655d930174cb78a4614/href">https://medium.com/media/8ee0b422e319f655d930174cb78a4614/href</a></iframe><p>Now add Spring Security Configuration.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ad181a9d607b8430805fbeca33276334/href">https://medium.com/media/ad181a9d607b8430805fbeca33276334/href</a></iframe><p>In WebSecurity we have used <strong>gatewayIp </strong>which only allow all request from API Gateway except that our User-Service will be not be accessible. We have add the configuration of <strong><em>gateway.ip </em></strong>in Config Service/user-service.properties.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ea8bb43d40e1dcf81133f77d333f04d0/href">https://medium.com/media/ea8bb43d40e1dcf81133f77d333f04d0/href</a></iframe><p>And this IP we got from our Eureka Service. So in future if our IP changes in Eureka then we have to do same changes in Config Service too. For development it may regular changes but on Server it might changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vdYmpNtlia9cKQzaqRj6IQ.png" /></figure><p>Create Filter</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7fbca19066bf0e5c4a732b5190996a4e/href">https://medium.com/media/7fbca19066bf0e5c4a732b5190996a4e/href</a></iframe><p>This is the required files to add Spring Security.</p><p>This is it for User Service now we have to add Security Check in our Gateway Service too so that we can expose some public URL like login, register etc.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ba3f8938355" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configure Config Service and Load Configuration to other services]]></title>
            <link>https://codedexterous.medium.com/configure-config-service-and-load-configuration-to-other-services-d8de59814a5f?source=rss-78ed20127943------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8de59814a5f</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[config-server]]></category>
            <dc:creator><![CDATA[Code Dexterous]]></dc:creator>
            <pubDate>Sun, 12 Jul 2020 06:13:24 GMT</pubDate>
            <atom:updated>2020-07-12T06:13:24.052Z</atom:updated>
            <content:encoded><![CDATA[<p>So now we are going to move our configurations of services to a centralized location and check it works or not.</p><p>When we choose filesystem as a configuration and we choose <strong>classpath </strong>then application.properties cannot be used to server same configuration to all but in case we choose <strong>file:// </strong>then we can create application.properties for common configuration.</p><p>Now create two properties files <strong>gateway-service.properties</strong> and <strong>user-service.properties </strong>name of the file is based on the name of the application given in application.properties of the services. In case if you change the name of the application (spring.application.name) then you also have to rename the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*VOQeNfwW-Uorr1NHny597A.png" /></figure><p>Move configuration from individual services to corresponding files.</p><p><strong>User Service</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*pBMjUeciRf55FI3YztTXRg.png" /><figcaption>application.properties</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UTL02_QaPR_bO89kIoSxaA.png" /><figcaption>user-service.properties</figcaption></figure><p><strong>Gateway Service</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*8wJCIJrMk3vrABjj0Na2QA.png" /><figcaption>application.properties</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*INNQ2ivtoCPFm3-_t7nweg.png" /><figcaption>gateway-service.properties</figcaption></figure><p>Now restart Config Service and then restart Gateway Service and User Service and it will works as before.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8de59814a5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Start and Test our skeleton services]]></title>
            <link>https://codedexterous.medium.com/start-and-test-our-skeleton-services-1dd60cbf0902?source=rss-78ed20127943------2</link>
            <guid isPermaLink="false">https://medium.com/p/1dd60cbf0902</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Code Dexterous]]></dc:creator>
            <pubDate>Sat, 11 Jul 2020 15:09:44 GMT</pubDate>
            <atom:updated>2020-07-11T15:09:44.761Z</atom:updated>
            <content:encoded><![CDATA[<h3>Config Service</h3><p>Started successfully on port 8012.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pQWxnfYDwql6VeIJ0b0KqQ.png" /></figure><h3>Eureka Service</h3><p>Application started successfully then open link in browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_SMv0UXKSGadokh59wUw7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hDb3NOSkgdWuxVw2xmH7YQ.png" /><figcaption>Eureka Dashboard</figcaption></figure><p>Some may occur an issue that application started but 404 coming when visited dashboard then add below configuration to fix that.</p><ul><li>spring.freemarker.template-loader-path=classpath:/templates/</li><li>spring.freemarker.prefer-file-system-access=false</li></ul><p>This happens because of below reasons</p><ul><li>Old cache or corrupted plugins caches</li><li>templates folder in bin</li><li>Themeleaf used in application because this dashboard is build using Freemarker.</li></ul><p>Please <a href="https://github.com/spring-cloud/spring-cloud-netflix/issues/3492">refer</a> for more.</p><h3>Gateway Service</h3><p>Application Started successfully</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9its2pHu_ky_qMVAadXUYg.png" /></figure><p>And also loading configuration from Config Service</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lYy2OonOaViYoDtSe-Cv2A.png" /></figure><p>It also registered with Eureka Service</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NKiQO_ptLjIHJK3NoW_c-w.png" /></figure><h3>User Service</h3><p>Since we have used MongoDB, JPA dependencies but haven’t done any configuration related to that so this will no start. So we have two solutions for this either we remove dependencies or wee configure it.</p><p>Let try to configure database in our user service to fix the issue.</p><ul><li>In our main class modify our <strong>SpringBootApplication </strong>annotation to <strong>SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })</strong></li></ul><p>This will tell that we are going to give Database Data source connectivity. And now file will be.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I0agaEZBVU3Yb-Y29UBg0A.png" /></figure><p>Add below configuration in application.properties. This is not good practice to add password like this we will use encryption but not right now.</p><p>spring.data.mongodb.authentication-database=admin</p><p>spring.data.mongodb.username=root</p><p>spring.data.mongodb.password=password</p><p>spring.data.mongodb.host=localhost</p><p>spring.data.mongodb.port=27017</p><p>spring.data.mongodb.database=microservice_dev</p><p>spring.jpa.properties.hibernate.show_sql=false</p><p>spring.jpa.properties.hibernate.use_sql_comments=false</p><p>spring.jpa.properties.hibernate.format_sql=true</p><p>spring.jpa.properties.hibernate.type=TRACE</p><p>spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy</p><p>spring.jpa.hibernate.ddl-auto=update</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ykGFTtsyTZhxq5AsTFBypg.png" /></figure><p>Now our application should be started and would be added in Eureka Service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RMJIFZw_ejrSF9BF2lq1bQ.png" /></figure><p>Since we haven’t configure port number and also configured how to register user-service so let start one more instance of user service to see how it looks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bh1saWbfQx2RZ5MKiVfqBw.png" /></figure><p>Finally that’s it all four service are up and running properly.</p><p>We have two major things to be consider</p><ul><li>We have to move some common configuration and specific configuration to be loaded from Config Service instead of application.properties of each application. By this way we will be able to manage most of the configuration at a single place and it will be get reflected to others.</li><li>Now whenever we do changes in Config Service then we have to restart our applications to reload the setting but this is not good for large infrastructure. So we have to use something to auto-reflect settings.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1dd60cbf0902" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>