<?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: Santosh Bhandari</title>
    <description>The latest articles on DEV Community by Santosh Bhandari (@bsantosh909).</description>
    <link>https://dev.to/bsantosh909</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%2F401724%2F89b891dd-52e7-4a2e-936c-562bee111b4b.jpg</url>
      <title>DEV Community: Santosh Bhandari</title>
      <link>https://dev.to/bsantosh909</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bsantosh909"/>
    <language>en</language>
    <item>
      <title>Proper API Response structure {} - Importance &amp; Advantages!</title>
      <dc:creator>Santosh Bhandari</dc:creator>
      <pubDate>Wed, 01 Jun 2022 13:23:19 +0000</pubDate>
      <link>https://dev.to/bsantosh909/proper-api-response-structure-importance-advantages-152p</link>
      <guid>https://dev.to/bsantosh909/proper-api-response-structure-importance-advantages-152p</guid>
      <description>&lt;p&gt;ℹ️ &lt;strong&gt;&lt;em&gt;Before starting to write anything I would like to mention that all this is my personal thoughts based on my knowledge, experiences and issues I have faced in the past.&lt;/em&gt;&lt;/strong&gt; ℹ️&lt;/p&gt;

&lt;p&gt;It is the modern age of Internet, and there are thousands if not millions of website we have stumbled upon. Hundreds of which may be dynamic (i.e. fetch data whenever we request from some data source.)&lt;/p&gt;

&lt;p&gt;The whole process of data fetching &lt;strong&gt;in most of the cases&lt;/strong&gt; is done through API (SOAP, REST or GraphQL).&lt;br&gt;
Thus you can consider an API as the translator between two people who talk two different language. Just imagine what would happen if the translator translates it wrong.&lt;/p&gt;
&lt;h2&gt;
  
  
  Things to Consider
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Communication is key!&lt;/strong&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
Thus, there are lots of things which I think we should consider when setting up API response.&lt;/p&gt;
&lt;h3&gt;
  
  
  Do not use top level data Objects or Arrays
&lt;/h3&gt;

&lt;p&gt;I used to think it's easy to just send the data after fetching it directly from the Database.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
For e.g. sending this response for API call &lt;code&gt;https://api.xyz.com/users/1&lt;/code&gt;&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"fullName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Full Name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"dateOfBirth"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2000-01-01"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or the e.g. below for API call &lt;code&gt;https://api.xyz.com/users&lt;/code&gt;&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="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;"fullName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"First User"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"dateOfBirth"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2000-01-01"&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"fullName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Second User"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"dateOfBirth"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1990-04-04"&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="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While it will be easy to return the data like this, it will cause a huge problem sooner or later.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
The major problem being &lt;strong&gt;We can't add extra information in the first response object, and it's not even possible in the second response array.&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Use consistent variable name casing
&lt;/h3&gt;

&lt;p&gt;There are variable ways to name a variable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;camelCase&lt;/strong&gt; being the popular one around JavaScript developers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;snake_case&lt;/strong&gt; being the popular one around Python developers (&lt;em&gt;snake_case for Python developers... what a coincedence...&lt;/em&gt;).&lt;/li&gt;
&lt;li&gt;PascalCase&lt;/li&gt;
&lt;li&gt;kebab-case&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I think it was not really necessary to mention about it, because developers using a specific language already have their own preference over variable name casing.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Just a note from my side; using multiple name casing in a single project is a big &lt;strong&gt;NO&lt;/strong&gt;!&lt;/em&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
If possible, I would even suggest everyone to grab a name casing technique and follow it throughout the entire journey of programming in life.&lt;/p&gt;
&lt;h3&gt;
  
  
  Use proper variable names
&lt;/h3&gt;

&lt;p&gt;This is not just for the API response object, but also the codes itself and Database entity itself as well.&lt;/p&gt;

&lt;p&gt;I am pretty sure there are thousands of articles/notes metioning about how variable names should be written so I am not gonna go in depth, but I would like to attach a simple yet important note about this topic:&lt;br&gt;
&lt;br&gt;&lt;br&gt;
Variables name should be "&lt;strong&gt;As short as possible, as long as required&lt;/strong&gt;"!&lt;/p&gt;
&lt;h2&gt;
  
  
  Solution
&lt;/h2&gt;

&lt;p&gt;The simple yet powerful solution to API response structure is to simply have the data structure as follow:&lt;/p&gt;

&lt;p&gt;For e.g. sending this response for API call &lt;code&gt;https://api.xyz.com/users/1&lt;/code&gt;&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Successfully fetched User data"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"data"&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;"fullName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Full Name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"dateOfBirth"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2000-01-01"&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="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or the e.g. below for API call &lt;code&gt;https://api.xyz.com/users&lt;/code&gt;&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Successfully fetch Users data"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"pagination"&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;"page"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"count"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"perPage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&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;"data"&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"fullName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"First User"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"dateOfBirth"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2000-01-01"&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"fullName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Second User"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"dateOfBirth"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1990-04-04"&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="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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You might have already noticed that I am able to send message in the API response. And also in the second API usage example, I am even able to send pagination details.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
There will be thousands of data processing happening, so pagination is obviously to be done sooner or later. However in the previous approach we could not properly mention about the pagination details. Which we have overcome.&lt;/p&gt;

&lt;p&gt;You might now be wondering, &lt;strong&gt;Isn't it painful to access the data going one more level deep in the object?&lt;/strong&gt; i.e. &lt;code&gt;response.data&lt;/code&gt; instead of &lt;code&gt;response&lt;/code&gt;.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
The answer is Yes, but apart from that downside, it's only good point I can think up of.&lt;/p&gt;

&lt;p&gt;For e.g. lets say we have to respond with error message if the API request is invalid. Following this approach, we can simply send the response like:&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Invalid email address"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;or&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;any&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;other&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;error&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;message&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now in the frontend/mobile app, we can always refer to &lt;code&gt;response.message&lt;/code&gt; to get the information about the API usage. And to understand if the API call was a success or failure, we can use HTTP status code of the API call.&lt;/p&gt;

&lt;h3&gt;
  
  
  The main point
&lt;/h3&gt;

&lt;p&gt;The major point of all this discussion is that the APi response should never be a top level data object itself.&lt;/p&gt;

&lt;p&gt;Instead use an object which contains all the information you want ot share from server to frontend (not related to API).&lt;br&gt;
&lt;br&gt;&lt;br&gt;
And within the top level object, include the data related to the API call inside a &lt;code&gt;result&lt;/code&gt; or &lt;code&gt;data&lt;/code&gt; key.&lt;/p&gt;

&lt;p&gt;This will result in &lt;strong&gt;clean&lt;/strong&gt; and &lt;strong&gt;consistent&lt;/strong&gt; API response acorss every API endpoint. And also you will be able to share extra information which is not related to the specific API call.&lt;/p&gt;

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

&lt;p&gt;I have done this mistake in the past and learnt a hard way from it. That doesn't mean you have to make this mistake yourself to learn.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
You can try implementing this approach I have mentioned in your next project (or even your current project if possible without major breaking changes).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you are someone developing API, I would love to hear your thoughts about this approach and if you would like to switch to this approach (if not already using).&lt;/em&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;em&gt;If you are someone who consumes API, I would love to hear your thoughts about how this change (if it is not what your current API provides) would affect you.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you are already using this approach, then cheers, you are making life of yourself and the frontend developer easy 😉&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>api</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>API Party: Working with APIs!</title>
      <dc:creator>Santosh Bhandari</dc:creator>
      <pubDate>Fri, 06 Nov 2020 11:54:08 +0000</pubDate>
      <link>https://dev.to/bsantosh909/api-party-working-with-apis-1fg9</link>
      <guid>https://dev.to/bsantosh909/api-party-working-with-apis-1fg9</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;👋 Hello everyone, I hope everyone is doing fine!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I have been using Vue &amp;amp; Nuxt for a while now to develop various webapps. Most of mine works are personal or hobby projects.&lt;/p&gt;

&lt;p&gt;For the past 3-4 days I have been working on a new project. &lt;strong&gt;API Party&lt;/strong&gt;!!&lt;br&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%2Fi%2F0lvgr0fmpahffml2ygd8.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%2Fi%2F0lvgr0fmpahffml2ygd8.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Github link to the project is available at the bottom!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can check the project live here: &lt;a href="https://apiparty.vercel.app" rel="noopener noreferrer"&gt;https://apiparty.vercel.app&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  What is it?
&lt;/h2&gt;

&lt;p&gt;API party is yet another project to list hundreds and thousands of awesome API that are being used all around the world.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why another project then?
&lt;/h2&gt;

&lt;p&gt;Earlier I was working on a project but due to some error I got bored with it. After that I checked my to-do list which has stuffs from years back. Then I saw this project idea which I had noted when I didn't even know web dev. &lt;em&gt;So then I instantly started working on it.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Also I found it can be useful for many users to find just the API they are looking for.&lt;/p&gt;
&lt;h2&gt;
  
  
  What are the features?
&lt;/h2&gt;

&lt;p&gt;As I already said the entire project is done within 3-4 days of time period with around ~3:45 mins of work (includes today's work time as well). Because of that there are really few features. But still here is the list:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Source&lt;/li&gt;
&lt;li&gt;Categorized list&lt;/li&gt;
&lt;li&gt;Filters (search only as of now &lt;code&gt;Will expand for sure&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Nice UI (&lt;em&gt;I would love to know if you like it or not&lt;/em&gt; 😉)&lt;/li&gt;
&lt;li&gt;Miscs information about the API

&lt;ul&gt;
&lt;li&gt;HTTPS support&lt;/li&gt;
&lt;li&gt;Authentication type&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Documentation/API links&lt;/li&gt;
&lt;li&gt;And much more to come...&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Future Plans
&lt;/h2&gt;

&lt;p&gt;Here are some of the ideas that I have in my mind. Hopefully they will land soon on the production!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add more filters (Based on the misc. details)&lt;/li&gt;
&lt;li&gt;Add articles letting users know about API, usage and more&lt;/li&gt;
&lt;li&gt;Move to a dedicated domain&lt;/li&gt;
&lt;li&gt;And much more to come...&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Open to contributions
&lt;/h2&gt;

&lt;p&gt;As of now I am the only one working on this project and I have shared this to limited number of users that I know. You guys can use/share it with your friends and community members so that they can know about it and hopefully the project can benefit the user in any way possible.&lt;/p&gt;

&lt;p&gt;But for the project to be beneficial it has to contain good amount of resources that are helpful right ??&lt;br&gt;
The project has few resources (API details) as of now. So you can contribute to the project.&lt;/p&gt;

&lt;p&gt;Let's make it &lt;strong&gt;By the PEOPLE, to the PEOPLE, for the PEOPLE&lt;/strong&gt;!&lt;/p&gt;
&lt;h2&gt;
  
  
  Post Hacktoberfest
&lt;/h2&gt;

&lt;p&gt;It hasn't been even a week since the end of Hacktoberfest 2020. The question is &lt;strong&gt;Are you still contributing to open source??&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you had been looking to contribute but were unable to find what and where to do, then you can contribute to this specific project.&lt;/p&gt;

&lt;p&gt;You can contribute to this project by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Submitting bug reports/ideas to improve the project&lt;/li&gt;
&lt;li&gt;Adding new API to the list&lt;/li&gt;
&lt;li&gt;Engaging with the community&lt;/li&gt;
&lt;li&gt;Sharing the project with other people&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All these stated above and many more are the ways to contribute to open-source projects. And I would be happy to see any sort of contributions 😄&lt;/p&gt;




&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/bsantosh909" rel="noopener noreferrer"&gt;
        bsantosh909
      &lt;/a&gt; / &lt;a href="https://github.com/bsantosh909/api-party" rel="noopener noreferrer"&gt;
        api-party
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Awesome list of amazing API to be used!
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;





&lt;p&gt;If you read all the way upto here then I really appreciate it. Leave your thoughts about the project in the comments below. ✌️&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#StaySafe&lt;/code&gt; &lt;code&gt;#KeepDeveloping&lt;/code&gt; &lt;code&gt;#BeHappy&lt;/code&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>nuxt</category>
      <category>webdev</category>
      <category>api</category>
    </item>
    <item>
      <title>Adding commenting system to website!</title>
      <dc:creator>Santosh Bhandari</dc:creator>
      <pubDate>Thu, 11 Jun 2020 13:32:51 +0000</pubDate>
      <link>https://dev.to/bsantosh909/adding-commenting-system-to-website-3h00</link>
      <guid>https://dev.to/bsantosh909/adding-commenting-system-to-website-3h00</guid>
      <description>&lt;center&gt;
&lt;br&gt;
&lt;em&gt;This article was originally posted on my blog &lt;a href="https://santoshb.com.np/blog/adding-user-engagement-with-comments-to-websites/"&gt;here&lt;/a&gt;!&lt;/em&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;The blog article over at my site contains few other alternatives that are not listed below!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;



&lt;p&gt;&lt;em&gt;Also I am open for any sort of feedbacks&lt;/em&gt; ❤️&lt;br&gt;
&lt;/p&gt;


&lt;/center&gt;




&lt;p&gt;A community or website can operate better if users can engage more over it. If your website already doesn't have the commenting system then you are missing a lot from your users. Users prefer to be over the website where one can engage actively i.e. discuss, comments, react to the articles/content etc. Don't you prefer the same way?&lt;/p&gt;

&lt;p&gt;If you also prefer having users on your website engaged then you have made a wise decision being here. Today I am going to talk about the user engagements in any website in general.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Users, including me, would love to have any sort of engagement method when visiting a website. I prefer to talk actively with other users and discussion about various topics. If I find website which doesn't allow me to comment for any article published there, then most likely I won't visit the website again. Talking from the perspective of website developer it is a huge loss. So better not delay a moment to implement the commenting system in your website/blog if you know how to do it. But if you are not aware where and how to start then proceede through the article till the end. After that you will be able to implement comments in your website with no problem at all!&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation
&lt;/h2&gt;

&lt;p&gt;If you are a big company or a big project with dedicated resources and members then implementing comments in your website won't be hard at all. &lt;strong&gt;But what if you are a solo developer or a small team with limited resources?&lt;/strong&gt; Things can be really tough right? Yeah it can be, but do not fear. &lt;em&gt;I have you covered this time!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I took a day out of my life and invested it all to help everyone out there just like me; just like me who wanted to implement comments system in their website but were in a hard spot with no knowledge about where to start. I have made a small list with every necessary details possible so that you won't have to wonder anywhere else to start with adding comments to your site.&lt;/p&gt;

&lt;p&gt;These commenting plugins below are what I found by searching around the internet. There may be many more out there, but after knowing about these you won't have to wonder anywhere else. So let have a look at them:&lt;/p&gt;

&lt;h3&gt;
  
  
  Disqus
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://disqus.com/"&gt;Disqus&lt;/a&gt; is the most popular commenting system that lots of websites use. Its amazing features and ease of use makes it the most popular choice amazing many users and developers. It comes with really amazing features, so lets have a look at them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;FREE&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Supports devices from desktop to mobile, including Google AMP&lt;/li&gt;
&lt;li&gt;Supports 70 languages and counting&lt;/li&gt;
&lt;li&gt;Real time comments&lt;/li&gt;
&lt;li&gt;Reactions&lt;/li&gt;
&lt;li&gt;Automatically adapts to your site's design and colors or you can set it to your own liking&lt;/li&gt;
&lt;li&gt;Allows users to comment with rich media i.e. picture, gifs and videos&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Complete moderation options&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Automated spam moderation&lt;/li&gt;
&lt;li&gt;Notifications&lt;/li&gt;
&lt;li&gt;Content recirculation&lt;/li&gt;
&lt;li&gt;Subscriptions&lt;/li&gt;
&lt;li&gt;Analytics&lt;/li&gt;
&lt;li&gt;And many more...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sorry if I went for only listing the features. Because if I had to describe them all then this article would get super long. So I though to keep and short and meaningful.&lt;br&gt;
If you want to have a detailed information about all the feature you can head to the official disqus site and get detailed information about anything you want to know.&lt;/p&gt;

&lt;p&gt;Although I would love to mention that disqus is &lt;strong&gt;FREE&lt;/strong&gt;. But you do have the options to update to a paid version with addition features on the line. It's completely your choice if you want to upgrade or not. But if you are a solo developer or small team then I would suggest to work with the free version. Because It is REALLY AWESOME even when used as free. &lt;/p&gt;

&lt;p&gt;Even &lt;a href="https://santoshb.com.np/blog"&gt;my site&lt;/a&gt; has various blog articles with disqus comments plugin installed. Which means if you are reading this article on my site then you can let me know in the comments below. If not head over to this article originally posted on my site and let me know &lt;em&gt;I love when people interact with me!&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Facebook
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://facebook.com"&gt;Facebook&lt;/a&gt; is a really well known global brand. Even if you don't user it you might have heard about it once in your lifetime. That already explains how famous it is. There are millions of people using facebook and that is one of the reason why facebook launched it's own commenting system.&lt;/p&gt;

&lt;p&gt;If your website is focused upon user base from facebook or if your site is related to facebook by any means then you should go for this system. If not I would suggest not to add extra pain in your life. Wonder why? Lets get to the feature and you will know by yourself!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;FREE&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Can be used with users registered on facebook only. &lt;em&gt;That's why not good for site targetting audience outside of facebook!&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Facebook life feel. &lt;em&gt;It is exactly as what you would see in the platform itself, so gives the home like feeling to the users!&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Admin panel for all moderation and related stuffs&lt;/li&gt;
&lt;li&gt;Webhooks&lt;/li&gt;
&lt;li&gt;And many more...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although facebook itself is really well known global brand, the commenting system provided by it is not good outside the scope of fecebook realted stuffs. So better realize and think about it if you are planning to use it on your site already!&lt;/p&gt;

&lt;h3&gt;
  
  
  Spot.IM
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.spot.im/"&gt;Spot.IM&lt;/a&gt; is a really new thing for me as well. I had never heard about it till date. &lt;em&gt;&lt;strong&gt;Thanks to you guys I learned something new&lt;/strong&gt;&lt;/em&gt; But after looking at it the only thing I can say is &lt;strong&gt;WOW&lt;/strong&gt;. It looks really promising because of all the features it has, but I could not find any details about it's pricing so you guys got some task to do if you plan to use it! Lets dive into it's features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Conversations; yeah thats simply commenting system but with really rich detailings though!&lt;/li&gt;
&lt;li&gt;Community spotlight&lt;/li&gt;
&lt;li&gt;Live blogs; to give real time updates to your users for anything critical, important or emergency&lt;/li&gt;
&lt;li&gt;Reactions&lt;/li&gt;
&lt;li&gt;Powerful moderation options with AI integrations&lt;/li&gt;
&lt;li&gt;User profiles and notifications&lt;/li&gt;
&lt;li&gt;Analytics and insight&lt;/li&gt;
&lt;li&gt;And many more...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All these features look really promising for sure. I am already thinking of doing a small project to test it out with amazing people like you. If you are eager just like me or if you already use it then let me know in the comments below.&lt;/p&gt;

&lt;h3&gt;
  
  
  HTML Comment Box
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.htmlcommentbox.com/"&gt;HTML Comment Box&lt;/a&gt; is simple yet powerful commenting system. There is nothing much to describe about it because it is just plug-and-play stuff. But if you have a look at the site you will see additional widgets available. Those are really awesome. So make sure to have look at them!&lt;/p&gt;

&lt;h3&gt;
  
  
  Viafoura
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://viafoura.com/"&gt;Viafoura&lt;/a&gt; is another of those promising looking commenting system I found while working on this article. Lets dig right into its features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Real time conversations &lt;em&gt;Includes rich features display&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Live stories for live streams&lt;/li&gt;
&lt;li&gt;Community chat&lt;/li&gt;
&lt;li&gt;Automated moderation&lt;/li&gt;
&lt;li&gt;Moderation possibilities&lt;/li&gt;
&lt;li&gt;Community reviews&lt;/li&gt;
&lt;li&gt;Integrated login&lt;/li&gt;
&lt;li&gt;User personlization&lt;/li&gt;
&lt;li&gt;And many more...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is yet another of that amazing stuff which I want to try out someday.. Let me know in the comments below if you are impatient just like me to test it out!&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing notes
&lt;/h2&gt;

&lt;p&gt;It was a really fun time writing article. And I learnt something new today about all the posibilities of commenting system. I did realize that disqus or facebook is not the only stuff that is taking the market. There are really awesome stuffs, &lt;em&gt;maybe even better than those existing&lt;/em&gt; that is still unknown to many people just like me.&lt;/p&gt;

&lt;p&gt;As I discussed in the entire article &lt;strong&gt;Let me know about all your thoughts and feedbacks&lt;/strong&gt; about this article. I will be hearing them all and hopefully you will teach me something new as well.&lt;/p&gt;

&lt;p&gt;Until next time, farewell, Stay Safe!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>html</category>
      <category>comments</category>
      <category>interaction</category>
    </item>
    <item>
      <title>What keeps you motivated ??</title>
      <dc:creator>Santosh Bhandari</dc:creator>
      <pubDate>Sun, 07 Jun 2020 12:29:01 +0000</pubDate>
      <link>https://dev.to/bsantosh909/what-keeps-you-motivated-287e</link>
      <guid>https://dev.to/bsantosh909/what-keeps-you-motivated-287e</guid>
      <description>&lt;ul&gt;
&lt;li&gt;Over &lt;strong&gt;6&lt;/strong&gt; years of programming knowledge&lt;/li&gt;
&lt;li&gt;tranformed form complete &lt;strong&gt;noob&lt;/strong&gt; to &lt;strong&gt;not a noob anymore&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;20+&lt;/strong&gt; projects started (&lt;em&gt;double or triple the count if rewrites are allowed&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;But the end result, &lt;strong&gt;No successful project till date&lt;/strong&gt;!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The journey of over 6 years of programming has really been fun. I learnt so so so many new stuffs and improved myself a lot. But when I look back at the successful achievements of mine, I see nothing to be shown.&lt;/p&gt;

&lt;p&gt;I really am proud of what I have learnt, but there definitely is something missing because of which there is no actual outcome. I never have reached the completion stage for any project because I get demotivated by various factors. But the cycle goes on I do get back to them and make minor progress, and leave it back again.&lt;/p&gt;

&lt;p&gt;I really would love to know what keeps you guys motivated, maybe I can  learn something from you guys that will keep me motivated as well ??&lt;/p&gt;






&lt;center&gt;Sharing experiences is the best way to help other grow ❤️  &lt;/center&gt;

</description>
      <category>discuss</category>
      <category>programming</category>
      <category>motivation</category>
    </item>
    <item>
      <title>Creating Markdown powered blog with nuxt</title>
      <dc:creator>Santosh Bhandari</dc:creator>
      <pubDate>Sun, 07 Jun 2020 10:31:47 +0000</pubDate>
      <link>https://dev.to/bsantosh909/creating-markdown-powered-blog-with-nuxt-146g</link>
      <guid>https://dev.to/bsantosh909/creating-markdown-powered-blog-with-nuxt-146g</guid>
      <description>&lt;p&gt;Creating blog is a passion of lots of people; that includes me. But starting out with it is really really hard. So I thought to share an easy way (If you are familiar with &lt;strong&gt;Vue&lt;/strong&gt;) to create own blog. Technically there are various methods of doing this. But of the most impressive and famous way is Jamstack and the entire article is based upon it.&lt;/p&gt;

&lt;h2&gt;
  
  
  About Jamstack
&lt;/h2&gt;

&lt;p&gt;So if you are already wondering what is jamstack and why jamstack, then you should head over to the &lt;a href="https://jamstack.org/"&gt;jamstack website&lt;/a&gt; to know more about it. Because if I started talking about it, the article can get really long 😜. Altough the below listed are very basic ones but here are some awesome feature you should know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No need of server to host website&lt;/li&gt;
&lt;li&gt;Higher security&lt;/li&gt;
&lt;li&gt;Cheaper&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With that being said, JAMstack makes things only better!&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;To get started with buliding your own blog we need to install few things. &lt;em&gt;You need to have &lt;strong&gt;Node.js&lt;/strong&gt; installed on your machine!&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Nuxt
&lt;/h4&gt;

&lt;p&gt;It is the most essential stuff today. It is really easy if you know vue. Also it provides way more than just generating static sites. This is just one of its awesome features. With it you can try so many awesome things and it even makes so many complex stuffs really really easy. It also has an active community and really helpful developers and core team members. To know more about it you can have a look at the &lt;a href="https://nuxtjs.org/"&gt;official website&lt;/a&gt;!&lt;/p&gt;

&lt;h4&gt;
  
  
  Nuxt content
&lt;/h4&gt;

&lt;p&gt;Nuxt content is an official module by the nuxt team which aims to provide ease to use features while working with &lt;em&gt;markdown&lt;/em&gt;, &lt;em&gt;JSON&lt;/em&gt;, &lt;em&gt;YAML&lt;/em&gt; and _CSV files. Although it is a preety nuch module by the nuxt team, it already contains really amazing feature which makes our task easier. Also the dev team is working to add new features to the module. So you should keep track of the module to learn about the new amazing features that the module will be getting. More information about it can be found &lt;a href="https://content.nuxtjs.org/"&gt;here&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;Thats basically what we will need to start developing the blog. So lets dive deep into building the blog!&lt;/p&gt;

&lt;h2&gt;
  
  
  Development
&lt;/h2&gt;

&lt;p&gt;There are few phases of developing the blog. I will try to explain them with minimum words but with maximum meaning. I hope it helps you!&lt;/p&gt;

&lt;h3&gt;
  
  
  Writing a blog article
&lt;/h3&gt;

&lt;p&gt;With the &lt;code&gt;@nuxt/content&lt;/code&gt; module activated you can start with ease to write blog articles. ALl you should be doing is create a &lt;strong&gt;content&lt;/strong&gt; directory in the root of your project directory and create files inside it. Generally you can place your article files directly inside the content directory. But if you plan to host files other than blog articles with the content module, I would suggest to create your articles inside &lt;code&gt;/content/blog&lt;/code&gt; or any subdirectory of your choice. &lt;strong&gt;I strongly recommend to place the markdown articles into a subdirectory. You will understand the reason while reading through this article!&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;article1"&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;

&lt;span class="gu"&gt;## About this article&lt;/span&gt;
You can write any markdown content here and it can be easily displayed later!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you see in the example above I have added YAML front matter block. All the items added will be injected into the article object and you will be able to see them when you fetch the article object. This can be really helpful if you want to add some properties to the article. You can even set the title, date, author details or anything else in the markdown file and later fetch, use them as you like.&lt;/p&gt;

&lt;p&gt;All of your general content goes below the front matter block. You can do everything that you can do with a markdown file. On top of that you can even use html and vue components in the markdown file and with the magic of the module, it will be rendered properly. Which means you can customize your content in the markdown file completely! Also the content module provides syntax highlighting using &lt;a href="https://prismjs.com/"&gt;PrismJS&lt;/a&gt;. So you can even demonstrate codeblock examples!&lt;/p&gt;

&lt;p&gt;There is a lot more to writing content though. You can definitely check it out &lt;a href="https://content.nuxtjs.org/writing/"&gt;here&lt;/a&gt;!&lt;/p&gt;

&lt;h3&gt;
  
  
  Fetching the blog article
&lt;/h3&gt;

&lt;p&gt;Writing alone is not enough right? You would want to fetch the articles and display them. So why not look into fetching the articles next.&lt;/p&gt;

&lt;p&gt;Fetching the contents is really really easy. The content module globally injects a &lt;strong&gt;$content&lt;/strong&gt; instace, so you can access it anywhere within the project; either &lt;code&gt;this.$content&lt;/code&gt; or &lt;code&gt;context.$content&lt;/code&gt; based upon where you use it. That is really easy, isn't it?&lt;/p&gt;

&lt;p&gt;Based upon the usage, I can think up of two specific ways you would want to fetch the content. We will look into both the usage methods below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetching all the articles to list them out&lt;/li&gt;
&lt;li&gt;Fetching a specific article to display it's content&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first use case for fetching the articles is to list them out. While fetching the article list you would either want to fetch all the articles or even filter the articles based upon some parameters. Here is how you would do that:&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="c1"&gt;// Fetching all the article list&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;articles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$content&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;blog&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Fetching articles with filters&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;articles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$content&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;blog&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="nx"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;title&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;welcome&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="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Fetching specific article [1]&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;article&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$content&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;blog&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;articleSlug&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Fetching specific article [2]&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;article&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$content&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;blog&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="nx"&gt;where&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;articleSlug&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The first method seen in the example above fetches all the articles inside the &lt;code&gt;/content/blog&lt;/code&gt; directory.&lt;/li&gt;
&lt;li&gt;The second method also fetches all the articles inside the &lt;code&gt;/content/blog&lt;/code&gt; but returns result matching the search criteria. &lt;em&gt;Useful when you are implement a search bar!&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;The third method fetches a specific article based upon the second parameter passed to it. &lt;strong&gt;You get an object instead of array when fetching in this method!&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;The last method is just an alternative to the third method. &lt;strong&gt;It returns an array instead of Object, so you might want to treat it as an array!&lt;/strong&gt; &lt;em&gt;Speaking from experience already...&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You might now always want all the properties of the content. For e.g. when listing title only, you can simply get only the title of the articles using the &lt;code&gt;.only()&lt;/code&gt; method i.e. &lt;code&gt;.only(['title'])&lt;/code&gt;. You can even limit the number of items in the result using the &lt;code&gt;.limit(n)&lt;/code&gt; chainable method. Also you can skip number of results using the &lt;code&gt;.skip()&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;I personally use the last method to fetch a specific article and I would even suggest you to do so. It is because it will work even if you decide to change the structure of your content directory and more stuffs here and there. &lt;em&gt;I personally do that a lot!&lt;/em&gt; But for the earlier method i.e. you will have to know the exact file location otherwise you will not be able to fetch it.&lt;/p&gt;

&lt;p&gt;The content module provides way more control over how you fetch the articles. There is just too many possibilities how you can control fetching your content. It is as good as impossible to know about your specific use case. Thus to know how to customize your fetch request you can have a look &lt;a href="https://content.nuxtjs.org/fetching/"&gt;here&lt;/a&gt;!&lt;/p&gt;

&lt;h3&gt;
  
  
  Displaying the blog article
&lt;/h3&gt;

&lt;p&gt;This has to be the most easiest task throughout this article. The content module provides a &lt;strong&gt;use-and-enjoy&lt;/strong&gt; component which we will be simply using to display the content of our blog article.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;nuxt-content&lt;/span&gt; &lt;span class="na"&gt;:document=&lt;/span&gt;&lt;span class="s"&gt;"article"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above example will simply display the content of the fetched article. How you customize the page is completely upto you yet again. The article passed into the &lt;code&gt;document&lt;/code&gt; prop is the object that we obtained after fetching specific article after the dyanmic slug param. Theoritically that is all you should do to display the content of the article. But you would love to add more details right? You can simply modify the page template to show off your imagination!&lt;/p&gt;

&lt;p&gt;Furthermore your page design will not be included into the markdown content. Thus if you want to customize the markdown with custom style you will have to do that like:&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;/* Making the h2 component have red color. This is just me, you don't have be bad with examples! */&lt;/span&gt;
&lt;span class="nc"&gt;.nuxt-content&lt;/span&gt; &lt;span class="nt"&gt;h2&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&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;A live example of the usage can be found &lt;a href="https://github.com/nuxt/content/blob/master/docs/pages/_slug.vue#L65-L191"&gt;here&lt;/a&gt;! I too have used the same thing... &lt;em&gt;No copyright please!&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Working with dynamic routes
&lt;/h3&gt;

&lt;p&gt;The core concept of this article is working with static generate site. So we will have to specify all the routes (&lt;em&gt;the article list for us&lt;/em&gt;) while generating the site. This too is really easy with the content module. With that simple addition of the code below to &lt;code&gt;nuxt.config.js&lt;/code&gt; your site will be ready to handle the dyanmic article page.&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;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;modules&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@nuxt/content&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nx"&gt;routes&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;$content&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&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;@nuxt/content&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;articles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;$content&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;blog&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;only&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;slug&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]).&lt;/span&gt;&lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

      &lt;span class="c1"&gt;// Generating the routes for the unique page of each article...&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;articles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;article&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;`/article/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;article&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&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;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; From 2.13+, &lt;code&gt;nuxt export&lt;/code&gt; is said to have a crawler integrade to the core module. Which means the code above will not have to be injected into your config file!&lt;/p&gt;

&lt;p&gt;That has to be all with the development of a basic markdown powered blog using &lt;code&gt;nuxt&lt;/code&gt; and &lt;code&gt;nuxt-content&lt;/code&gt;. If you did everything right then your blog should be working as well. If not just tell me in the comments below!&lt;/p&gt;

&lt;p&gt;Also like any other module, content also provides customization options so that you can customize the behavious as you like. You can check about the customization options &lt;a href="https://content.nuxtjs.org/configuration"&gt;here&lt;/a&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus
&lt;/h2&gt;

&lt;p&gt;It was a really long article to write and I am preety sure it was hard to read it all as well. So I thought about sharing some interesting things with you guys. I actually wanted to list out points/stuffs which you might find interesting, and you can even integrate it with the blog you will be making with the awesome &lt;code&gt;content&lt;/code&gt; module:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.netlify.com/"&gt;Netlify&lt;/a&gt;: Host the blog you created right away!&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://content.nuxtjs.org/advanced#contentfilebeforeinsert"&gt;Implement reading time&lt;/a&gt;: You can implement reading time in your articles. &lt;em&gt;Details are from the official nuxt-content module!&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/nuxt-community/sitemap-module"&gt;Sitemap&lt;/a&gt;: Let the web crawlers know each and every of your content!&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/nuxt-community/feed-module"&gt;Blog feeds&lt;/a&gt;: Let your community know when articles are out!&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/nuxt-community/color-mode-module/"&gt;Nuxt color mode&lt;/a&gt;: Which do you prefer, day or night ??&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/nuxt/components"&gt;Nuxt components&lt;/a&gt;: Get rid of those component imports that occur everywhere. &lt;em&gt;Comes with core nuxt 2.13+&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://disqus.com/"&gt;Disqus&lt;/a&gt;: I love user engaged community!

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.npmjs.com/package/vue-disqus"&gt;vue-disqus&lt;/a&gt; to make things easy.&lt;/li&gt;
&lt;li&gt;Optionally you can go for facebook comment plugin or other comment plugin provider!&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/TheLearneer/santoshb.com.np"&gt;&lt;strong&gt;This site&lt;/strong&gt;&lt;/a&gt; is a live example and demo of using this article! &lt;em&gt;Lots of changes will be made to the site and article itself to show what more you can do with it!&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;






&lt;center&gt;I am always open for feebacks ❤️&lt;/center&gt;






&lt;center&gt;Originally posted on &lt;a href="https://santoshb.com.np/blog/creating-markdown-powered-blog-with-ease/"&gt;my blog here&lt;/a&gt;&lt;br&gt;
&lt;/center&gt;




</description>
      <category>vue</category>
      <category>blog</category>
      <category>markdown</category>
      <category>nuxt</category>
    </item>
  </channel>
</rss>
