<?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: Arman Kuanysh</title>
    <description>The latest articles on DEV Community by Arman Kuanysh (@armankuanysh).</description>
    <link>https://dev.to/armankuanysh</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%2F819234%2F2ee696da-e487-43b9-8a69-2276f006efa9.jpeg</url>
      <title>DEV Community: Arman Kuanysh</title>
      <link>https://dev.to/armankuanysh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/armankuanysh"/>
    <language>en</language>
    <item>
      <title>Why do I use Atomic Design?</title>
      <dc:creator>Arman Kuanysh</dc:creator>
      <pubDate>Mon, 21 Feb 2022 16:47:11 +0000</pubDate>
      <link>https://dev.to/armankuanysh/why-do-i-use-atomic-design-gdl</link>
      <guid>https://dev.to/armankuanysh/why-do-i-use-atomic-design-gdl</guid>
      <description>&lt;p&gt;It lasts for a couple of years, and I’m using an Atomic Design methodology to structure the components in the projects or products. So, that is why I want to discuss this topic.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the Atomic Design about?
&lt;/h2&gt;

&lt;p&gt;Atomic Design is a methodology in UI to develop an optimal design system for a project or a product. This methodology’s concept was formulated by Brad Frost, and the main purpose of this methodology is to focus on components than pages of UI.&lt;/p&gt;

&lt;p&gt;Nowadays, a lot of web applications were created using a component-oriented framework such as React.js, Vue.js, Angular or Svelte. So, with these frameworks creating reusable components is the main pattern to develop a web app.&lt;/p&gt;

&lt;p&gt;However, having a &lt;code&gt;components&lt;/code&gt; directory and storing all components of the project there could be uncomfortable with the lapse of time after project growth.&lt;/p&gt;

&lt;p&gt;So, Atomic Design provides some principles and stages of component development.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some principles
&lt;/h2&gt;

&lt;p&gt;Atomic Design methodology in development is associated with Component Driven Development, so, the principles are also.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First of all, the component has to be reusable&lt;/li&gt;
&lt;li&gt;The component has to be independent and encapsulated&lt;/li&gt;
&lt;li&gt;The component has to be focused on one piece of logic&lt;/li&gt;
&lt;li&gt;The component has to be easily testable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If we look at these principles, we can notice some similar meaning with SOLID principles.&lt;/p&gt;

&lt;p&gt;It means if we keep our component independent and encapsulated our component will adhere to the Open-Closed Principle of SOLID. Also, if we keep our component focused on one piece of logic it means that our component has a single responsibility which is the first principle of the SOLID. If we can easily reuse our component, it means this component also follows the DRY principle.&lt;/p&gt;

&lt;p&gt;What a fantasy! Knowing only one methodology can help us stick to the design principles and use their benefits.&lt;/p&gt;

&lt;h2&gt;
  
  
  Component development stages
&lt;/h2&gt;

&lt;p&gt;So, by Atomic Design methodology we need to divide our components into next types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;atoms&lt;/li&gt;
&lt;li&gt;molecules&lt;/li&gt;
&lt;li&gt;organisms&lt;/li&gt;
&lt;li&gt;templates&lt;/li&gt;
&lt;li&gt;pages&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Atoms
&lt;/h3&gt;

&lt;p&gt;Atoms are the smallest components, that are built using HTML tags. You can’t decompose them, because atoms are the bricks of the UI. For example, some atom components could be buttons, badges, labels, headings, and so on. Usually, they are stateless, and only encapsulates appearance styles.&lt;/p&gt;

&lt;h3&gt;
  
  
  Molecules
&lt;/h3&gt;

&lt;p&gt;Molecules are more complex components than atoms. Molecules can be built using atoms, and provide a unified piece of logic. For example, we need to create a navigation bar. So, we can use link atom components, group them together, and this would be our molecule component. Or, we need search input. We use an input atom component, button atom component, and the grouping of these components creates the molecule component.&lt;/p&gt;

&lt;h3&gt;
  
  
  Organisms
&lt;/h3&gt;

&lt;p&gt;Organisms are complex components that can be built using atoms and molecules. If atoms or molecules can be some abstract pieces, which couldn't have concrete logic or meaning, molecules have a specific meaning. For instance, using some atoms and molecules we can build a header component. We know why do we need the header, and we know how this component should behave.&lt;/p&gt;

&lt;h3&gt;
  
  
  Templates
&lt;/h3&gt;

&lt;p&gt;Templates are a composition of organisms, molecules, and atoms and provide a concrete UI structure. If we have a specific section in our project as ‘Latest news’ that could be rendered on several pages, this section has to be a template. So, we can simply reuse this template, and not be afraid that something could be messed up. Because all things that we need from this section are encapsulated inside of it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pages
&lt;/h3&gt;

&lt;p&gt;Pages are complex of templates and other components with content. So, if we have some bugs or another mess in UI, we can easily locate that and fix it in a related component.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This methodology is really helpful to create some large UI. Because it increases code reusability, maintainability, it makes debugging easier and improves composability, so you can just extend a component for a specific use-case.&lt;/p&gt;

&lt;p&gt;However, to keep your components clean, you have to avoid writing business logic in your components. Business logic should be placed at least at a store, better it should be decomposed for some repositories, services, and so on. UI should be UI, it’s a view layer of an app, left logic to the model, but it is an another story.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>architecture</category>
      <category>frontend</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Boilerplate generator for Vue.js?</title>
      <dc:creator>Arman Kuanysh</dc:creator>
      <pubDate>Mon, 21 Feb 2022 13:29:57 +0000</pubDate>
      <link>https://dev.to/armankuanysh/boilerplate-generator-for-vuejs-3bmf</link>
      <guid>https://dev.to/armankuanysh/boilerplate-generator-for-vuejs-3bmf</guid>
      <description>&lt;p&gt;Hello!&lt;/p&gt;

&lt;p&gt;The development of the web application is not only working with business logic, creating HTML layouts, and other interesting stuff. It also a facing a lot of routines such as creating directories, files, writing boilerplate code of a framework, writing documentation, and so on.&lt;/p&gt;

&lt;p&gt;However, some parts of this routine work we can easily automate.&lt;/p&gt;

&lt;p&gt;Somedays, I created a CLI tool to generate components for Vue.js projects only for personal use. And then, I realized, that this tool could be useful for other developers, to optimize their usual workflow.&lt;/p&gt;

&lt;p&gt;So, now I want to introduce you – VGENT.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/armankuanysh/vgent"&gt;VGENT&lt;/a&gt; (Vue Agent) – is a CLI tool to generate boilerplate Vue.js components. VGENT is compatible with Vue.js 2 and Vue.js 3, also with Nuxt.js, and allows you to customize it for any project needs that you may have.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing
&lt;/h2&gt;

&lt;p&gt;You can install VGENT to your local machine globally as npm package, and use it in any project. Besides, you can install it to your single project as a dev dependency.&lt;/p&gt;

&lt;p&gt;So, to install it globally, you need to run:&lt;br&gt;
&lt;/p&gt;

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

&lt;span class="c"&gt;# or&lt;/span&gt;

yarn global add vgent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And to install it for a single project:&lt;br&gt;
&lt;/p&gt;

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

&lt;span class="c"&gt;# or&lt;/span&gt;

yarn add &lt;span class="nt"&gt;--dev&lt;/span&gt; vgent
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But, if you are going to use it in the project, you need to run the commands through npx or yarn:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx vgent init

&lt;span class="c"&gt;# or&lt;/span&gt;

yarn vgent init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  So, how to use it?
&lt;/h2&gt;

&lt;p&gt;First of all, you need to initialize VGENT in the project and configure it depending on your needs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vgent init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the configuration step, VGENT will ask you about your project structure and component template types. So, you have to provide info about directories, where to store generated components, which programming language are you using JS or TS, which component API as an Options API or Composition API, perhaps Class components, and also about style pre-processor or simply CSS.&lt;/p&gt;

&lt;p&gt;Then VGENT will create a configuration file &lt;em&gt;.vgentrc&lt;/em&gt;, where you can change some configurations lately.&lt;/p&gt;

&lt;p&gt;So, after all the configuration steps, you can use commands to generate components and pages:&lt;/p&gt;

&lt;p&gt;To generate component run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vgent make &lt;span class="nt"&gt;-c&lt;/span&gt; &amp;lt;component_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But, if you are using an atomic design structure, you can provide also some arguments to declare a component type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# to generate an atom component use -a argument&lt;/span&gt;
vgent make &lt;span class="nt"&gt;-c&lt;/span&gt; &amp;lt;component_name&amp;gt; &lt;span class="nt"&gt;-a&lt;/span&gt;

&lt;span class="c"&gt;# to generate a molecule component use -m argument&lt;/span&gt;
vgent make &lt;span class="nt"&gt;-c&lt;/span&gt; &amp;lt;component_name&amp;gt; &lt;span class="nt"&gt;-m&lt;/span&gt;

&lt;span class="c"&gt;# to generate an organism component use -o argument&lt;/span&gt;
vgent make &lt;span class="nt"&gt;-c&lt;/span&gt; &amp;lt;component_name&amp;gt; &lt;span class="nt"&gt;-o&lt;/span&gt;

&lt;span class="c"&gt;# to generate a template component use -t argument&lt;/span&gt;
vgent make &lt;span class="nt"&gt;-c&lt;/span&gt; &amp;lt;component_name&amp;gt; &lt;span class="nt"&gt;-t&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And let’s talk about page generation, it’s also simple, just run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vgent make &lt;span class="nt"&gt;-p&lt;/span&gt; &amp;lt;page_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To generate dynamic pages, you can also provide some arguments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# to generate a slug page use --slug argument&lt;/span&gt;
vgent make &lt;span class="nt"&gt;-p&lt;/span&gt; &amp;lt;page_name&amp;gt; &lt;span class="nt"&gt;--slug&lt;/span&gt;

&lt;span class="c"&gt;# to generate an id page use --id argument&lt;/span&gt;
vgent make &lt;span class="nt"&gt;-p&lt;/span&gt; &amp;lt;page_name&amp;gt; &lt;span class="nt"&gt;--id&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I tried to cover a lot of scenarios of use, however, some of you probably use some other structures of components, and it would be great for me if you share your opinion and help me to improve this project.&lt;/p&gt;

&lt;p&gt;So, here are the links to &lt;a href="https://github.com/armankuanysh/vgent"&gt;GitHub&lt;/a&gt; and &lt;a href="https://www.npmjs.com/package/vgent"&gt;NPM&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>vue</category>
      <category>nuxt</category>
      <category>cli</category>
    </item>
  </channel>
</rss>
