<?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: Fazlul Kabir</title>
    <description>The latest articles on Forem by Fazlul Kabir (@zisan34).</description>
    <link>https://forem.com/zisan34</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%2F532085%2F51bc9e97-ddf7-454e-8458-ccc85eae7c05.jpg</url>
      <title>Forem: Fazlul Kabir</title>
      <link>https://forem.com/zisan34</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/zisan34"/>
    <language>en</language>
    <item>
      <title>How I structured my first Express App</title>
      <dc:creator>Fazlul Kabir</dc:creator>
      <pubDate>Sun, 07 Nov 2021 13:14:27 +0000</pubDate>
      <link>https://forem.com/zisan34/how-i-structured-my-first-express-app-20ik</link>
      <guid>https://forem.com/zisan34/how-i-structured-my-first-express-app-20ik</guid>
      <description>&lt;p&gt;I’m pretty much a beginner dev, working for 2years as a developer. During this period most of the time, I’ve used PHP as backend but recently my company assigned me to a project in which I had to use Node(Express) as backend. So here’s the story about my first MERN stack app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TLDR&lt;/strong&gt;&lt;/p&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv2zzgdz8wx21xhtjviw8.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv2zzgdz8wx21xhtjviw8.png" alt="Final Directory Structure of the App"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Some background story
&lt;/h3&gt;

&lt;p&gt;During this short period of my career, I got the opportunity to work with several technologies. As I’m working as a Full-Stack dev so previously I had hands-on experience with Laravel, React, Vue, Mysql other related techs. I was very excited when my company assigned me to a MERN stack app. That was a huge transition. I took that as a challenge and decided that I’d prepare myself for larger apps built with the MERN stack. So that’s why even the purpose of the app is simple but the structure is not. Basically, this is a custom &lt;a href="https://shopify.dev/apps" rel="noopener noreferrer"&gt;Shopify app&lt;/a&gt; that will maintain shipping service(&lt;a href="https://shopify.dev/api/admin/rest/reference/shipping-and-fulfillment/carrierservice" rel="noopener noreferrer"&gt;carrier service&lt;/a&gt;) including tons of conditions for a Shopify store.&lt;/p&gt;

&lt;h3&gt;
  
  
  Let’s Dive into it
&lt;/h3&gt;

&lt;p&gt;It’s true that my project structure is pretty much inspired by &lt;a href="https://laravel.com" rel="noopener noreferrer"&gt;Laravel&lt;/a&gt; because I’m familiar with that &amp;amp; I love the structure. So my project has two main directories “&lt;strong&gt;&lt;em&gt;backend&lt;/em&gt;&lt;/strong&gt;” &amp;amp; “&lt;strong&gt;&lt;em&gt;frontend&lt;/em&gt;&lt;/strong&gt;”. In the &lt;strong&gt;&lt;em&gt;backend&lt;/em&gt;&lt;/strong&gt; directory lies the express app &amp;amp; in the &lt;strong&gt;&lt;em&gt;frontend&lt;/em&gt;&lt;/strong&gt; directory lies the react app. The reason for this is I wanted to reduce the deployment complexity. So for the &lt;strong&gt;&lt;em&gt;frontend&lt;/em&gt;&lt;/strong&gt; Webpack is used to compile the react app &amp;amp; export it to a single file which I later include as a script in the backend(in an ejs file). Yes, pretty much what Laravel-mix does. The weird thing is project has one package.json file which holds both frontend and backend dependencies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Backend Directory&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the root of the &lt;strong&gt;&lt;em&gt;backend&lt;/em&gt;&lt;/strong&gt; directory, there are two files one is &lt;em&gt;index.js&lt;/em&gt; which is responsible for serving the app to a specific port &amp;amp; connecting to MongoDB, Redis etc. another one is &lt;em&gt;app.js&lt;/em&gt; which is responsible for booting the express app, top-level middlewares, including the route files etc.&lt;/p&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft7dnch5hk81jbh8109xo.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft7dnch5hk81jbh8109xo.png" alt="The index.js file"&gt;&lt;/a&gt;&lt;/p&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnvuutbn1jbet3d378jtg.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnvuutbn1jbet3d378jtg.png" alt="The app.js file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Subdirectories in backend&lt;/p&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpm99wb6cjwzqsmygsuc7.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpm99wb6cjwzqsmygsuc7.png" alt="All the subdirectories of the backend"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think most of the things are self-explanatory so I won’t discuss them all. In the &lt;strong&gt;&lt;em&gt;config&lt;/em&gt;&lt;/strong&gt; directory, I’ve got a few config files that hold configuration variables, next the &lt;strong&gt;&lt;em&gt;controllers&lt;/em&gt;&lt;/strong&gt; directory have 3 subdirectories that are responsible for responding to different kind of requests. I hate to write business logic at the controller level, so I’ve got service classes in the &lt;strong&gt;&lt;em&gt;services&lt;/em&gt;&lt;/strong&gt; directory, where lies all the business logic. The &lt;strong&gt;&lt;em&gt;views&lt;/em&gt;&lt;/strong&gt; directory holds ejs files which will be responded to web routes. Also one of the ejs files is responsible to serve the compiled react app.&lt;/p&gt;

&lt;p&gt;Next, I wanna say what I’m missing from Laravel, which is the Laravel &lt;a href="https://laravel.com/docs/8.x/queues#introduction" rel="noopener noreferrer"&gt;job queue&lt;/a&gt;. So I managed to find almost something similar named &lt;a href="https://github.com/OptimalBits/bull" rel="noopener noreferrer"&gt;bull&lt;/a&gt; for node.js but I want more features like retrying the jobs, scheduling them etc. which I couldn’t find. I would be grateful if someone can suggest something.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Frontend Directory&lt;/strong&gt;&lt;/p&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2bwsq3v153i23p2ofqr7.png" 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2bwsq3v153i23p2ofqr7.png" alt="All the subdirectories of the frontend"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;&lt;em&gt;frontend&lt;/em&gt;&lt;/strong&gt; directory is pretty simple it has an entry point which holds the root react component. There are 3 subdirectories named &lt;strong&gt;&lt;em&gt;components&lt;/em&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;em&gt;Helpers&lt;/em&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;em&gt;sass&lt;/em&gt;&lt;/strong&gt;. The components directory holds pages level components in &lt;strong&gt;&lt;em&gt;pages&lt;/em&gt;&lt;/strong&gt; sub dir &amp;amp; other reusable components in &lt;strong&gt;&lt;em&gt;utils&lt;/em&gt;&lt;/strong&gt; sub dir. Next, the &lt;strong&gt;&lt;em&gt;Helpers&lt;/em&gt;&lt;/strong&gt; directory contains some helper functions &amp;amp; classes &amp;amp; the &lt;strong&gt;&lt;em&gt;sass&lt;/em&gt;&lt;/strong&gt; directory holds sass files for styling.&lt;/p&gt;

&lt;p&gt;The frontend is later compiled via the Webpack, babel and exported to the &lt;strong&gt;&lt;em&gt;public/assets&lt;/em&gt;&lt;/strong&gt; directory. Which I later include in an ejs file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;If any experienced developer reads this post first reaction will be “your package.json must be messed up”. Yeah, I know that, but within that short period of time, it was the most practical approach I found for faster development &amp;amp; easy deployment.&lt;/p&gt;

&lt;p&gt;Oh, I forgot to mention that this is my first tech blog post. So please pardon my lack of knowledge &amp;amp; experience. And I’d be very much grateful if I could have some suggestions about how things could be done in a better way. Also, I’m still looking for a job-queue package which is similar to Laravel so, suggestions are appreciated.&lt;/p&gt;

</description>
      <category>node</category>
      <category>express</category>
      <category>mongodb</category>
      <category>react</category>
    </item>
    <item>
      <title>About Me</title>
      <dc:creator>Fazlul Kabir</dc:creator>
      <pubDate>Sat, 06 Nov 2021 10:47:35 +0000</pubDate>
      <link>https://forem.com/zisan34/about-me-4hcg</link>
      <guid>https://forem.com/zisan34/about-me-4hcg</guid>
      <description>&lt;h2&gt;
  
  
  About Me
&lt;/h2&gt;

&lt;p&gt;Hey, I’m &lt;strong&gt;Fazlul Kabir&lt;/strong&gt;. Currently working as “Full-Stack Developer” at “&lt;a href="https://aivalabs.com"&gt;Aiva Labs Inc.&lt;/a&gt;”.&lt;/p&gt;

&lt;p&gt;I’ve been working in the software engineering field for over 2 years. I’ve got excellent knowledge of web technologies like &lt;strong&gt;PHP, Laravel, Javascript, Node.js, Express, React, Vue.js, Inertia.js, JQuery, MYSQL, MongoDB, HTML, CSS, Sass&lt;/strong&gt;. I have experience in developing custom and dynamic web applications. I have strong knowledge about OOP, MVC framework, SOLID &amp;amp; DRY principles &amp;amp; also on RESTful API development.&lt;/p&gt;

&lt;p&gt;I love building things. While hard engineering problems are often intrinsically fun to tackle, I’m most attracted to solving real customer problems with a business justification.&lt;/p&gt;

&lt;h2&gt;
  
  
  Work Experience
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Full-Stack Developer at &lt;a href="https://aivalabs.com"&gt;Aiva Labs Inc.&lt;/a&gt; (03/2021-Present)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Jr. Laravel Web Apps Developer at &lt;a href="https://itclanbd.com/"&gt;ITCLAN BD&lt;/a&gt; (03/2020–03/2021)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Jr. Software Engineer at &lt;a href="https://www.nextgenitltd.com"&gt;NEXTGEN IT LTD&lt;/a&gt; (09/2019–02/2020)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Technologies I consider as my skill
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;PHP&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Laravel&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Javascript&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Node.js&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;React&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Vue.js&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;jQuery&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Inertia.js&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;MySql&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;MongoDB&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;HTML&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CSS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Sass&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;VCS(Git)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;REST API&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GraphQL&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Shopify(App Development)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Field of Interest
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;System design &amp;amp; architect&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Server load balancing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Database Optimization&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CI/CD&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AI(ML)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Education
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;BSc. Engineering in &lt;a href="https://nstu.edu.bd/department/cste"&gt;Computer Science and Telecommunication Engineering&lt;/a&gt;, &lt;a href="https://nstu.edu.bd"&gt;Noakhali Science and Technology University, Noakhali, Bangladesh&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;HSC in Science, &lt;a href="https://www.cvgc.edu.bd"&gt;Comilla Victoria Govt. College, Comilla, Bangladesh&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SSC in Science, &lt;a href="http://www.czs.edu.bd"&gt;Comilla Zilla School, Comilla, Bangladesh&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Other Activities
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Competitive Programming (Stopstalk profile: &lt;a href="https://www.stopstalk.com/user/profile/fazlul_kabir"&gt;fazlul_kabir&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Former General Secretary, CSTE Club (2018–2019), NSTU&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Find Me Here
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://www.linkedin.com/in/fazlulkabir34"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://twitter.com/fazlul_34"&gt;Twitter&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://fazlulkabir34.medium.com"&gt;Medium&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/zisan34"&gt;Dev.to&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>about</category>
    </item>
  </channel>
</rss>
