<?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: Ilyos Olimov</title>
    <description>The latest articles on Forem by Ilyos Olimov (@ilyosdev).</description>
    <link>https://forem.com/ilyosdev</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%2F91966%2F9792d2c3-2f14-499c-8db2-d8b1b4de8035.jpg</url>
      <title>Forem: Ilyos Olimov</title>
      <link>https://forem.com/ilyosdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ilyosdev"/>
    <language>en</language>
    <item>
      <title>Setting up new project</title>
      <dc:creator>Ilyos Olimov</dc:creator>
      <pubDate>Thu, 23 Sep 2021 09:36:43 +0000</pubDate>
      <link>https://forem.com/ilyosdev/setting-up-new-project-57h8</link>
      <guid>https://forem.com/ilyosdev/setting-up-new-project-57h8</guid>
      <description>&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%2Fovaem45ea3lmxe4josic.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%2Fovaem45ea3lmxe4josic.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What do you know about solid, kiss and bunch of other things?&lt;br&gt;
Fug them.&lt;br&gt;
When you are writing any kind of code. Just write and see the result. You do not like it? Go change it. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Do not forget one thing, Rome is not built in one day or night 😉&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let`s assume we all have nodejs installed. Create folder named like boilerplate and open that folder in your code editor.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;initiate - &lt;code&gt;npm init -y&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I like MVC, like a lot. So create bunch of folders such as controllers, models, services, middlewares, database(migrations, seeds), utils&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%2Fxrw1jcl75r2m5mexeza2.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%2Fxrw1jcl75r2m5mexeza2.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Install necessary packages
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;npm install knex -g&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;npm install objection knex mysql --save&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;npm install express dotenv --save&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Go grab the code from &lt;a href="https://github.com/ilyosdev/boilerplate" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;br&gt;
and continue.&lt;/p&gt;

&lt;p&gt;First of all check the codebase, if you like it you are more than welcome to use it. If no, what the hell are you doing here then? Go leave my blog. Kidding 😁.&lt;/p&gt;

&lt;p&gt;Let me show you some things here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;npx knex migrate:make posts&lt;/code&gt; - this will create migration file&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;npx knex migrate:latest&lt;/code&gt; - this will create tables in your db&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;npx knex migrate:rollback&lt;/code&gt; - if you forgot something to add in your latest migration and you change it, try this then you are good to migrate again, without this your terminal spits right in your face.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;npx knex seed:make posts&lt;/code&gt; - this creates file which you can populate with good old friend faker then you can insert it with &lt;code&gt;npx knex seed:run&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>express</category>
      <category>knex</category>
      <category>objection</category>
    </item>
  </channel>
</rss>
