<?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>Forem: Michał Dulik</title>
    <description>The latest articles on Forem by Michał Dulik (@michaldulik).</description>
    <link>https://forem.com/michaldulik</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%2F399568%2Ff268ed64-d997-4130-94a0-542b8e3fe294.jpg</url>
      <title>Forem: Michał Dulik</title>
      <link>https://forem.com/michaldulik</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/michaldulik"/>
    <language>en</language>
    <item>
      <title>Vue - App Architecture</title>
      <dc:creator>Michał Dulik</dc:creator>
      <pubDate>Tue, 24 Jan 2023 17:01:49 +0000</pubDate>
      <link>https://forem.com/michaldulik/vue-modular-architecture-1d4e</link>
      <guid>https://forem.com/michaldulik/vue-modular-architecture-1d4e</guid>
      <description>&lt;p&gt;When it comes to &lt;strong&gt;project structure&lt;/strong&gt; Vue has no documentation specifying a particular structure, it does provide a good starting layout (&lt;strong&gt;folder-by-type&lt;/strong&gt;) generated with Vue CLI.&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%2Fozf25zol2bmx4nfld1p0.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%2Fozf25zol2bmx4nfld1p0.png" alt="Folder-by-type Vue-CLI" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Folder by type&lt;/strong&gt; is the most common architecture in Vue projects, it is simple and comes by default with every Vue app created using &lt;strong&gt;Vue CLI&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;With this type of architecture you separate your files by types, for instance you store your components store routes utils etc. in their corresponding folders.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
└── src
    ├── main.ts  
    ├── App.vue          
    ├── assets
    │   └── logo.png  
    └── components
        └── HelloWorld.vue
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a pretty good architecture for small projects. However, as your app grows up you quickly notice that it becomes harder to navigate and develop, especially when you are focused on working on a specific feature.&lt;/p&gt;

&lt;p&gt;Let's say you have a store management application with three features, which are the orders, products and clients. Working on a product's feature, you have to jump between several folders (assets, components, routes, stores, tests, etc.) and find the files that correspond to that feature.&lt;/p&gt;

&lt;p&gt;When your project gets more and more features, this becomes really unmanageable, and you will end up with bloated component routes and store folders.&lt;/p&gt;

&lt;p&gt;Pros:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Most developers are familiar with this structure&lt;/li&gt;
&lt;li&gt;Ensures a flat folder structure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each directory contains items that usually aren't relative to each other&lt;/li&gt;
&lt;li&gt;It can get quite tricky to find out which files are used by which features&lt;/li&gt;
&lt;/ul&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%2Fu34s47zlxj1ymhca1lc1.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%2Fu34s47zlxj1ymhca1lc1.png" alt="Folder-by-feature" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Folder by feature or in other words, the &lt;strong&gt;modular architecture&lt;/strong&gt; puts all of your files related to a specific feature into its own folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
└── src
    ├── main.ts  
    ├── App.vue          
    ├── modules
        ├── products
        │   ├── image.jpg
        │   ├── ProductsModule.vue
        │   ├── routes.ts
        │   ├── index.ts
        │   └── ...
        ├── order
        │   └── ...
        └── client  
            └── ...
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can notice that in this architecture, the root folders in the modules directory hold only feature related files. &lt;/p&gt;

&lt;p&gt;Inside each module folder, you can have any structure that you want, as long as you expose the common module interface for registering it.&lt;/p&gt;

&lt;p&gt;However, if you use &lt;strong&gt;folder-by-feature&lt;/strong&gt;, you end up losing information about the type of file (because it's no longer in a components, store or assets folder).&lt;/p&gt;

&lt;p&gt;Pros:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The folder structure itself communicates the application features&lt;/li&gt;
&lt;li&gt;Separated files by feature&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sometime it is hard to draw the boundaries of the feature exactly&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Which is the right one to pick ?
&lt;/h2&gt;

&lt;p&gt;Unfortunately, there is no right or wrong here. Based on what I've seen, I can tell you that &lt;strong&gt;folder by feature&lt;/strong&gt; performs better when it comes to scaling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hybrid structure:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Use both folder-by-feature and folder-by-type&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
└── src
    ├── main.ts  
    ├── App.vue          
    ├── modules
        ├── core
        │   ├── components
        │   │   └── MyButton.vue
        │   └── store
        │   │   └── GlobalStore.ts
        │   └── ...
        ├── products
        │   ├── assets
        │   ├── components
        │   ├── pages
        │   ├── store
        │   ├── middlewares
        │   ├── ProductsModule.vue
        │   ├── routes.ts
        │   ├── index.ts
        │   └── ...
        ├── order
        │   └── ...
        └── client  
            └── ...
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we have mixed features and types folders:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;assets&lt;/code&gt;, &lt;code&gt;components&lt;/code&gt; and &lt;code&gt;middlewares&lt;/code&gt; are the &lt;strong&gt;type&lt;/strong&gt; ones&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;products&lt;/code&gt;, &lt;code&gt;orders&lt;/code&gt; and &lt;code&gt;clients&lt;/code&gt; are the &lt;strong&gt;features&lt;/strong&gt; &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Countless have been the hours of me trying to decide what structure to choose. I have tried both of them over the past years. I have come up to the conclusion that the Hybrid structure is the best one for me.&lt;/p&gt;

&lt;h2&gt;
  
  
  PS.
&lt;/h2&gt;

&lt;p&gt;I was thinking about making a tutorial series about Vue's modular app architecture. Let me know in the comments what you thinki about it.&lt;/p&gt;

&lt;p&gt;Bye ✋&lt;/p&gt;

</description>
      <category>learning</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Projects To Complete When Learning Web Development</title>
      <dc:creator>Michał Dulik</dc:creator>
      <pubDate>Sun, 12 Jul 2020 16:57:49 +0000</pubDate>
      <link>https://forem.com/michaldulik/projects-to-complete-when-learning-web-development-4bf6</link>
      <guid>https://forem.com/michaldulik/projects-to-complete-when-learning-web-development-4bf6</guid>
      <description>&lt;p&gt;If you’re intermediate beginner web developer, you have probably run into the wall. The basic tutorials are too easy now. But it’s hard to figure out what to code.&lt;/p&gt;

&lt;p&gt;You are probably looking for project ideas with quality design. Fortunately, there is &lt;a href="https://devchallenges.io" rel="noopener noreferrer"&gt;devchallenges.io&lt;/a&gt;, completly &lt;strong&gt;free&lt;/strong&gt; website where each challenge is different and will test you different aspects of coding. It includes small user stories and beautiful designs.&lt;/p&gt;

&lt;p&gt;When you complete a challenge, you submit your solution, which can be shared with others. Solutions page is a good place for people to learn from each other. It is for you to share your thought and help others.&lt;/p&gt;

&lt;h2&gt;
  
  
  Here are some sample projects
&lt;/h2&gt;

&lt;p&gt;You should visit &lt;a href="https://devchallenges.io" rel="noopener noreferrer"&gt;devchallenges.io&lt;/a&gt; for more ideas.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://devchallenges.io/challenges/TtUjDt19eIHxNQ4n5jps" rel="noopener noreferrer"&gt;Job Board App&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Fdevchallenges-1234.appspot.com%2Fo%2FchallengesDesigns%252FJobSearchThumbnail.png%3Falt%3Dmedia%26token%3D59d40095-f280-478f-a8c9-dc9d49f14471" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Fdevchallenges-1234.appspot.com%2Fo%2FchallengesDesigns%252FJobSearchThumbnail.png%3Falt%3Dmedia%26token%3D59d40095-f280-478f-a8c9-dc9d49f14471" alt="Github jobs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://devchallenges.io/challenges/Bu3G2irnaXmfwQ8sZkw8" rel="noopener noreferrer"&gt;Quizz App&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Fdevchallenges-1234.appspot.com%2Fo%2FchallengesDesigns%252FcountryQuizThumbnail.png%3Falt%3Dmedia%26token%3D761f3109-120d-4111-96b3-98ef934281b6" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Fdevchallenges-1234.appspot.com%2Fo%2FchallengesDesigns%252FcountryQuizThumbnail.png%3Falt%3Dmedia%26token%3D761f3109-120d-4111-96b3-98ef934281b6" alt="Quizz app"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://devchallenges.io/challenges/rYyhwJAxMfES5jNQ9YsP" rel="noopener noreferrer"&gt;Unsplash clone&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Fdevchallenges-1234.appspot.com%2Fo%2FchallengesDesigns%252FMy%2520unsplashThumbnail.png%3Falt%3Dmedia%26token%3Dc5ea0403-4e16-4b70-a70c-cf14cf66b106" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Fdevchallenges-1234.appspot.com%2Fo%2FchallengesDesigns%252FMy%2520unsplashThumbnail.png%3Falt%3Dmedia%26token%3Dc5ea0403-4e16-4b70-a70c-cf14cf66b106" alt="Unsplash clone"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://devchallenges.io/challenges/0J1NxxGhOUYVqihwegfO" rel="noopener noreferrer"&gt;Checkout page&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Fdevchallenges-1234.appspot.com%2Fo%2FchallengesDesigns%252FCheckoutThumbnail.png%3Falt%3Dmedia%26token%3Dc7ffdbe3-7206-44f2-b1e6-a6b99bf81901" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Fdevchallenges-1234.appspot.com%2Fo%2FchallengesDesigns%252FCheckoutThumbnail.png%3Falt%3Dmedia%26token%3Dc7ffdbe3-7206-44f2-b1e6-a6b99bf81901" alt="Checkout page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Author of devchallenges.io
&lt;/h3&gt;


&lt;div class="ltag__user ltag__user__id__367332"&gt;
    &lt;a href="/nghiemthu" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F367332%2F542beb5e-8a86-44eb-a167-090815ae4ecd.jpg" alt="nghiemthu image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/nghiemthu"&gt;Thu Nghiem&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/nghiemthu"&gt;Creator of devchallenges.io, Software developer at Telia Finland&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


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