<?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: Jesus Gilbert</title>
    <description>The latest articles on DEV Community by Jesus Gilbert (@jgilbertcastro).</description>
    <link>https://dev.to/jgilbertcastro</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%2F261701%2Fdad27f2c-26ae-4a2f-954e-a8a5487e4e82.jpeg</url>
      <title>DEV Community: Jesus Gilbert</title>
      <link>https://dev.to/jgilbertcastro</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jgilbertcastro"/>
    <language>en</language>
    <item>
      <title>Build a simple blog with GraphQL, Node.js, SQLite and (VUE, Angular Or ReactJS) - Part 2</title>
      <dc:creator>Jesus Gilbert</dc:creator>
      <pubDate>Fri, 15 Nov 2019 16:17:09 +0000</pubDate>
      <link>https://dev.to/jgilbertcastro/build-a-simple-blog-with-graphql-node-js-sqlite-and-vue-angular-or-reactjs-part-2-201j</link>
      <guid>https://dev.to/jgilbertcastro/build-a-simple-blog-with-graphql-node-js-sqlite-and-vue-angular-or-reactjs-part-2-201j</guid>
      <description>&lt;h2&gt;
  
  
  What we gonna do?
&lt;/h2&gt;

&lt;p&gt;In this tutorial, we will show you how to create a simple client with &lt;strong&gt;VUE&lt;/strong&gt;, to connect to graphql api we created in &lt;a href="https://dev.to/jgilbertcastro/build-a-simple-blog-with-graphql-node-js-sqlite-and-vue-angular-or-reactjs-3923"&gt;this previous tutorial&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Knowledge of JavaScript and Vue.&lt;/li&gt;
&lt;li&gt;You must have seen the previous tutorial: &lt;a href="https://dev.to/jgilbertcastro/build-a-simple-blog-with-graphql-node-js-sqlite-and-vue-angular-or-reactjs-3923"&gt;this previous tutorial&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Time to play the game! Hahaha
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Set up the project on previous directory created, run this on your favorite terminal:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;cd micro-blog&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mkdir micro-blog-clients&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cd micro-blog-clients&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;vue create vue-micro-blog-client&lt;br&gt;
&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cd vue-micro-blog-client&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Install the following dependencies:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;npm install --save vue-apollo graphql apollo-boost moment&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Configurate Apollo Client&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Apollo Client&lt;/strong&gt; is a complete state management library for JavaScript apps. Simply write a GraphQL query, and Apollo Client will take care of requesting and caching your data, as well as updating your UI. &lt;a href="https://www.apollographql.com/docs/react/"&gt;Read More&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Config Apollo Client

&lt;ul&gt;
&lt;li&gt;Open &lt;code&gt;&lt;em&gt;src/main.js&lt;/em&gt;&lt;/code&gt; and paste this code:&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Here we define const apolloClient to set graphql api url and add vueApollo plugin to global method&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Consuming micro-blog API

&lt;ul&gt;
&lt;li&gt;Edit Home.vue in &lt;code&gt;src/views&lt;/code&gt; and paste this code:
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;In this file we write a code to get post like a select query but with gql query&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add new File AddPost.vue in &lt;code&gt;src/views&lt;/code&gt; and paste this:
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Then we create a method to call by save button to add new post and another to format the create date. As you can notice here we define the mutate to call mutation to create a post and finally the method to clean the model&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Edit &lt;code&gt;src/router/index.js&lt;/code&gt; with this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;edit &lt;code&gt;src/App.vue&lt;/code&gt; and edit router line with this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Testing!
&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://www.youtube.com/watch?v=f2lINRlc9DM&amp;amp;feature=youtu.be"&gt;see video&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vue</category>
      <category>javascript</category>
      <category>node</category>
      <category>graphql</category>
    </item>
    <item>
      <title>Build a simple blog with GraphQL, Node.js, SQLite and (VUE, Angular Or ReactJS)</title>
      <dc:creator>Jesus Gilbert</dc:creator>
      <pubDate>Thu, 07 Nov 2019 17:27:08 +0000</pubDate>
      <link>https://dev.to/jgilbertcastro/build-a-simple-blog-with-graphql-node-js-sqlite-and-vue-angular-or-reactjs-3923</link>
      <guid>https://dev.to/jgilbertcastro/build-a-simple-blog-with-graphql-node-js-sqlite-and-vue-angular-or-reactjs-3923</guid>
      <description>&lt;h2&gt;
  
  
  What gonna we do?
&lt;/h2&gt;

&lt;p&gt;In this tutorial, we will show you how to create a simple and powerful &lt;strong&gt;Blog&lt;/strong&gt; with (&lt;strong&gt;VUE&lt;/strong&gt;, &lt;strong&gt;Angular&lt;/strong&gt; and &lt;strong&gt;React&lt;/strong&gt;), &lt;strong&gt;GraphQL&lt;/strong&gt;, &lt;strong&gt;Node.js&lt;/strong&gt; and &lt;strong&gt;SQLite&lt;/strong&gt;. &lt;/p&gt;

&lt;h4&gt;
  
  
  We will divide this tutorial as follows:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Part 1: Build a web api with GraphQL, Node.js and SQLite.&lt;/li&gt;
&lt;li&gt;Part 2: Build a Client in VUE.&lt;/li&gt;
&lt;li&gt;Part 3: Build a Client in Angular.&lt;/li&gt;
&lt;li&gt;Part 4: Build a Client in ReactJS.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;Node.js and JavaScript knowledge&lt;/li&gt;
&lt;li&gt;NPM Command&lt;/li&gt;
&lt;li&gt;knowledge of VUE,Angular or ReactJS&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is GraphQL?
&lt;/h2&gt;

&lt;p&gt;According to &lt;a href="https://graphql.org/learn:" rel="noopener noreferrer"&gt;https://graphql.org/learn:&lt;/a&gt; &lt;em&gt;GraphQL is a query language for your API, and a server-side runtime for executing queries by using a type system you define for your data. GraphQL isn't tied to any specific database or storage engine and is instead backed by your existing code and data&lt;/em&gt;                          &lt;/p&gt;

&lt;h2&gt;
  
  
  Well let's start the game
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Set up the project, run this on your favorite terminal:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;mkdir micro-blog&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;mkdir micro-blog-api&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cd micro-blog-api&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;npm init -y &lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Install the following dependencies:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;npm install  graphql express --save&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;npm install  express-graphql --save&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;npm install  sqlite3  --save&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Create an &lt;strong&gt;index.js&lt;/strong&gt; in the root to configurate GraphQL.&lt;/li&gt;

&lt;li&gt;Paste this code on &lt;strong&gt;index.js&lt;/strong&gt;:

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;li&gt;Create a &lt;strong&gt;graphql&lt;/strong&gt; folder and then create a &lt;strong&gt;post&lt;/strong&gt; folder inside
-Create a post.js inside of &lt;strong&gt;post&lt;/strong&gt; folder.&lt;/li&gt;

&lt;li&gt;Paste this code on post.js

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;li&gt;Update the package.json file to add de following script to start the api server

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;"start": "node index.js"&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Then on console or terminal run de server:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;npm run start&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Then if all is correct open your browser and go to localhost:4000/graphql and you gonna see your graphql server run:
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftxki3olyv9gf0i6ykoqa.PNG" alt="Alt Text"&gt;
&lt;/li&gt;

&lt;li&gt;If you want select all post run this

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;li&gt;If you want to create

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;li&gt;If you want to update

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;li&gt;If you want to delete

&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;This is all, if you want to clone this project go to github:&lt;/em&gt; &lt;a href="https://github.com/jgilbertcastro/micro-blog" rel="noopener noreferrer"&gt;https://github.com/jgilbertcastro/micro-blog&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the &lt;strong&gt;part 2&lt;/strong&gt; i'm gonna show you how to build a client for consume this API.&lt;/p&gt;

</description>
      <category>graphql</category>
      <category>node</category>
      <category>javascript</category>
      <category>sql</category>
    </item>
    <item>
      <title>Deploying an exiting VUE App on Netlify</title>
      <dc:creator>Jesus Gilbert</dc:creator>
      <pubDate>Fri, 01 Nov 2019 01:56:53 +0000</pubDate>
      <link>https://dev.to/jgilbertcastro/deploying-an-exiting-vue-app-on-netlify-2c64</link>
      <guid>https://dev.to/jgilbertcastro/deploying-an-exiting-vue-app-on-netlify-2c64</guid>
      <description>&lt;p&gt;&lt;em&gt;In this tutorial I will show you how to make a deployment of your VUE app in Netifly so you can test or share it.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Step 1: Create a VUE app&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;You must have knowledge of how to use &lt;strong&gt;NPM&lt;/strong&gt; or &lt;strong&gt;YARN&lt;/strong&gt; since we will use the build and &lt;strong&gt;DIST&lt;/strong&gt; folder to configure Netifly. I will assume that you already have an app created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IAIX9Rll--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/51iv5zxqm90vktchzlul.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IAIX9Rll--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/51iv5zxqm90vktchzlul.png" alt="Alt Text" width="212" height="300"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wCuZ3vwh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/egu4mgdy9z9eelxyeird.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wCuZ3vwh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/egu4mgdy9z9eelxyeird.png" alt="Alt Text" width="295" height="92"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;Step 2: Push your app to GitHub, GitLab Or Bitbucket&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;For this example I will use GitHub&lt;/p&gt;

&lt;p&gt;Create an account or authenticate with GitHub on Netlify.&lt;br&gt;
 Click on “New site from Git on Netifly”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OlNZwmvu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7yn2df5khzprq9h70x3y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OlNZwmvu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7yn2df5khzprq9h70x3y.png" alt="Alt Text" width="880" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Select GitHub or your favorite.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QEcwUHNE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/q5byv0yro8sqyvxjxyvw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QEcwUHNE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/q5byv0yro8sqyvxjxyvw.png" alt="Alt Text" width="880" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then you will have to choose the repository (s) so that they have &lt;br&gt;
 permission to be visible on Netifly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--J5bsJe3N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ndlaxscn1bqv7wwusvjt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--J5bsJe3N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ndlaxscn1bqv7wwusvjt.png" alt="Alt Text" width="880" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next you will have to choose the branch you want to publish and define &lt;br&gt;
 the command to build and the publication folder as specified in the &lt;br&gt;
 first step and click on “Deploy Site”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--h09HBdTC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/bpu7mbk5r2k5vvhynyrb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--h09HBdTC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/bpu7mbk5r2k5vvhynyrb.png" alt="Alt Text" width="596" height="649"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, you will see the first step is running “Deploying site”, if you &lt;br&gt;
 want to see the terminal click on it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pk1iD79p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/0w0b358wmfgwdjkgh8vn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pk1iD79p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/0w0b358wmfgwdjkgh8vn.png" alt="Alt Text" width="880" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When this finish the next step is “set up a custom domain” if you want!.&lt;br&gt;
 Finally, you can see at the top the self-generated name of your app and &lt;br&gt;
 the site for testing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t_upKqIV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/u68tkveopuxfg553cycf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t_upKqIV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/u68tkveopuxfg553cycf.png" alt="Alt Text" width="880" height="481"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Ready your app is flying on Netifly&lt;/em&gt;&lt;/p&gt;

</description>
      <category>vue</category>
      <category>javascript</category>
      <category>npm</category>
      <category>node</category>
    </item>
  </channel>
</rss>
