<?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: Nards Paragas</title>
    <description>The latest articles on DEV Community by Nards Paragas (@nards_paragas).</description>
    <link>https://dev.to/nards_paragas</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%2F153708%2F2f3e1bbb-8db9-4f9d-9a4f-a319c02ef398.png</url>
      <title>DEV Community: Nards Paragas</title>
      <link>https://dev.to/nards_paragas</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nards_paragas"/>
    <language>en</language>
    <item>
      <title>On Ruby on Rails: My love–hate relationship with a mature framework.</title>
      <dc:creator>Nards Paragas</dc:creator>
      <pubDate>Mon, 26 Apr 2021 05:44:35 +0000</pubDate>
      <link>https://dev.to/nards_paragas/on-ruby-on-rails-my-love-hate-relationship-with-a-mature-framework-3ep</link>
      <guid>https://dev.to/nards_paragas/on-ruby-on-rails-my-love-hate-relationship-with-a-mature-framework-3ep</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;One's personal opinions and encounters as an "immigrant" in a foreign domain.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Rails&lt;/strong&gt; is not as prominent as it was in its glory days. Especially here in the Philippines, after doing a quick research out of curiosity and browsing through PHRUG's Facebook Group (Philippines - Ruby Users Group), it seems like everybody's sunsetting Ruby as their first choice for web development or just uses it for &lt;em&gt;happy path apps&lt;/em&gt; and &lt;em&gt;MVPs&lt;/em&gt; then leaves it off for something more "scalable".&lt;/p&gt;

&lt;p&gt;And, as someone who came in late to the party (2019), I felt so alienated and it was a scary thing to feel when you're in the fast moving world of tech. While there's a lot of fresh hotness coming out almost everyday, I'm now stuck learning an old &lt;em&gt;not-talk-of-the-town&lt;/em&gt; programming language which could define my career in the coming years.&lt;/p&gt;

&lt;p&gt;When I first touched Rails, I wasn't amazed or even surprised because out of all of the things it offers, Laravel has already shown me or did better. That said, I couldn't shake the constant resistance I'm having while writing code in this framework. I was even annoyed by the idea of &lt;a href="https://guides.rubyonrails.org/v5.2/autoloading_and_reloading_constants.html" rel="noopener noreferrer"&gt;autoloading&lt;/a&gt; since I was used to importing classes and packages explicitly. Maybe it was also one of the main reasons why I had a hard time transitioning from PHP to Ruby, I just can't stop comparing the two. &lt;em&gt;Rubyists&lt;/em&gt; might call me out for this but if you came from PHP and Laravel like me, you won't be able to deny that &lt;a href="https://twitter.com/taylorotwell" rel="noopener noreferrer"&gt;Taylor Otwell&lt;/a&gt; and his community of contributors move fast. They release new and amazing features or even products related to Laravel almost every quarter per year. Although there's this stigma against PHP that people can't seem to forget, their team's persistence is paying off.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BUT&lt;/strong&gt;, I never felt like I'm composing a song with any other language than Ruby. It lives up to its label, it really is &lt;em&gt;elegant&lt;/em&gt;. It has all the right recipes to please a developer. I've written in one of the most hated languages (PHP) and I learned that it's not that bad and now I met Ruby which is just outright beautiful to the eyes at first take. Yes, it does have some quirks but we all know by now that not everything, even in tech, is perfect. It's just that, to me, Ruby is the closest thing to perfection for developer experience. Then you wrap it around an easy to grasp structure that is Rails and &lt;em&gt;voilà!&lt;/em&gt; — Now you have a solid and reliable tool at your disposal.&lt;/p&gt;

&lt;p&gt;And so, I dug deeper, looked for resources similar to &lt;a href="https://phptherightway.com/" rel="noopener noreferrer"&gt;&lt;em&gt;phptherightway&lt;/em&gt;&lt;/a&gt; or videos like Christoph Rumpel's &lt;a href="https://laravelcoreadventures.com/" rel="noopener noreferrer"&gt;&lt;em&gt;Laravel Core Adventures&lt;/em&gt;&lt;/a&gt; which helped me understand how a backend web framework works under the hood. Of course I'm aware that I'm going to have some sort of a hard time looking for resources for something old and mature but I insisted because I thought that if I'm going to learn Rails then I don't want to &lt;em&gt;wing it&lt;/em&gt; but do it lovingly.&lt;/p&gt;

&lt;p&gt;At first, I found books and video tutorials but they're badly outdated so I continued my search. Then, I learned about none other than the creator of Rails himself, &lt;a href="https://twitter.com/dhh" rel="noopener noreferrer"&gt;DHH&lt;/a&gt;. Which resulted to me falling into a rabbit hole of Basecamp &lt;a href="https://archive.signalvnoise.com/" rel="noopener noreferrer"&gt;wonderland&lt;/a&gt;. One short read lead to another, next thing I know I found myself watching DHH's &lt;a href="https://www.youtube.com/watch?v=wXaC0YvDgIo&amp;amp;list=PL9wALaIpe0Py6E_oHCgTrD6FvFETwJLlx" rel="noopener noreferrer"&gt;&lt;em&gt;On Writing Software Well&lt;/em&gt;&lt;/a&gt; which inspired me to look for more fun stuff. Another series of Google searches happened and suddenly I found myself having fun watching &lt;a href="https://twitter.com/sandimetz" rel="noopener noreferrer"&gt;Sandi Metz&lt;/a&gt; talk, checking out &lt;a href="https://sandimetz.com/99bottles" rel="noopener noreferrer"&gt;&lt;em&gt;99 bottles&lt;/em&gt;&lt;/a&gt;, visiting &lt;a href="http://refactoring.guru/" rel="noopener noreferrer"&gt;refactoring.guru&lt;/a&gt;, getting to know about the &lt;em&gt;gang of four&lt;/em&gt; and restarting my Ruby journey with &lt;a href="https://poignant.guide/" rel="noopener noreferrer"&gt;poignant.guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I'm still finding new stuff but I'm focusing on them one at a time. Now, this made me realize that I might've just fallen in love really. Maybe people left Rails because of its &lt;em&gt;magic&lt;/em&gt; and simplicity but few might've remained because it's just comfortable to work with. With all that, here I am, starting again; doing a Ruby refresher and building small web apps using Rails. &lt;em&gt;Treading unknown waters but with enough courage to do so&lt;/em&gt;.&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>Setup a Fresh Rails Project with asdf</title>
      <dc:creator>Nards Paragas</dc:creator>
      <pubDate>Sun, 18 Apr 2021 07:48:13 +0000</pubDate>
      <link>https://dev.to/nards_paragas/setup-a-fresh-rails-project-with-asdf-32he</link>
      <guid>https://dev.to/nards_paragas/setup-a-fresh-rails-project-with-asdf-32he</guid>
      <description>&lt;p&gt;Right now, almost half of my career was spent writing PHP code in Laravel. It was my first encounter with the MVC world, I fell in love immediately and it was easy to build products with it. The joy of putting up a quick project within minutes by the use of artisan commands and rapid scaffolding generation was definitely hard to reject as a developer. Then, I met Ruby and the mature yet reliable Rails. I discovered that the &lt;em&gt;Build a blog in 15 minutes&lt;/em&gt; wasn't a well-known thing until &lt;a href="https://twitter.com/dhh" rel="noopener noreferrer"&gt;DHH&lt;/a&gt; &lt;a href="https://youtu.be/Gzj723LkRJY" rel="noopener noreferrer"&gt;demonstrated&lt;/a&gt; how possible it is using a newly introduced web framework back in 2005. In this post, I'm going to share how a developer can spin up a fresh Ruby on Rails project with &lt;a href="https://github.com/asdf-vm/asdf" rel="noopener noreferrer"&gt;asdf&lt;/a&gt; in 2021.&lt;/p&gt;

&lt;p&gt;In this setup guide, I'm working with a &lt;em&gt;WSL2 + Ubuntu 20.04&lt;/em&gt; environment so it might be different to yours. If you're on a UNIX-based system, that shouldn't stop you from following through. In addition, you might want to swap out that SQLite with a fresh PostgreSQL install (I'm not going to teach this now but you can search for a bunch of articles online that will help you out depending on your machine). Now, let's get started!&lt;/p&gt;

&lt;p&gt;Let's install &lt;em&gt;asdf&lt;/em&gt; on our machine. We need &lt;code&gt;git&lt;/code&gt; as it is a dependency before you can get &lt;em&gt;asdf&lt;/em&gt; so make sure you have that as well. Also, &lt;em&gt;asdf&lt;/em&gt; has a pretty straightforward &lt;a href="https://asdf-vm.com/#/core-manage-asdf" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; so definitely check it out if you can.&lt;/p&gt;

&lt;p&gt;First, let's clone the latest branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  git clone https://github.com/asdf-vm/asdf.git ~/.asdf &lt;span class="nt"&gt;--branch&lt;/span&gt; v0.8.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then let's add it to our shell.&lt;/p&gt;

&lt;p&gt;If you're on &lt;em&gt;Bash&lt;/em&gt; or &lt;em&gt;ZSH&lt;/em&gt;, add the following to your &lt;code&gt;~/.bashrc&lt;/code&gt; or &lt;code&gt;~/.zshrc&lt;/code&gt;:&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="nb"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$HOME&lt;/span&gt;/.asdf/asdf.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're a &lt;em&gt;Fish&lt;/em&gt; user, add this to your &lt;code&gt;~/.config/fish/config.fish&lt;/code&gt; instead:&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="nb"&gt;source&lt;/span&gt; ~/.asdf/asdf.fish
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We have to do some manual configuration of our settings for the completion feature. For &lt;em&gt;Bash&lt;/em&gt;, add the following on your &lt;code&gt;~/.bashrc&lt;/code&gt;:&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="nb"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$HOME&lt;/span&gt;/.asdf/completions/asdf.bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On &lt;em&gt;ZSH&lt;/em&gt;, add these to your &lt;code&gt;~/.zshrc&lt;/code&gt;:&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;# append completions to fpath&lt;/span&gt;
  &lt;span class="nv"&gt;fpath&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;ASDF_DIR&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/completions &lt;span class="nv"&gt;$fpath&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="c"&gt;# initialise completions with ZSH's compinit&lt;/span&gt;
  autoload &lt;span class="nt"&gt;-Uz&lt;/span&gt; compinit
  compinit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For &lt;em&gt;Fish&lt;/em&gt;, run the following command on your console:&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="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.config/fish/completions&lt;span class="p"&gt;;&lt;/span&gt; and &lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; ~/.asdf/completions/asdf.fish ~/.config/fish/completions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Done! That should be enough to get &lt;code&gt;asdf&lt;/code&gt; installed on your machine. If you're having issues, check &lt;a href="https://asdf-vm.com/#/core-manage-asdf?id=having-issues" rel="noopener noreferrer"&gt;this&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now let's go to the next step which is to install the necessary plugins to create our Rails project.&lt;/p&gt;

&lt;p&gt;Of course, there's no Rails without Ruby so let's start with that first. In &lt;em&gt;asdf&lt;/em&gt;, they call packages as &lt;em&gt;plugins&lt;/em&gt;. So whenever I mention the term &lt;em&gt;plugin&lt;/em&gt; in this section, I mean packages. 😉&lt;/p&gt;

&lt;p&gt;Let's add our first &lt;em&gt;asdf&lt;/em&gt; plugin via the &lt;code&gt;add&lt;/code&gt; command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  asdf plugin add ruby
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then let's install the latest version of Ruby via &lt;code&gt;install&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  asdf &lt;span class="nb"&gt;install &lt;/span&gt;ruby latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Afterwards, let's set our machine's global Ruby version via:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  asdf global ruby &amp;lt;version&amp;gt;
  &lt;span class="c"&gt;# asdf global ruby 2.7.1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check installed versions, 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;  asdf list ruby
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that we have Ruby, we also need to take care of the front-end side of things since Rails also uses &lt;em&gt;webpacker&lt;/em&gt; so let's install both &lt;em&gt;nodejs&lt;/em&gt; and &lt;em&gt;yarn&lt;/em&gt; to manage our packages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  asdf plugin add nodejs &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; asdf plugin add yarn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, proceed to add versions like how we installed Ruby earlier.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  asdf &lt;span class="nb"&gt;install &lt;/span&gt;nodejs latest &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; asdf &lt;span class="nb"&gt;install &lt;/span&gt;yarn latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To check if we successfully installed the plugins, use the general command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  asdf list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nice, we're ready to install Rails now so let's do just that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  gem &lt;span class="nb"&gt;install &lt;/span&gt;rails
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then let's proceed and create our new project with PostgreSQL as our database:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  rails new project-name &lt;span class="nt"&gt;-d&lt;/span&gt; postgresql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There we go! Now we have a new Rails project using &lt;em&gt;asdf&lt;/em&gt; with &lt;em&gt;PostgreSQL&lt;/em&gt; as the substitute database to SQLite. To test the local server, just run this within the project folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  rails server
  &lt;span class="c"&gt;# or rails s&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should spin up your local server and now you'll be able to check your fresh Rails app on the browser via &lt;code&gt;http://localhost:3000/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That's it for this setup guide, I hope this is useful to you as it is to me. If you need additional assistance, ping me at &lt;a href="mailto:nardparagas@gmail.com"&gt;nardparagas@gmail.com&lt;/a&gt; or on Twitter via &lt;a class="mentioned-user" href="https://dev.to/nards_paragas"&gt;@nards_paragas&lt;/a&gt;. I'd be happy to help out. Thanks for reading this guide!&lt;/p&gt;




&lt;p&gt;Further Notes:&lt;/p&gt;

&lt;p&gt;If the project shows an error on the browser saying that you're failing to connect to the database port, don't forget to start PostgreSQL via:&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="nb"&gt;sudo &lt;/span&gt;service postgresql start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then if the project displays an error telling you that &lt;code&gt;project-name_development&lt;/code&gt; database doesn't exist then run the following on your console with the project being the root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  bundle &lt;span class="nb"&gt;install&lt;/span&gt;
  &lt;span class="c"&gt;# To ensure that all required dependencies are already installed&lt;/span&gt;

  rails db:create
  rails db:migrate
  &lt;span class="c"&gt;# To create a new local database named after your project with the _development and _test name extensions&lt;/span&gt;

  rails server
  &lt;span class="c"&gt;# Or rails s to run your local server&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






    This guide was originally posted on my personal blog — https://blog.nardsparagas.com/




</description>
      <category>ruby</category>
      <category>rails</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Setup create-react-app with Tailwind CSS</title>
      <dc:creator>Nards Paragas</dc:creator>
      <pubDate>Sun, 07 Apr 2019 13:32:01 +0000</pubDate>
      <link>https://dev.to/nards_paragas/setup-create-react-app-with-tailwind-css-394e</link>
      <guid>https://dev.to/nards_paragas/setup-create-react-app-with-tailwind-css-394e</guid>
      <description>&lt;p&gt;Recently, I've been having fun with writing front-end code using &lt;em&gt;utility-first&lt;/em&gt; CSS frameworks instead of full-blown toolkit ones like &lt;a href="https://getbootstrap.com/" rel="noopener noreferrer"&gt;Bootstrap&lt;/a&gt; and &lt;a href="https://bulma.io/" rel="noopener noreferrer"&gt;Bulma&lt;/a&gt;. It helps me build and customize my page components immediately without having to write my own CSS from scratch. After seeing the attention that &lt;a href="https://tailwindcss.com/docs/what-is-tailwind/" rel="noopener noreferrer"&gt;Tailwind CSS&lt;/a&gt; is getting from different communities and platforms, I decided to try it in one of my personal projects. It made styling pages more fun because it's so easy to use and the documentation is really intuitive. &lt;/p&gt;

&lt;p&gt;Since it's component-friendly, I tried using it on my following project with create-react-app to learn how well it fits with Single-Page Applications. 😎&lt;/p&gt;

&lt;p&gt;And now, I will help you setup your own create-react-app project with Tailwind CSS. Let's get started!&lt;/p&gt;

&lt;p&gt;First, let's create a new ReactJS project with create-react-app.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-react-app your-app-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we can easily install the Tailwind CSS module afterwards on our fresh create-react-app project without having to touch the actual scaffolding. Just run the following command on npm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install tailwindcss --save-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installing Tailwind CSS, we'll have to generate our configuration file which is in javascript format that is accessible and easy to get used to by using this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx tailwind init tailwind.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can use any filename that you like but naming it &lt;code&gt;tailwind.js&lt;/code&gt; as default is a recommendation from the documentation which is usually nice to follow.&lt;/p&gt;

&lt;p&gt;Then, as what the documentation suggests, we'll add Tailwind as a &lt;a href="https://postcss.org/" rel="noopener noreferrer"&gt;PostCSS&lt;/a&gt; plugin in our build chain. Install these peer dependencies via:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install postcss-cli autoprefixer --save-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Afterwards, we'll have to create a &lt;code&gt;postcss.config.js&lt;/code&gt; file where we'll add Tailwind as a plugin by passing the path within.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;tailwindcss&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tailwindcss&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nf"&gt;tailwindcss&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./path/to/your/tailwind.js&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;autoprefixer&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your &lt;code&gt;tailwind.js&lt;/code&gt; and &lt;code&gt;postcss.config.js&lt;/code&gt; configuration files can be included in any part of your directory but right now, I just put it within the root level of my project.&lt;/p&gt;

&lt;p&gt;Next, we'll have to create an &lt;em&gt;entry point&lt;/em&gt; so we'll be able to use Tailwind in our CSS. In this case, I always use the &lt;a href="https://tailwindcss.com/docs/installation#3-use-tailwind-in-your-css" rel="noopener noreferrer"&gt;recommendation&lt;/a&gt; from the docs. &lt;/p&gt;

&lt;p&gt;Just copy and paste the code below within a new file named &lt;code&gt;tailwind.css&lt;/code&gt; located in your project's &lt;code&gt;/src&lt;/code&gt; directory or another custom folder within to separate your static and custom styles from generated ones. In my case, I created a custom &lt;code&gt;/styles&lt;/code&gt; directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/**
 * This injects Tailwind's base styles, which is a combination of
 * Normalize.css and some additional base styles.
 *
 * You can see the styles here:
 * https://github.com/tailwindcss/tailwindcss/blob/master/css/preflight.css
 *
 * If using `postcss-import`, use this import instead:
 *
 * @import "tailwindcss/base";
 */&lt;/span&gt;
&lt;span class="k"&gt;@tailwind&lt;/span&gt; &lt;span class="n"&gt;base&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c"&gt;/**
 * This injects any component classes registered by plugins.
 *
 * If using `postcss-import`, use this import instead:
 *
 * @import "tailwindcss/components";
 */&lt;/span&gt;
&lt;span class="k"&gt;@tailwind&lt;/span&gt; &lt;span class="n"&gt;components&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c"&gt;/**
 * Here you would add any of your custom component classes; stuff that you'd
 * want loaded *before* the utilities so that the utilities could still
 * override them.
 *
 * Example:
 *
 * .btn { ... }
 * .form-input { ... }
 *
 * Or if using a preprocessor or `postcss-import`:
 *
 * @import "components/buttons";
 * @import "components/forms";
 */&lt;/span&gt;

&lt;span class="c"&gt;/**
 * This injects all of Tailwind's utility classes, generated based on your
 * config file.
 *
 * If using `postcss-import`, use this import instead:
 *
 * @import "tailwindcss/utilities";
 */&lt;/span&gt;
&lt;span class="k"&gt;@tailwind&lt;/span&gt; &lt;span class="n"&gt;utilities&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c"&gt;/**
 * Here you would add any custom utilities you need that don't come out of the
 * box with Tailwind.
 *
 * Example :
 *
 * .bg-pattern-graph-paper { ... }
 * .skew-45 { ... }
 *
 * Or if using a preprocessor or `postcss-import`:
 *
 * @import "utilities/background-patterns";
 * @import "utilities/skew-transforms";
 */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After pasting this code and saving the file, we'll now install &lt;code&gt;npm-run-all&lt;/code&gt; as our tooling to run our npm scripts in parallel or sequential order. This is not an actual requirement but I highly recommend it especially to Windows users. This CLI tool helps so we can run our scripts in cross-platform.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install npm-run-all --save-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we'll have to configure our &lt;code&gt;package.json&lt;/code&gt; file to build our CSS and start our local create-react-app server. The &lt;code&gt;scripts&lt;/code&gt; section will now look similar to this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npm-run-all --parallel watch:css start:react"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"build"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npm-run-all build:css build:react"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"build:css"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"postcss src/styles/tailwind.css -o src/index.css"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"watch:css"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"postcss src/styles/tailwind.css -o src/index.css -w"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"start:react"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"react-scripts start"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"build:react"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"react-scripts build"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"react-scripts test"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"eject"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"react-scripts eject"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We'll now be able to run the &lt;code&gt;npm start&lt;/code&gt; script within npm to build our files and start our server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lastly, to test if Tailwind CSS is working within your components, we'll just have to import the generated &lt;code&gt;index.css&lt;/code&gt; file and add a utility class from Tailwind's documentation within our JSX like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;ReactDOM&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-dom&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./index.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-blue-100&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hello&lt;/span&gt; &lt;span class="nx"&gt;World&lt;/span&gt;&lt;span class="o"&gt;!&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#root&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's how it looks on the browser!&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%2F83h0u26b56ag76v7yhx6.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%2F83h0u26b56ag76v7yhx6.png" alt="Hello World Sample" width="800" height="486"&gt;&lt;/a&gt;&lt;/p&gt;

    This is a screenshot in 300% zoom made with &lt;a href="https://www.screely.com/" rel="noopener noreferrer"&gt;Screely&lt;/a&gt;.







&lt;p&gt;That's a wrap! Thanks for reading and I hope that I was able to introduce this setup properly. 😄&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>css</category>
      <category>react</category>
    </item>
  </channel>
</rss>
